Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Failed to load servlet. Easy for you! Help me please!

 
Cynthia Tovar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 4 projects: ServerProject, EARProject, EJBProject y ApplicationClientProject.

I have this error:
SRVE0020E: [Servlet Error]-[helloWorld.servlet.HelloWorldServlet]: Failed to load servlet: java.lang.NoClassDefFoundError: Error while defining class: helloWorld.servlet.HelloWorldServlet
This error indicates that the class: <unknown>
could not be located while defining the class: helloWorld.servlet.HelloWorldServlet
This is often caused by having the class at a higher point in the classloader hierarchy
Dumping the current context classloader hierarchy:
==> indicates defining classloader
*** indicates classloader where the missing class could have been found


In the application.xml are the Module and the ProjectUtility JARs sections; in the first is the ApplicationClient.jar, WebProject.war and EJBProject.jar; and in the second, there's nothing.

What am I doing wrong?

Please help me!!! Please

Thank you very, very, much
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34396
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cynthia,
Welcome to JavaRanch!

If you go into the server perspective and open the server, you can see the classloader policy. Drill down under your ear to the web application and change the default classloader policy.
 
Cynthia Tovar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your replay Jeanne Boyarsky!!!

I've done what you said and the problem is still there. Do you need more information about my problem?

Thank you very much.
 
Shyam kumar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne,
I'm facing the same problem while launching the server, can you please send some information about it?

Thanks,
Naveen
 
William Janssen
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since it is a java.lang.NoClassDefFoundError, can you confirm that the class is located inside the WebProject.war file in the /WEB-INF/classes/helloWorld/servlet/ directory?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic