aspose file tools*
The moose likes Websphere and the fly likes Failed to load servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Failed to load servlet" Watch "Failed to load servlet" New topic
Author

Failed to load servlet

Karthik Prabu
Ranch Hand

Joined: Dec 27, 2002
Posts: 48
Hi,
I am getting the following error while try to deploy a simplr Application in WebSphere AE 4.0.1. I used Aplication Assembly tool to create my EAR file. please help me
[4/23/03 14:59:53:631 IST] 2dda5383 WebGroup X Servlet Error-[myservlet]: Failed to load servlet: java.lang.NoClassDefFoundError: myservlet/MyServlet (wrong name: myServlet/MyServlet)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:703)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:133)
at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:432)
at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:392)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:255)
at java.lang.ClassLoader.loadClass(ClassLoader.java:448)
at com.ibm.ws.classloader.ReloadableClassLoader.loadClass(ReloadableClassLoader.java:79)
at java.beans.Beans.instantiate(Beans.java:216)
at java.beans.Beans.instantiate(Beans.java:77)
at com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:141)
at com.ibm.servlet.engine.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:325)
at com.ibm.servlet.engine.webapp.WebApp.loadServletManager(WebApp.java:1217)
at com.ibm.servlet.engine.webapp.WebApp.init(WebApp.java:145)
at com.ibm.servlet.engine.srt.WebGroup.loadWebApp(WebGroup.java:259)
at com.ibm.servlet.engine.srt.WebGroup.init(WebGroup.java:168)
at com.ibm.servlet.engine.ServletEngine.addWebApplication(ServletEngine.java:856)
at com.ibm.ws.runtime.WebContainer.install(WebContainer.java:36)
at com.ibm.ws.runtime.Server.startModule(Server.java:617)
at com.ibm.ejs.sm.active.ActiveModule.startModule(ActiveModule.java:511)
at com.ibm.ejs.sm.active.ActiveModule.startAction(ActiveModule.java:355)
at com.ibm.ejs.sm.active.ActiveObject.startObject(ActiveObject.java:722)
at com.ibm.ejs.sm.active.ActiveObject.start(ActiveObject.java:131)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ejs.sm.agent.AdminAgentImpl.activeObjectInvocation(AdminAgentImpl.java:93)
at com.ibm.ejs.sm.active.ActiveObject.invokeContainedObject(ActiveObject.java:525)
at com.ibm.ejs.sm.agent.AdminAgentImpl.activeObjectInvocation(AdminAgentImpl.java:110)
at com.ibm.ejs.sm.agent.AdminAgentImpl.invokeActiveObject(AdminAgentImpl.java:62)
at com.ibm.ejs.sm.agent._AdminAgentImpl_Tie._invoke(_AdminAgentImpl_Tie.java:73)
at com.ibm.CORBA.iiop.ExtendedServerDelegate.dispatch(ExtendedServerDelegate.java:532)
at com.ibm.CORBA.iiop.ORB.process(ORB.java:2395)
at com.ibm.CORBA.iiop.OrbWorker.run(OrbWorker.java:186)
at com.ibm.ejs.oa.pool.ThreadPool$PooledWorker.run(ThreadPool.java:104)
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:138)
Thanks
Karthik
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
java.lang.NoClassDefFoundError: myservlet/MyServlet (wrong name: myServlet/MyServlet)

1) Does the generated .ear/.war file contain your MyServlet.class file?
2) Is your package "myservlet" or "myServlet"? I believe this should be the same in all places...
3) Have you used "myservlet/MyServlet" where you should've used "myservlet.MyServlet"?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Karthik Prabu
Ranch Hand

Joined: Dec 27, 2002
Posts: 48
hi
I missed the second point you mentioned. thanks for ur reply now its working fine
Karthik
Karthik Prabu
Ranch Hand

Joined: Dec 27, 2002
Posts: 48
Hi Lasse Koskela,
I created a new Context path as /saran but when i try to access it, WebSphere is not throwing any exception and also it is not showing the files there. 404 exception is thorwn in the browser. Please tell me what would be the problem. If u want i can send u the ear file i deployed.
thanks
Karthik
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Is the 404 page saying something about "directory listing disabled"? If it is, you might have forgotten to define the welcome files in web.xml.
Another thing to consider is that the URL for a web application is of the form
<server>:<port>/<appname>/<webappname>
If you have deployed a single .war file with the admin console, WebSphere has created an application based on the .war file's name. For example, deploying a webapp "myweb.war" would be accessible at <server>:<port>/myweb/myweb.
[ April 23, 2003: Message edited by: Lasse Koskela ]
Karthik Prabu
Ranch Hand

Joined: Dec 27, 2002
Posts: 48
Hi Lasse Koskela
Thanks for ur reply. The problem is I'm using IMM Http Server with Websphere. But forgot to regenrate the plungin-cfg.xml file. That is why when i access thru Http Server it shows an exception. Now i generated it and it is working fine. Thank you very much for your reply.
Thanks
Kathik
 
 
subject: Failed to load servlet