尝试从JBoss服务器建立与Websphere队列的连接时验证错误

时间:2012-03-30 06:45:09

标签: jms websphere jboss5.x ibm-mq

尝试将jobFactory从jobScheduler(在jboss-5中运行)初始化到websphere队列时,我得到以下异常

java.lang.VerifyError: Cannot inherit from final class
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:67)
        at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:633)
        at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:592)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:591)
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:568)
        at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:135)
        at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:131)
        at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:455)
        at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:267)
        at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:166)
        at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:276)
        at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1138)
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:862)
        at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:502)
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:447)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at com.ibm.ws.naming.util.WsnInitCtxFactory.parseIiopUrl(WsnInitCtxFactory.java:1781)
        at com.ibm.ws.naming.util.WsnInitCtxFactory.parseBootstrapURL(WsnInitCtxFactory.java:1525)
        at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:389)
        at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:113)
        at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:428)
        at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:144)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at com.test.testBatch.jms.JMSUtil.initialize(JMSUtil.java:57)
        at com.test.testBatch.jms.JMSUtil.send(JMSUtil.java:90)
        at com.test.testBatch.job.OutboundChangesPollingJob.execute(OutboundChangesPollingJob.java:76)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
2012-03-29 09:47:11,775 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) Exception in thread "DefaultQuartzScheduler_Worker-0"
2012-03-29 09:47:11,776 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) java.lang.NoClassDefFoundError: com/ibm/rmi/corba/NamedValueImpl
2012-03-29 09:47:11,777 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at com.ibm.ws.naming.util.WsnInitCtxFactory.parseIiopUrl(WsnInitCtxFactory.java:1781)
2012-03-29 09:47:11,777 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at com.ibm.ws.naming.util.WsnInitCtxFactory.parseBootstrapURL(WsnInitCtxFactory.java:1525)
2012-03-29 09:47:11,777 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:389)
2012-03-29 09:47:11,777 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:113)
2012-03-29 09:47:11,777 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:428)
2012-03-29 09:47:11,777 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:144)
2012-03-29 09:47:11,778 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at javax.naming.InitialContext.lookup(InitialContext.java:392)
2012-03-29 09:47:11,778 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at com.test.testBatch.jms.JMSUtil.initialize(JMSUtil.java:57)
2012-03-29 09:47:11,778 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at com.test.testBatch.jms.JMSUtil.send(JMSUtil.java:90)
2012-03-29 09:47:11,778 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at com.test.testBatch.job.OutboundChangesPollingJob.execute(OutboundChangesPollingJob.java:76)
2012-03-29 09:47:11,778 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
2012-03-29 09:47:11,778 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
2012-03-29 09:47:11,779 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) Caused by: java.lang.ClassNotFoundException: Unexpected error during load of: com.ibm.rmi.corba.NamedValueImpl, msg=Cannot inherit from final class
2012-03-29 09:47:11,779 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:181)
2012-03-29 09:47:11,779 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:276)
2012-03-29 09:47:11,779 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1138)
2012-03-29 09:47:11,779 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:862)
2012-03-29 09:47:11,779 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:502)
2012-03-29 09:47:11,779 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:447)
2012-03-29 09:47:11,779 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        ... 12 more
2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0) Caused by: java.lang.VerifyError: Cannot inherit from final class
2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at java.lang.ClassLoader.defineClass1(Native Method)
2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:67)
2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:633)
2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:592)
2012-03-29 09:47:11,780 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at java.security.AccessController.doPrivileged(Native Method)
2012-03-29 09:47:11,781 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:591)
2012-03-29 09:47:11,781 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:568)
2012-03-29 09:47:11,781 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:135)
2012-03-29 09:47:11,781 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:131)
2012-03-29 09:47:11,781 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:455)
2012-03-29 09:47:11,781 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:267)
2012-03-29 09:47:11,781 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:166)
2012-03-29 09:47:11,781 ERROR [STDERR] (DefaultQuartzScheduler_Worker-0)        ... 18 more

由于它正在抛出classNotFound,我去检查了lib文件夹,这个类出现在名为“ibmorb.jar”的jar中。 (不确定抛出ClassNotFound的原因)

这是在IntialContext

中初始化的命名工厂
com.ibm.websphere.naming.WsnInitialContextFactory

请帮我解决这个问题

2 个答案:

答案 0 :(得分:1)

提到的jar和context工厂倾向于表明WMQ客户端是从WebSphere Application Server安装借来的,而不是使用独立的WMQ客户端安装程序。如果是这种情况,您可以通过安装独立客户端轻松解决此问题。您可以免费获得(注册)作为SupportPac。这些都是版本,因此您可以选择:

请注意,从IBM提供的安装程序安装客户端提供了许多其他功能,例如跟踪诊断,版本显示,初始验证测试代码,示例源代码等。这是IBM将支持的安装方法因此,即使您可以通过从WMQ服务器安装中复制jar来使其工作,建议使用IBM的媒体。

另请注意,Java和JMS类的打包在不同版本之间发生了变化。了解您正在使用的版本并参考CLASSPATH和其他配置选项的相应文档非常重要。 v7.1实现有许多功能改进,是唯一可以利用v7.1 QMgr上的功能的版本。但是它会连接到任何版本的QMgr,所以如果这是新的开发,请尝试立即使用v7.1客户端,这样你就不需要升级了。

每个客户端版本的信息中心链接是:

随IBM安装程序提供的一个实用程序是setmqjmsenv脚本(在安装64位客户端时setmqjmsenv64)在java/bin目录中。您可以在此处查看您的WMQ Client Classes for Java所需的CLASSPATH和其他环境变量。

答案 1 :(得分:0)

解决这个问题的解决方案是

  • 删除IBM jar,如果它在应用程序中放置两次

  • 如果相同的罐子分别放在两个应用程序中(在...中运行) 然后,将jar文件放在jboss的lib文件夹中(到 避免多余)

  • 将jacorb.jar放在jboss的lib文件夹中,以避免使用 java的默认corba包

我遵循了这三个步骤,我没有收到此错误!!!

感谢您的所有答案和努力! : - )