Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Running a simple servlet in Weblogic6.1

 
Vinod Venugopal
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
As per the bea\wlserver6.1\QUICK_START.HTML guide,
I have copied HelloWorldServlet.class from
"config/examples/applications/
examplesWebApp/WEB-INF/classes/
examples/servlets/
HelloWorldServlet.class" to " config/mydomain/applications/
DefaultWebApp/
WEB-INF/classes".
After that I made changes in the web.xml :
<servlet>
<servlet-name>
HelloWorldServlet
</servlet-name>
<servlet-class>
HelloWorldServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>
HelloWorldServlet
</servlet-name>
<url-pattern>
HelloWorld
</url-pattern>
</servlet-mapping>

and then I saved the web.xml. I then started the default server, then I access it thru the browser
http://localhost:7001/HelloWorld
I am getting the following error message in the browser:
"Error 500--Internal Server Error
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.5.1 500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request."

Also in the log file it shows the following error:
"java.lang.NoClassDefFoundError: HelloWorldServlet (wrong name: examples/servlets/HelloWorldServlet)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:338)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:155)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:45)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:581)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:366)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:240)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:12."
Can anyone pls help me to solve this problem?
Vinod
 
Ghulam Rashid
Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vinod,
Try to give complete path of the servlet in the web.xml file(e.g. examples.servlets.HelloWorld.....) and let me know.
I hope this will help you to run the servlet.
Good Luck
Rashid
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vinod Venugopal:

As per the bea\wlserver6.1\QUICK_START.HTML guide,
I have copied HelloWorldServlet.class from
"config/examples/applications/
examplesWebApp/WEB-INF/classes/
examples/servlets/
HelloWorldServlet.class" to " config/mydomain/applications/
DefaultWebApp/
WEB-INF/classes".

Make sure you copy the entire classes directory. Directory structure matters for packages in Java.
Also, like Rashid said, you need to fully qualify the class name in your web.xml.
 
faiza athar
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chris,
I dont understand the need to copy the whole classes directory?
Isnt just the helloworldservlet.class enough?
faiza
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure but it needs to be in the correct directory structure and if it uses any helper classes than those need to be present as well.
Since I didn't want to go into that I just recommended copying everything. It is called laziness .
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kothandaraman sikamani:
Can anyone tell me where do i get very simple UML Diagrams with examples..with like very simple use cases, class diagrams,Sequence digrams open
thanks

For what purpose? To learn UML? If you are interested in learning UML then I suggest picking up a copy of Martin Fowler's UML Distilled.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic