wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Unable to resolve InvocationTargetException while starting tomcat with my web application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Unable to resolve InvocationTargetException while starting tomcat with my web application" Watch "Unable to resolve InvocationTargetException while starting tomcat with my web application" New topic
Author

Unable to resolve InvocationTargetException while starting tomcat with my web application

Vinoth Maharaj
Greenhorn

Joined: Oct 19, 2011
Posts: 3

Please find below the stack trace,

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.NoClassDefFoundError: RemoteService
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1850)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:890)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1354)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1850)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:890)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1354)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1095)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
... 6 more
Caused by: java.lang.ClassNotFoundException: RemoteService
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 32 more


I am able to start the tomcat without the above bug after performing the following actions randomly, but i couldn't find the exact solution for this problem
1. Clean the tomcat or
2. Replace the existing tomcat configuration in eclipse with new one or
3. Switching over to another workspace or
4. Restarting the eclipse or the system.

It would be helpful for me if someone tells the exact problem and its solution since i get this bug frequently (2 to 3 days once).


Never try to win others, win yourself.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
Caused by: java.lang.NoClassDefFoundError: RemoteService


Apparently your RemoteService class is not in a package - ALL classes used in servlets should be in a package, the reason being that without a package, the JVM attempts to load the class from the "current" directory - something you have no control over in the servlet environment.

Bill

Java Resources at www.wbrogden.com
Vinoth Maharaj
Greenhorn

Joined: Oct 19, 2011
Posts: 3

Thank you william for your suggestion. I was able to solve the bug temporarily by commenting the servlet mapping of the remote service class (which is a GWT module) in web.xml.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to resolve InvocationTargetException while starting tomcat with my web application
 
Similar Threads
web.xml and Struts 2
Error filterStart ... Struts2
web service call from servlet :getting following error
problem while integrating spring with hibernate in webapplicatin development
Spring Webservices: FrameworkServlet exception