aspose file tools*
The moose likes Servlets and the fly likes Wrapper cannot find servlet class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Wrapper cannot find servlet class " Watch "Wrapper cannot find servlet class " New topic
Author

Wrapper cannot find servlet class

H Kisna
Greenhorn

Joined: May 05, 2005
Posts: 5
I am using JBoss 4.0.1sp1 on SuSE Linux 9.0 System.

I have a simplest WEB APPLICATION and access it using http://localhost:8080/mhin/adm�in.html and here is my Directory structure...


/jboss/server/default/deploy/m�hin.war --> this is a directory.
/jboss/server/default/deploy/m�hin.war/admin.html
/jboss/server/default/deploy/m�hin.war/WEB-INF/web.xml
/jboss/server/default/deploy/m�hin.war/WEB-INF/classes/util/t1.cla�ss
/jboss/server/default/deploy/m�hin.war/WEB-INF/classes/util/t2.cla�ss
/jboss/server/default/deploy/m�hin.war/WEB-INF/classes/util/p�6.class
/jboss/server/default/deploy/m�hin.war/WEB-INF/classes/util/p�9.class


When I click on http://localhost:8080/mhin/adm�in.html I get following
ERROR wonder why... (this HTML calls t2.java file)

------------------------------�------------------------------�-------
javax.servlet.ServletException�: Wrapper cannot find servlet class util.t2 or a class it depends on

org.jboss.web.tomcat.security.�CustomPrincipalValve.invoke(Cu�stomPrincipalValve.java:66)
org.jboss.web.tomcat.security.�SecurityAssociationValve.invok�e(SecurityAssociationValve.jav�a:150)
org.jboss.web.tomcat.security.�JaccContextValve.invoke(JaccCo�ntextValve.java:54)
org.apache.catalina.valves.Err�orReportValve.invoke(ErrorRepo�rtValve.java:118)
org.apache.coyote.tomcat5.Coyo�teAdapter.service(CoyoteAdapte�r.java:160)
org.apache.jk.server.JkCoyoteH�andler.invoke(JkCoyoteHandler.�java:300)
org.apache.jk.common.HandlerRe�quest.invoke(HandlerRequest.ja�va:374)
org.apache.jk.common.ChannelSo�cket.invoke(ChannelSocket.java�:743)
org.apache.jk.common.ChannelSo�cket.processConnection(Channel�Socket.java:675)
org.apache.jk.common.SocketCon�nection.runIt(ChannelSocket.ja�va:866)
org.apache.tomcat.util.threads�.ThreadPool$ControlRunnable.ru�n(ThreadPool.java:683)
java.lang.Thread.run(Thread.ja�va:534)

root cause

java.lang.ClassNotFoundException util.t2
java.net.URLClassLoader$1.run(�URLClassLoader.java:199)
java.security.AccessController�.doPrivileged(Native Method)
------------------------------�------------------------------�-------

My WEB.XML file is:
------------------------------�------------------------------�-------
<web-app>
<servlet>
<servlet-name>t1</servlet-name�>
<servlet-class>util.t1</servlet-cla�ss>
</servlet>
<servlet>
<servlet-name>t2</servlet-name�>
<servlet-class>util.t2</servlet-cla�ss>
</servlet>
<servlet>
<servlet-name>p6</servlet-name�>
<servlet-class>util.p6</servlet-cla�ss>
</servlet>
<servlet>
<servlet-name>p9</servlet-name�>
<servlet-class>util.p9</servlet-cla�ss>
</servlet>
<servlet-mapping>
<servlet-name>t1</servlet-name�>
<url-pattern>/t1/*</url-patter�n>
</servlet-mapping>
<servlet-mapping>
<servlet-name>t2</servlet-name�>
<url-pattern>/t2/*</url-patter�n>
</servlet-mapping>
<servlet-mapping>
<servlet-name>p6</servlet-name�>
<url-pattern>/p6/*</url-patter�n>
</servlet-mapping>
<servlet-mapping>
<servlet-name>p9</servlet-name�>
<url-pattern>/p9/*</url-patter�n>
</servlet-mapping>
------------------------------�------------------------------�-------
NOTE: t1.java, t2.java, p6.java and p9.java have "package util" in their declarations...

FACTS: My CLASSPATH contains SERVLET.JAR, TOOLS.JAR and WEB-INF/classes etc...

Also:
I have RECOMPILED all the CLASS files and have it under
.. /deploy/mhin.war/WEB-INF/classes/util/*.class

These are my imports in ALL my JAVA FILES...
---------------------------------------------------------------
package util;
import java.io.*;
import java.util.*;
import java.lang.Runtime;
import java.lang.String;
import javax.servlet.*;
import javax.servlet.http.*;
import com.oreilly.servlet.MultipartRequest;
---------------------------------------------------------------

I have put the JAR of Oreiley Packae under WEB-INF/lib/cos.jar

Any related information on this owuld be appreciated...


Questions:
Are all the classes in the right directory?
Am I using the right FQDN? Fully Qualified Domain Name? in my WEB.XML?
Any other hints/ relevant informaiton would be appreciated...


Sincerely,


HARI
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

It looks like the class fails to load (causing the 'not found') due to your security settings. I'm not aware of the JBoss specifics, but it looks like it is starting with a security manager and this security manager doesn't allow the codebase in you app to access the filesystem, which is required by the Oreilly cos stuff.

2 options:
1) find out how to disable the security manager when starting JBoss (not recommended but much easier)
2) find out how to allow file access rights to your web app. (harder but safer)

Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Wrapper cannot find servlet class