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
-> JMSQueue.jsp
D:\Apps\tomcat\webapps\JMSadmin\WEB-INF
-> classes\
-> lib\
-> lib\
D:\Apps\tomcat\webapps\JMSadmin\WEB-INF\classes
->
NumMessagesBean.class
-> QueueBean.class
-> queueList.properties
-> QueueListBean.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 - 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\JMSadmin\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
[EMAIL PROTECTED]
414 Olive
Way, Suite 300
Seattle, WA 98101
206-832-4500
phone
206-832-4475 fax