Forums Register Login

http error 500 ServletException: Cannot allocate servlet instance...

+Pie Number of slices to send: Send
Hi, I'm getting an HTTP Status 500 - Internal server error when running a servlet called ServletSimplePublisher
I'm using tomcat 4.0.1. The error is somethin' like this:
exception
javax.servlet.ServletException: Cannot allocate servlet instance for path /openjms/servlet/ServletSimplePublisher
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:415)
at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
.
.
.
root cause
java.lang.NoClassDefFoundError: ServletSimplePublisher (wrong name: openjms/examples/client/console/ServletSimplePublisher)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:493)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
.
.
.
any ideas
+Pie Number of slices to send: Send
You need the following file in the place indicated:
WEB-INF/classes/openjms/examples/client/console/ServletSimplePublisher.class
or for Windows, its backslashed equivalent.
And the name of the class file and all its parent directories up to and including "WEB-INF" MUST be capitalized exactly as shown. Even though the Windows filesystem is case-independent, Java has other ideas.
The JAR equivalent would be:
openjms/examples/client/console/ServletSimplePublisher.class
Within a jar in WEB-INF/lib
Also properly capitalized.
+Pie Number of slices to send: Send
Thx Tim.
I've put the file where you said, so it looks something like this:
tomcat/webapps/openjms
tomcat/webapps/openjms/build
tomcat/webapps/openjms/dist
tomcat/webapps/openjms/META-INF
tomcat/webapps/openjms/META-INF/MANIFEST.FM
tomcat/webapps/openjms/servlets
tomcat/webapps/openjms/servlets/ServletSimplePublisher.class
tomcat/webapps/openjms/servlets/SimplePublisher.html
tomcat/webapps/openjms/WEB-INF/classes/openjms/examples/client/console
/ServletSimplePublisher.class
tomcat/webapps/openjms/WEB-INF/lib
tomcat/webapps/openjms/WEB-INF/src
am I still missing something?
thanks in advance.
+Pie Number of slices to send: Send
remove the class file from the /servlets directory. It might be finding that one first, and using it (which would be wrong).. and what is your /servlets directory for anyways?

HTML should be served out of your openjms directory
+Pie Number of slices to send: Send
Got it mike, now it's working. thanks a lot!
Don't touch me. And dont' touch this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 6626 times.
Similar Threads
I'm not sure the problem is the servlet
Tomcat error
placing and configuring web.xml, servlets not available
error 500
Servlet can't find other servlet
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 22:53:46.