tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From graghupa...@aegonuk.co.uk
Subject RE: javax.servlet.ServletException: Cannot allocate servlet insta nce
Date Mon, 07 Apr 2003 14:34:51 GMT
your servlet aliasing should be like 

<servlet-name>login</servlet-name>
<servlet-class>shiva.login</servlet-class>


your mapping is fine 

Regards
Guru

-----Original Message-----
From: Hari Om [mailto:hari_om@hotmail.com]
Sent: 07 April 2003 15:29
To: tomcat-user@jakarta.apache.org
Subject: javax.servlet.ServletException: Cannot allocate servlet
instance


Hello:

I am using JBoss + Tomcat + Apache on UNIX.

My Web App name is "HARI" which has following structure:

This is a very basic WEB APP which checks for USerName/Password.

I run my app as http://hariom.com/hari/servlet/login


I have following directory and organized the servlets as:

/hari/index.jsp
/hari/hari.war
/hari/WEB-INF/web.xml
/hari/WEB-INF/classes/shiva/login.class
/hari/WEB-INF/classes/shiva/process.class
/hari/WEB-INF/classes/shiva/main.class
/hari/WEB-INF/classes/shiva/list.class
/hari/META-INF/application.xml

In every Servlet I have added "package shiva;"

My "main.class" has a Form which calls "list.class" but when I click the 
Form Submit button I get following error wonder why?

----------------------------------------------------------------------------
-
Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error
The server encountered an internal error (Internal Server Error) that 
prevented it from fulfilling this request.

javax.servlet.ServletException: Cannot allocate servlet instance for path 
/hari/servlet/list

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: shiva/list (wrong name: list)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java(Compiled Code))
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java(Compiled 
Code))
----------------------------------------------------------------------------
-

My classpath is set as "/hari/WEB-INF/classes"


My WEB.XML file is:
----------------------------------------------------------------------------
-
<web-app>
<servlet>
<servlet-name>login</servlet-name>
<servlet-class>/login/*</servlet-class>
</servlet>
<servlet>
<servlet-name>process</servlet-name>
<servlet-class>/process/*</servlet-class>
</servlet>
<servlet>
<servlet-name>main</servlet-name>
<servlet-class>/main/*</servlet-class>
</servlet>
<servlet>
<servlet-name>list</servlet-name>
<servlet-class>/list/*</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>process</servlet-name>
<url-pattern>/process/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>login</servlet-name>
<url-pattern>/login/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>main</servlet-name>
<url-pattern>/main/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>list</servlet-name>
<url-pattern>/list/*</url-pattern>
</servlet-mapping>
----------------------------------------------------------------------------
-

Can anyone point out what is wrong?

what other changes do I have to make to make it work?

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message