Add Libraries To Runwar Necessary For URLRewrite Proxy

Description

To be able to use <to type="proxy"> in urlrewrite these are needed in the runwar:

org.apache.commons.httpclient
org.apache.commons.codec
org.apache.commons.logging

Please include them.

Thank you.

Activity

Show:
Brad Wood
July 7, 2020, 5:56 PM

Thanks for the ticket. These used to work, but I bet Lucee 4 used to load those classes in the system classloader, but now Lucee 5 probably has them tucked away inside an OSGI bundle that is not visible to the Tuckey class loader. The annoying part is that this means I will need to bloat the CommandBox download and install size to include these again in the main lib folder.

As a workaround, you should be able to include those jars yourself via the libDirs setting of your server.json file. The next version of CommandBox is looking to allow you to tap into the Undertow Predicate Language which includes the ability to configure a proxy using the native undertow support. If this works the same, I’d be tempted to push people to using that instead if they want a proxy.

Jack Chase
July 7, 2020, 6:19 PM

I tried using the libDirs setting but it would not work.

I added the libraries to the runwar and now works. Of course It would need to be done for any update.

Brad Wood
July 7, 2020, 6:48 PM

Hmm, that’s too bad it didn’t work. I thought the jars specified in the libdirs setting were loaded by the same classloader that Runwar/Undertow/Tuckey used. We load the jars into a URLClassLoader and then when we wire up Undertow, we’re using the

http://undertow.io/javadoc/2.0.x/io/undertow/servlet/api/DeploymentInfo.html#setClassLoader-java.lang.ClassLoader-

method on the Undertow deployment Info builder to set the class loader in, but Tuckey rewrites itself must not be using it.

Brad Wood
July 7, 2020, 6:48 PM

What error do you get when you try?

Jack Chase
July 7, 2020, 7:01 PM

Using --console --debug I would get that the class could not be found. Only when a proxy rule matched.

Assignee

Unassigned

Reporter

Jack Chase

Labels

None

Affects versions

None

Fix versions

None

Priority

Major
Configure