• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Got it mike, now it's working. thanks a lot!
 
Forget Steve. Look at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic