Error Scenario:
Ecplise (oxygen) uses jetty to start Manven multi-module project, project compiles through, install is normal but at startup Java.lang.ClassNotFoundException, cannot find dependent child module project, for example
Project (MAVEN project)
-modulea (JAR)
-model
-dao
-moduleb (JAR)
.....
-modulec (web)
In a, B project modules are Colse, Modulec can be started by jetty Normal, when a, B project in the open condition, start C will appear the following exception
Java.lang.classnotfoundexception:com.*********.support.security.interceptor.addresponseinterceptor at
Java.net.URLClassLoader.findClass (urlclassloader.java:381) at
Java.lang.ClassLoader.loadClass ( classloader.java:424) at
sun.misc.launcher$appclassloader.loadclass (launcher.java:331)
at Java.lang.ClassLoader.loadClass (classloader.java:357) at
Org.eclipse.jetty.webapp.WebAppClassLoader.loadClass (webappclassloader.java:487) at
Org.eclipse.jetty.webapp.WebAppClassLoader.loadClass (webappclassloader.java:428) at
Org.springframework.util.ClassUtils.forName (classutils.java:250)
No matter repackaging or clean, install or MAVEN update, there is no solution.
Solution:
Right-click items in case of an exception debug as-> Debug configurations opened and found
At this point you will find that the introduction of the module of all the Classes folder is gray, at this time the exception is clear, the description of the class file at the start of the jetty did not find. The reason has been found, the solution is simple, choose the first classes let it become the following style, found that all classes files are shown as Black
Start jetty again. Ok
Done.