Question

I've been searching high and low for a potential solution to this problem. I am aware that there are a few questions and answers that deal with this exception when starting Tomcat, but all are based on the presumption that Eclipse is being used.

I have built and installed my project via Cygwin CLI, and start my server from there as well, and do not have any involvement with any IDE - therefore, many of the processes and methods for fixing the problem that involve Eclipse are not clear to me. Here is the stack trace of my error, found in my tomcat/logs/localhost.log:

SEVERE: Error loading WebappClassLoader
context: /ole
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@1ac631b
org.apache.axis2.transport.http.AxisAdminServlet
java.lang.ClassNotFoundException: org.apache.axis2.transport.http.AxisAdminServlet
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1128)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
    at org.apache.catalina.core.StandardService.start(StandardService.java:525)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Était-ce utile?

La solution

I don't think I'll be able to give a concrete resolution to your problem, as I'd need a lot more detail about you application (what classes it implements etc.), however I can provide some hints that might help you investigate yourself.

First it is important to understand the standard Java class loading process:

enter image description here

Tomcat extends this model and by default have the class loader to look inside the web application first, before asking the parent class loader to look for requested classes (delegate: false). This is for added security and flexibility to class loading, such as

  • caching classes
  • restrict code to be loaded from within WEB-INF/lib and WEB-INF/classes only
  • dynamic loading of classes (at runtime etc)

So if in any way you're tampering with this process/security restrictions or implement java.class.ClassLoader that's a great place to start your investigation.

Although I suggest that you simply start with a standalone clean tomcat install, check that it works, then deploy your app again, and if it consistently breaks then you know that it's indeed your app breaking it.

Then the fun investigation can begin based on the aforementioned principles.

Further reading

Hope this helps.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top