Intellij Idea Error Java.lang.NoClassDefFoundError

Source: Internet
Author: User

Intellij Idea Error Java.lang.NoClassDefFoundError

11-aug-2018 23:48:24.686 Serious [http-nio-8080-exec-5] Org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service () for Servlets [Com.wbg.testservlet] in context with path [] threw exception [Servlets execution threw an ex Ception] with root cause

Java.lang.ClassNotFoundException:com.wbg.testDao

At Org.apache.catalina.loader.WebappClassLoaderBase.loadClass (webappclassloaderbase.java:1291)

At Org.apache.catalina.loader.WebappClassLoaderBase.loadClass (webappclassloaderbase.java:1119)

At Com.wbg.testService.select (testservice.java:9)

At Com.wbg.testservlet.doGet (testservlet.java:19)

At Javax.servlet.http.HttpServlet.service (httpservlet.java:635)

At Javax.servlet.http.HttpServlet.service (httpservlet.java:742)

At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:231)

At Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:166)

At Org.apache.tomcat.websocket.server.WsFilter.doFilter (wsfilter.java:52)

At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:193)

At Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:166)

At Org.apache.catalina.core.StandardWrapperValve.invoke (standardwrappervalve.java:198)

At Org.apache.catalina.core.StandardContextValve.invoke (standardcontextvalve.java:96)

At Org.apache.catalina.authenticator.AuthenticatorBase.invoke (authenticatorbase.java:496)

At Org.apache.catalina.core.StandardHostValve.invoke (standardhostvalve.java:140)

At Org.apache.catalina.valves.ErrorReportValve.invoke (errorreportvalve.java:81)

At Org.apache.catalina.valves.AbstractAccessLogValve.invoke (abstractaccesslogvalve.java:650)

At Org.apache.catalina.core.StandardEngineValve.invoke (standardenginevalve.java:87)

At Org.apache.catalina.connector.CoyoteAdapter.service (coyoteadapter.java:342)

At Org.apache.coyote.http11.Http11Processor.service (http11processor.java:803)

At Org.apache.coyote.AbstractProcessorLight.process (abstractprocessorlight.java:66)

At Org.apache.coyote.abstractprotocol$connectionhandler.process (abstractprotocol.java:790)

At Org.apache.tomcat.util.net.nioendpoint$socketprocessor.dorun (nioendpoint.java:1459)

At Org.apache.tomcat.util.net.SocketProcessorBase.run (socketprocessorbase.java:49)

At Java.util.concurrent.ThreadPoolExecutor.runWorker (threadpoolexecutor.java:1142)

At Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:617)

At Org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run (taskthread.java:61)

At Java.lang.Thread.run (thread.java:745)

Cause the full jar package is not imported

Solution: Scenario One:

In fact, because the jar package is not deployed, then when the page request, you will not find the jar package, then the error will be ....
The solution is as follows:
Projecture->artifacts–> Select Package Deployment Project-->output layout–>web-inf--> See if there is a Lib directory (if you do not have a Lib directory, you can create it yourself) The right-hand jar package is added to the Lib directory
Above, can solve the classnotfound exception

Scenario Two: Right-click->f4 Enter, see there is an error, and then always add to no can, look at the picture

Successfully resolved

Intellij Idea Error Java.lang.NoClassDefFoundError

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.