my dog learned polymorphism
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Wrapper cannot find servlet class " Watch "Wrapper cannot find servlet class " New topic

Wrapper cannot find servlet class

H Kisna

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.

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

javax.servlet.ServletException�: Wrapper cannot find servlet class util.t2 or a class it depends on�CustomPrincipalValve.invoke(Cu��SecurityAssociationValve.invok�e(SecurityAssociationValve.jav�a:150)�JaccContextValve.invoke(JaccCo�

root cause

java.lang.ClassNotFoundException util.t2$��.doPrivileged(Native Method)

My WEB.XML file is:
NOTE:,, and have "package util" in their declarations...

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

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.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...

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...


David O'Meara

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)

I agree. Here's the link:
subject: Wrapper cannot find servlet class
It's not a secret anymore!