On 16/04/2023 12:36, Thorsten Schöning wrote:
Hi everyone,

I have some app consisting of a directory layout with some bundled
Tomcat, containing at least one exploded webapp. For various reasons,

What are those reasons? I'm wondering if the reasons have any impact on the answer.

that webbapp needs its own classloader, which is currently configured
in context.xml of Tomcat and stored in its own lib-dir. I don't like
putting custom JARs into the default deployment of Tomcat too much.

<!-- use own classloader, reading classpath file -->
<Loader loaderClass="[...]" delegate="true"/>

So, is there some way to put the JAR elsewhere?

Yes, as long as you tell Tomcat where to find it.

Whatever I tested didn't work, e.g. adding the JAR to "common.loader".

That should have worked and is the approach I'd recommend. Exactly what did you change when you tried this?

But I must admit that I didn't fully understand if common.loader is
used to load the custom loader at all or only afterwards and stuff.

Or is there some way to not use Tomcat's "Loader" above and only
maintain a custom, webapp-specific classloader in the one webapp
needing it?

No. Tomcat needs to be able to load the custom class loader in order to configure it.

Mark



I've searched for somethign like "setClassLoader" and found it for
some servlet containers, but it doesn't seem to be standard and
supported by Tomcat.

Thanks for your input!

Mit freundlichen Grüßen

Thorsten Schöning


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to