Ecplise use jetty to start the MAVEN project Java.lang.ClassNotFoundException__jetty

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.