0

I have multi module web application:

Parent
|_common
|_dao
|_service
|_web (war)

And i want to create a new project that contains only scheduled tasks, but it depends on the modules above (except the web module).

I have create a new web module in the same parent project, the compilation maven is fine and it generate two war files after build success ... Also everything is fine in eclipse and i can see all my dependencies. But when i deploy the war on tomcat i get ClassNotFoundException from "common module" in both war modules and also on eclipse i had the same exception.

I hope you understand what i want to do

Sidaoui Majdi
  • 399
  • 7
  • 26
  • Typically, two web applications (wars) deployed to the same container cannot see each other unless you have specifically configured the container to do so. Alternatively, you can package them into a single EAR, in which case they should share the same root classloader. Check the classloader docs for apache tomcat: https://tomcat.apache.org/tomcat-8.0-doc/class-loader-howto.html – jgitter May 02 '18 at 17:55
  • Nothing prevents you from making the second `war` another module of the same `Parent` project. As long as it doesn't depend on what it doesn't need... – ernest_k May 02 '18 at 17:56
  • (1) Did you declare the dependency of the `web` modules on the `common` module in their respective POM? (2) Is the JAR built from the `common` module present in the WAR's `WEB-INF/lib`? – crizzis May 02 '18 at 17:58

0 Answers0