You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Renee Petris <Re...@loudeye.com> on 2001/04/10 18:52:02 UTC

Classpath problems with tomcat 3.2.1 standalone.

I've at my wits end trying to resolve ClassNotFoundExceptions using tomcat
3.2.1 and jdk 1.2.2.
 
I'm using JMS and JNDI that relies on a jar file and a zip file, fmprtl.zip
and j2ee.jar. I need j2ee.jar for the javax.naming classes which aren't
included in jdk1.2.2. I explicitly added the .zip file to my Tomcat
classpath. My webapps directory structure looks like:
 
D:\Apps\tomcat\webapps\JMSadmin
                                -> error.jsp
                                ->  JMSQueue.jsp

D:\Apps\tomcat\webapps\JMSadmin\WEB-INF
                                ->  classes\
                                ->   lib\

D:\Apps\tomcat\webapps\JMSadmin\WEB-INF\classes
                                ->  NumMessagesBean.class
                                ->  QueueBean.class
                                ->  queueList.properties
                                -> QueueListBean.class
 
D:\Apps\tomcat\webapps\JMSadmin\WEB-INF\lib
                                ->  j2ee.jar
 
When I try to access my JMSQueue.jsp page which uses the beans in the
WEB-INF\classes directory, my jasper log shows 
 
2001-04-10 09:34:22 -        ServletPath: /JMSQueue.jsp
2001-04-10 09:34:22 -           PathInfo: null
2001-04-10 09:34:22 -           RealPath:
D:\Apps\tomcat\webapps\JMSadmin\JMSQueue.jsp
2001-04-10 09:34:22 -         RequestURI: /JMSadmin/JMSQueue.jsp
2001-04-10 09:34:22 -        QueryString: server=devmosjms1&port=2001
2001-04-10 09:34:22 -     Request Params:
2001-04-10 09:34:22 -            port = 2001
2001-04-10 09:34:22 -            server = devmosjms1
2001-04-10 09:34:22 - Classpath according to the Servlet Engine is:
D:\Apps\tomcat\webapps\JMSadmin\WEB-INF\classes;D:\Apps\tomcat\webapps\JMSad
min\WEB-INF\lib\j2ee.jar
 
This makes it look like j2ee.jar is on my classpath, but the jsp throws an
exception: java.lang.NoClassDefFoundError:
javax/naming/spi/InitialContextFactory, and this class is in j2ee.jar. If I
put j2ee.jar explicitly on my Tomcat classpath (making sure its after
servlet.jar, which it conflicts with), the code works. 
 
I've added a Context to my servlet.xml file:
<Context path="/JMSadmin" docBase="webapps/JMSadmin" debug="0"
crossContext="false" reloadable="false"> </Context>
Any ideas why j2ee.jar isn't found by the .jsp page?

Renée Petris
Overseer of the Execution
Loudeye Technologies
renee.petris@loudeye.com <ma...@loudeye.com> 
414 Olive Way, Suite 300
Seattle, WA 98101
206-832-4500 phone
206-832-4475 fax