WSO2 java.lang.ClassNotFoundException:javax.jms.JMSContext
WSO2 java.lang.ClassNotFoundException: javax.jms.JMSContext
我们公司使用WSO2 EI V6.4。
我使用此 guide 将配置连接到 azure 服务总线,一切正常
现在我们必须使用EI 6.4的最后一个补丁版本,当我进行相同的配置时,我得到这个错误
java.lang.NoClassDefFoundError: javax/jms/JMSContext
at org.apache.qpid.jms.jndi.JmsInitialContextFactory.getConnectionFactoryDefaults(JmsInitialContextFactory.java:202)
at org.apache.qpid.jms.jndi.JmsInitialContextFactory.createConnectionFactories(JmsInitialContextFactory.java:133)
at org.apache.qpid.jms.jndi.JmsInitialContextFactory.getInitialContext(JmsInitialContextFactory.java:103)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
at javax.naming.InitialContext.init(InitialContext.java:244)
at javax.naming.InitialContext.<init>(InitialContext.java:216)
at org.apache.axis2.transport.jms.JMSConnectionFactory.initJMSConnectionFactory(JMSConnectionFactory.java:176)
at org.apache.axis2.transport.jms.JMSConnectionFactory.<init>(JMSConnectionFactory.java:154)
at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.loadConnectionFactoryDefinitions(JMSConnectionFactoryManager.java:89)
at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.<init>(JMSConnectionFactoryManager.java:76)
at org.apache.axis2.transport.jms.JMSListener.doInit(JMSListener.java:70)
at org.apache.axis2.transport.base.AbstractTransportListenerEx.init(AbstractTransportListenerEx.java:62)
at org.apache.axis2.engine.ListenerManager.init(ListenerManager.java:84)
at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:412)
at org.wso2.carbon.core.init.CarbonServerManager.start(CarbonServerManager.java:220)
at org.wso2.carbon.core.internal.CarbonCoreServiceComponent.activate(CarbonCoreServiceComponent.java:105)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343)
at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
at org.eclipse.equinox.http.servlet.internal.Activator.registerHttpService(Activator.java:81)
at org.eclipse.equinox.http.servlet.internal.Activator.addProxyServlet(Activator.java:60)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.init(ProxyServlet.java:40)
at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.init(DelegationServlet.java:38)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1240)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1184)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1078)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5380)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5680)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1689)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1679)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: javax.jms.JMSContext cannot be found by qpid_jms_client_0.32.0_1.0.0
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:455)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 53 more
我尝试调试 osgi 包以了解问题,我看到他尝试使用包 org.eclipse.osgi_3.9.1.v20130814-1242 [ 0] 而不是包 org.apache.geronimo.specs.geronimo-jms_2.0_spec_1.0.0.alpha-2 [139]
osgi> p javax.jms
javax.jms; version="0.0.0"<org.eclipse.osgi_3.9.1.v20130814-1242 [0]>
hapi_2.1.0.wso2v1 [75] imports
openjpa-all_2.2.2.wso2v1 [130] imports
org.eclipse.core.expressions_3.4.500.v20130515-1343 [144] imports
org.eclipse.core.runtime_3.9.0.v20130326-1255 [146] imports
org.wso2.carbon.event.core_4.6.49 [263] imports
org.wso2.carbon.logging_4.4.36 [338] imports
org.wso2.ei.samples_6.4.0 [579] imports
qpid_jms_client_0.32.0_1.0.0 [590] imports
smooks_1.5.1.wso2v4 [604] imports
spring.framework_3.2.9.wso2v1 [608] imports
synapse-core_2.1.7.wso2v80_29 [612] imports
synapse-samples_2.1.7.wso2v80 [616] imports
tomcat_7.0.85.wso2v1 [620] imports
javax.jms; version="0.0.0"<geronimo_jms_1.1_spec_1.1.0.wso2v1_1.0.0 [68]>
javax.jms; version="2.0.0"<org.apache.geronimo.specs.geronimo-jms_2.0_spec_1.0.0.alpha-2 [139]>
axis2-transport-jms_2.0.0.wso2v30_3 [20] imports
osgi> b 590
qpid_jms_client_0.32.0_1.0.0 [590]
Id=590, Status=ACTIVE Data Root=/home/bertrand/DEV/wso2/wso2ei-6.4.0/wso2/components/default/configuration/org.eclipse.osgi/bundles/590/data
"No registered services."
No services in use.
Exported packages
org.apache.qpid.jms; version="0.0.0"[exported]
org.apache.qpid.jms.exceptions; version="0.0.0"[exported]
org.apache.qpid.jms.jndi; version="0.0.0"[exported]
org.apache.qpid.jms.message; version="0.0.0"[exported]
org.apache.qpid.jms.message.facade; version="0.0.0"[exported]
org.apache.qpid.jms.meta; version="0.0.0"[exported]
org.apache.qpid.jms.policy; version="0.0.0"[exported]
org.apache.qpid.jms.provider; version="0.0.0"[exported]
org.apache.qpid.jms.provider.amqp; version="0.0.0"[exported]
org.apache.qpid.jms.provider.amqp.builders; version="0.0.0"[exported]
org.apache.qpid.jms.provider.amqp.filters; version="0.0.0"[exported]
org.apache.qpid.jms.provider.amqp.message; version="0.0.0"[exported]
org.apache.qpid.jms.provider.failover; version="0.0.0"[exported]
org.apache.qpid.jms.sasl; version="0.0.0"[exported]
org.apache.qpid.jms.selector; version="0.0.0"[exported]
org.apache.qpid.jms.selector.filter; version="0.0.0"[exported]
org.apache.qpid.jms.selector.parser; version="0.0.0"[exported]
org.apache.qpid.jms.transports; version="0.0.0"[exported]
org.apache.qpid.jms.transports.netty; version="0.0.0"[exported]
org.apache.qpid.jms.util; version="0.0.0"[exported]
Imported packages
javax.naming.spi; version="0.0.0"<org.eclipse.osgi_3.9.1.v20130814-1242 [0]>
javax.jms; version="0.0.0"<org.eclipse.osgi_3.9.1.v20130814-1242 [0]>
javax.naming; version="0.0.0"<org.eclipse.osgi_3.9.1.v20130814-1242 [0]>
No fragment bundles
Named class space
qpid_jms_client_0.32.0; bundle-version="1.0.0"[provided]
No required bundles
是否可以强制使用 bundle 68?
谢谢
我遇到过类似的问题并使用了适合我的 qpid-jms-client-0.11.1
版本。我从 this Maven repository
得到
借助 WSO2 的支持,我得到了另一个解决方案。
- 使用 qpid 版本
qpid-jms-client-0.32.0.jar
- 从
$WSO2_HOME/lib
中删除库 geronimo-jms_1.1_spec-1.1.0.wso2v1.jar
- 从
$WSO2_HOME/dropins
中删除库 geronimo-jms_1.1_spec-1.1.0.wso2v1.jar
- 确保文件
$WSO2_HOME/conf/etc/launch.ini
中不存在行 javax.jms
我们公司使用WSO2 EI V6.4。 我使用此 guide 将配置连接到 azure 服务总线,一切正常
现在我们必须使用EI 6.4的最后一个补丁版本,当我进行相同的配置时,我得到这个错误
java.lang.NoClassDefFoundError: javax/jms/JMSContext
at org.apache.qpid.jms.jndi.JmsInitialContextFactory.getConnectionFactoryDefaults(JmsInitialContextFactory.java:202)
at org.apache.qpid.jms.jndi.JmsInitialContextFactory.createConnectionFactories(JmsInitialContextFactory.java:133)
at org.apache.qpid.jms.jndi.JmsInitialContextFactory.getInitialContext(JmsInitialContextFactory.java:103)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
at javax.naming.InitialContext.init(InitialContext.java:244)
at javax.naming.InitialContext.<init>(InitialContext.java:216)
at org.apache.axis2.transport.jms.JMSConnectionFactory.initJMSConnectionFactory(JMSConnectionFactory.java:176)
at org.apache.axis2.transport.jms.JMSConnectionFactory.<init>(JMSConnectionFactory.java:154)
at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.loadConnectionFactoryDefinitions(JMSConnectionFactoryManager.java:89)
at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.<init>(JMSConnectionFactoryManager.java:76)
at org.apache.axis2.transport.jms.JMSListener.doInit(JMSListener.java:70)
at org.apache.axis2.transport.base.AbstractTransportListenerEx.init(AbstractTransportListenerEx.java:62)
at org.apache.axis2.engine.ListenerManager.init(ListenerManager.java:84)
at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:412)
at org.wso2.carbon.core.init.CarbonServerManager.start(CarbonServerManager.java:220)
at org.wso2.carbon.core.internal.CarbonCoreServiceComponent.activate(CarbonCoreServiceComponent.java:105)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343)
at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
at org.eclipse.equinox.http.servlet.internal.Activator.registerHttpService(Activator.java:81)
at org.eclipse.equinox.http.servlet.internal.Activator.addProxyServlet(Activator.java:60)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.init(ProxyServlet.java:40)
at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.init(DelegationServlet.java:38)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1240)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1184)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1078)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5380)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5680)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1689)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1679)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: javax.jms.JMSContext cannot be found by qpid_jms_client_0.32.0_1.0.0
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:455)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 53 more
我尝试调试 osgi 包以了解问题,我看到他尝试使用包 org.eclipse.osgi_3.9.1.v20130814-1242 [ 0] 而不是包 org.apache.geronimo.specs.geronimo-jms_2.0_spec_1.0.0.alpha-2 [139]
osgi> p javax.jms
javax.jms; version="0.0.0"<org.eclipse.osgi_3.9.1.v20130814-1242 [0]>
hapi_2.1.0.wso2v1 [75] imports
openjpa-all_2.2.2.wso2v1 [130] imports
org.eclipse.core.expressions_3.4.500.v20130515-1343 [144] imports
org.eclipse.core.runtime_3.9.0.v20130326-1255 [146] imports
org.wso2.carbon.event.core_4.6.49 [263] imports
org.wso2.carbon.logging_4.4.36 [338] imports
org.wso2.ei.samples_6.4.0 [579] imports
qpid_jms_client_0.32.0_1.0.0 [590] imports
smooks_1.5.1.wso2v4 [604] imports
spring.framework_3.2.9.wso2v1 [608] imports
synapse-core_2.1.7.wso2v80_29 [612] imports
synapse-samples_2.1.7.wso2v80 [616] imports
tomcat_7.0.85.wso2v1 [620] imports
javax.jms; version="0.0.0"<geronimo_jms_1.1_spec_1.1.0.wso2v1_1.0.0 [68]>
javax.jms; version="2.0.0"<org.apache.geronimo.specs.geronimo-jms_2.0_spec_1.0.0.alpha-2 [139]>
axis2-transport-jms_2.0.0.wso2v30_3 [20] imports
osgi> b 590
qpid_jms_client_0.32.0_1.0.0 [590]
Id=590, Status=ACTIVE Data Root=/home/bertrand/DEV/wso2/wso2ei-6.4.0/wso2/components/default/configuration/org.eclipse.osgi/bundles/590/data
"No registered services."
No services in use.
Exported packages
org.apache.qpid.jms; version="0.0.0"[exported]
org.apache.qpid.jms.exceptions; version="0.0.0"[exported]
org.apache.qpid.jms.jndi; version="0.0.0"[exported]
org.apache.qpid.jms.message; version="0.0.0"[exported]
org.apache.qpid.jms.message.facade; version="0.0.0"[exported]
org.apache.qpid.jms.meta; version="0.0.0"[exported]
org.apache.qpid.jms.policy; version="0.0.0"[exported]
org.apache.qpid.jms.provider; version="0.0.0"[exported]
org.apache.qpid.jms.provider.amqp; version="0.0.0"[exported]
org.apache.qpid.jms.provider.amqp.builders; version="0.0.0"[exported]
org.apache.qpid.jms.provider.amqp.filters; version="0.0.0"[exported]
org.apache.qpid.jms.provider.amqp.message; version="0.0.0"[exported]
org.apache.qpid.jms.provider.failover; version="0.0.0"[exported]
org.apache.qpid.jms.sasl; version="0.0.0"[exported]
org.apache.qpid.jms.selector; version="0.0.0"[exported]
org.apache.qpid.jms.selector.filter; version="0.0.0"[exported]
org.apache.qpid.jms.selector.parser; version="0.0.0"[exported]
org.apache.qpid.jms.transports; version="0.0.0"[exported]
org.apache.qpid.jms.transports.netty; version="0.0.0"[exported]
org.apache.qpid.jms.util; version="0.0.0"[exported]
Imported packages
javax.naming.spi; version="0.0.0"<org.eclipse.osgi_3.9.1.v20130814-1242 [0]>
javax.jms; version="0.0.0"<org.eclipse.osgi_3.9.1.v20130814-1242 [0]>
javax.naming; version="0.0.0"<org.eclipse.osgi_3.9.1.v20130814-1242 [0]>
No fragment bundles
Named class space
qpid_jms_client_0.32.0; bundle-version="1.0.0"[provided]
No required bundles
是否可以强制使用 bundle 68?
谢谢
我遇到过类似的问题并使用了适合我的 qpid-jms-client-0.11.1
版本。我从 this Maven repository
借助 WSO2 的支持,我得到了另一个解决方案。
- 使用 qpid 版本
qpid-jms-client-0.32.0.jar
- 从
$WSO2_HOME/lib
中删除库 - 从
$WSO2_HOME/dropins
中删除库 - 确保文件
$WSO2_HOME/conf/etc/launch.ini
中不存在行
geronimo-jms_1.1_spec-1.1.0.wso2v1.jar
geronimo-jms_1.1_spec-1.1.0.wso2v1.jar
javax.jms