File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error 500 when compiling servlet

 
Martin Dinstuhl
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like it might be a classpath issue. How are you compiling - are you using an ant script or are you just calling javac from the shell?

If you are using a command-line call to javac be sure to include the full path to the .jar file (/com/blah/something/MyJar.jar).
 
Linda Pan
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using javac on the command line. I actually have compiled fine but when executing http://localhost/servlet/FAQBot, then I get the above mentioned error. I will try to figure out the classpath error issue. Yes, I do think there is something I'm missing.
 
Prathiba Kalirengan
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check out whether the classes are present in the correct package structure inside the jar..and give the correct path with package information in the descriptors
 
Ramaswamy Srinivasan
Ranch Hand
Posts: 295
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Linda,

Well...There are lot amny reasons for this error.

Try the following....

1. Package any classes that need to be.
2. Try packaging ur servlet.
3. The last would be to copy the servlet.jar and other jar if any files to ur Web-Inf\classes and try.

Get back to me after trying this.

Cheers,
Swamy
 
Richard Bradford
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Copy the jar that contains the "com/lotus/sametime/community/LoginListener"
class to the WEB-INF/lib folder.
 
Linda Pan
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What resolved that error was to copy all the JAR files that were referenced in the code to the "WEB-INF\lib" directory on Tomcat. I now have a different error:

message - HTTP method GET is not supported by this URL

description - The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL).

I am trying to run a servlet that is found in an IBM book but was having problems getting it to run on Tomcat. Thank you all for replying!

I guess in addition to setting the classpath for in order to compile the servlet code, you also must include these in the Tomcat library (WEB-INF\lib directory) in order to run the servlet.
[ September 28, 2004: Message edited by: Linda Pan ]
 
Richard Bradford
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the servlet support get requests?
ie. does it have a doGet(.., ..) method?
 
Linda Pan
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually it should be fine that it doesn't have that method because the servlet should just log into a Lotus Sametime server as a bot (a user) for Instant Messaging. All the interaction is not in a web page but inside a chat window. Now ... if I could get the chat to work since the bot logs in fine.

The bot basically searches a Lotus Notes database for an answer to my question. I type in "what is your name?" and it should enter a predefined answer - "I am a FAQBot".
 
Linda Pan
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting an error when tryint to compile a servlet. I think it can't find the .JAR file that contains the classes for "com/lotus/sametime/community/LoginListener", but it is listed in my classpath. I am compiling with Tomcat5 and jdk1.3.1_12.

Can anyone help?

Error is listed below:

exception

javax.servlet.ServletException: Cannot allocate servlet instance for path /servlet/FAQBot
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:388)
at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.lang.NoClassDefFoundError: com/lotus/sametime/community/LoginListener
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1634)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1634)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:964)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:687)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:369)
at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


[ September 28, 2004: Message edited by: Linda Pan ]
 
Scott Dunbar
Ranch Hand
Posts: 245
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Linda, does the error message really say "com/lotus/sametime/community/LoginListener" or does it say "com.lotus.sametime.community.LoginListener"? Perhaps you are doing a Class.forName() and this is a cut and paste error?
 
Linda Pan
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes th error includes the slashes:
java.lang.NoClassDefFoundError: com/lotus/sametime/community/LoginListener

[ September 28, 2004: Message edited by: Linda Pan ]
 
Scott Dunbar
Ranch Hand
Posts: 245
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I was in space for a minute - NoClassDefFoundError does print slashes, and not dots.

As far as the rest, it appears that it only supports POST and so you can't hit it with a browser by default. If you have access, wget allows you to post data too. Do something like "wget --post-data 'user=foo&password=bar' http://your.server.name/yourServlet"
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic