wood burning stoves*
The moose likes BEA/Weblogic and the fly likes Running a simple servlet in Weblogic6.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Running a simple servlet in Weblogic6.1" Watch "Running a simple servlet in Weblogic6.1" New topic
Author

Running a simple servlet in Weblogic6.1

Vinod Venugopal
Ranch Hand

Joined: Dec 06, 2000
Posts: 148
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


- Vinod<br />-------<br />SCJP2
Ghulam Rashid
Ranch Hand

Joined: Jan 14, 2002
Posts: 278
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

Joined: Jul 18, 2001
Posts: 2712
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

Joined: Oct 30, 2001
Posts: 136
Hi Chris,
I dont understand the need to copy the whole classes directory?
Isnt just the helloworldservlet.class enough?
faiza
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
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

Joined: Jul 18, 2001
Posts: 2712
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Running a simple servlet in Weblogic6.1