java.lang.ClassNotFoundException: javax.jms.JMSContext on tomcat 7

Viewed 28335

I have a spring web application which I am trying to deploy on tomcat 7. I got following error on tomcat 7 start-up:

Caused by:

java.lang.ClassNotFoundException: javax.jms.JMSContext

This is because tomcat could not find javaee-api-7.0.jar which is present in my application's WEB-INF/lib folder. However, if I copy this to tomcat/lib, error is fixed and tomcat can load the class.

But I don't want to copy any additional jars to tomcat/lib. Can someone help here so that tomcat can find above jar in application's lib. Am I missing any classpath handler entries? I have not added any explicitly.

2 Answers

I had the same problem in an Apache karaf 4.2.7 environment over JDK 11.0.2, in my case the exception prints

Caused by: java.lang.ClassNotFoundException: javax.jms.JMSContext not found by org.apache.geronimo.specs.geronimo-jms_1.1_spec

It works by installing: bundle:install mvn:javax.jms/javax.jms-api/2.0.1

Related