Hi,

i am using an embedded tomcat to e.g. start my wicket application in my
IDE.
This works fine so far - the whole classpath used and provided by
IntelliJ is used.

But adding e.g. a war file via setWebapp to start some additional
webapps i am running into some issues with that war files.

The intellij classpath does provide e.g. hibernate and this is going to
resolve classes when loading entities via associations.

Hibernate was loaded using classloader A (bootstrap one) and it does
even resolve that association class with A where it should have used the
ParallelWebappClassloader from my war file first when getting a request
for that war file.

So this is going havoc because bootstrap classloader is asked first here
where it does find that class (embedded tomcat - no extra classloader
stuff done).

https://tomcat.apache.org/tomcat-8.5-doc/class-loader-howto.html

So how is this supposed to work in case i want to load additional war
files in an embedded tomcat - any best practices, docs known how to
"reproduce" such an isolated environment for an embedded tomcat?

So minimal example would be:

1. The bootstrap class with "new Tomcat()" is in my test classpath of my
webapp in the IDE and can run the webapp from "src/main/webapp" as usual
- which works so far (one big fat classpath ...).

2. I want to add a webapp from a war file in the same Tomcat() instance
- but here it gets messy with the classes.

Suggestions welcome :)

kind regards

Torsten

PS: In the "real" tomcat this is going to work because the bootstrap
classloader does not know that class at all there - where in the webapp
one this is "mixed".

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to