通过JMS的Websphere MQ:NoClassDefFoundError

时间:2016-02-07 00:01:45

标签: java jms ibm-mq

我正在尝试为Websphere MQ 7.5创建一个简单的JMS客户端应用程序 我已经有连接工厂和目的地的“.bindings”文件,我正在尝试连接到。 这是我的简单Java代码,我试图在mac上运行:

package com.company;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.naming.Context;
import javax.naming.directory.InitialDirContext;
import java.util.Hashtable;
public class Main {
    public static final String     cfLookup    = "TEST12";
    public static final String     icf         = "com.sun.jndi.fscontext.RefFSContextFactory";
    static              String     url         = "file:///tmp/JNDI";
    public static void main(String[] args) {
        InitialDirContext  ctx          = null;
        Destination myDest       = null;
        ConnectionFactory connFactory  = null;
        Hashtable environment = new Hashtable();
        try {
        environment.put(Context.INITIAL_CONTEXT_FACTORY, icf);
        environment.put(Context.PROVIDER_URL, url);
            ctx = new InitialDirContext( environment );
            connFactory = (ConnectionFactory)ctx.lookup( cfLookup );
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

这是例外:

Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/disthub2/impl/client/SessionConfig
    at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.setupDistHubTracing(WMQFactoryFactory.java:335)
    at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.<init>(WMQFactoryFactory.java:305)
    at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.getInstance(WMQFactoryFactory.java:186)
    at com.ibm.msg.client.wmq.factories.WMQComponent.getFactoryInstance(WMQComponent.java:140)
    at com.ibm.msg.client.jms.internal.JmsFactoryFactoryImpl.getInstance(JmsFactoryFactoryImpl.java:157)
    at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.setProviderFactory(JmsConnectionFactoryImpl.java:168)
    at com.ibm.mq.jms.MQConnectionFactory.<init>(MQConnectionFactory.java:293)
    at com.ibm.mq.jms.MQQueueConnectionFactory.<init>(MQQueueConnectionFactory.java:81)
    at com.ibm.mq.jms.MQQueueConnectionFactoryFactory.getObjectInstance(MQQueueConnectionFactoryFactory.java:77)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
    at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
    at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
    at javax.naming.InitialContext.lookup(InitialContext.java:417)
    at com.company.Main.main(Main.java:20)
    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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

很明显,需要一些其他库,但是从Websphere MQ客户端安装中复制的那些JAR文件似乎都不起作用。而且,对JNDI进行查询需要一些特定于提供者的类,这有点奇怪。 我已经在IBM和mqseries上阅读了很多主题,但没有任何帮助。任何帮助都会受到高度赞赏。

每次运行时,还会有一个新生成的FDC文件,其中包含更详细的信息

----------------------------------START FFST------------------------------------
/Users/***/IdeaProjects/JmsSample/FFDC/JMSCC0001.FDC PID:640

                                    JMS Common Client First Failure Symptom Report


Product          :- IBM WebSphere MQ classes for JMS
Date/Time        :- Sat Feb 06 16:56:23 MSK 2016
System time      :- 1454766983855
Operating System :- Mac OS X
UserID           :- ***
Java Vendor      :- Oracle Corporation
Java Version     :- 25.72-b15

Source Class     :- JmsFactoryFactory
Source Method    :- getIntance(int)
ProbeID          :- XI001005
Thread           :- name=main priority=5 group=main ccl=sun.misc.Launcher$AppClassLoader@372f7a8d

                                      Data
                                      ----

|   connectionTypeName  :-  com.ibm.msg.client.wmq
|   exception           :-  ExceptionDepth is 4
|   exception           :-  
|   |   Cause:1       :-  java.lang.reflect.InvocationTargetException
|   |   Cause:2       :-  java.lang.NoClassDefFoundError: com/ibm/disthub2/impl/client/SessionConfig
|   |   Cause:3       :-  java.lang.ClassNotFoundException: com.ibm.disthub2.impl.client.SessionConfig
|   |   Message:2     :-  com/ibm/disthub2/impl/client/SessionConfig
|   |   Message:3     :-  com.ibm.disthub2.impl.client.SessionConfig
|   |   StackTrace:1  :-  java.lang.reflect.InvocationTargetException
|   |       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 com.ibm.msg.client.jms.JmsFactoryFactory.getInstance(JmsFactoryFactory.java:182)
|   |       at com.ibm.mq.jms.MQConnectionFactory.initialiseMQConnectionFactory(MQConnectionFactory.java:3314)
|   |       at com.ibm.mq.jms.MQConnectionFactory.<init>(MQConnectionFactory.java:283)
|   |       at com.ibm.mq.jms.MQQueueConnectionFactory.<init>(MQQueueConnectionFactory.java:81)
|   |       at com.ibm.mq.jms.MQQueueConnectionFactoryFactory.getObjectInstance(MQQueueConnectionFactoryFactory.java:77)
|   |       at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
|   |       at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
|   |       at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
|   |       at javax.naming.InitialContext.lookup(InitialContext.java:417)
|   |       at com.company.Main.main(Main.java:31)
|   |       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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
|   |   Caused by: java.lang.NoClassDefFoundError: com/ibm/disthub2/impl/client/SessionConfig
|   |       at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.setupDistHubTracing(WMQFactoryFactory.java:335)
|   |       at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.<init>(WMQFactoryFactory.java:305)
|   |       at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.getInstance(WMQFactoryFactory.java:186)
|   |       at com.ibm.msg.client.wmq.factories.WMQComponent.getFactoryInstance(WMQComponent.java:140)
|   |       at com.ibm.msg.client.jms.internal.JmsFactoryFactoryImpl.getInstance(JmsFactoryFactoryImpl.java:157)
|   |       ... 19 more
|   |   Caused by: java.lang.ClassNotFoundException: com.ibm.disthub2.impl.client.SessionConfig
|   |       at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
|   |       at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
|   |       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
|   |       at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
|   |       ... 24 more
|   |   
|   |   StackTrace:2  :-  java.lang.NoClassDefFoundError: com/ibm/disthub2/impl/client/SessionConfig
|   |       at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.setupDistHubTracing(WMQFactoryFactory.java:335)
|   |       at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.<init>(WMQFactoryFactory.java:305)
|   |       at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.getInstance(WMQFactoryFactory.java:186)
|   |       at com.ibm.msg.client.wmq.factories.WMQComponent.getFactoryInstance(WMQComponent.java:140)
|   |       at com.ibm.msg.client.jms.internal.JmsFactoryFactoryImpl.getInstance(JmsFactoryFactoryImpl.java:157)
|   |       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 com.ibm.msg.client.jms.JmsFactoryFactory.getInstance(JmsFactoryFactory.java:182)
|   |       at com.ibm.mq.jms.MQConnectionFactory.initialiseMQConnectionFactory(MQConnectionFactory.java:3314)
|   |       at com.ibm.mq.jms.MQConnectionFactory.<init>(MQConnectionFactory.java:283)
|   |       at com.ibm.mq.jms.MQQueueConnectionFactory.<init>(MQQueueConnectionFactory.java:81)
|   |       at com.ibm.mq.jms.MQQueueConnectionFactoryFactory.getObjectInstance(MQQueueConnectionFactoryFactory.java:77)
|   |       at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
|   |       at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
|   |       at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
|   |       at javax.naming.InitialContext.lookup(InitialContext.java:417)
|   |       at com.company.Main.main(Main.java:31)
|   |       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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
|   |   Caused by: java.lang.ClassNotFoundException: com.ibm.disthub2.impl.client.SessionConfig
|   |       at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
|   |       at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
|   |       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
|   |       at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
|   |       ... 24 more
|   |   
|   |   StackTrace:3  :-  java.lang.ClassNotFoundException: com.ibm.disthub2.impl.client.SessionConfig
|   |       at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
|   |       at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
|   |       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
|   |       at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
|   |       at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.setupDistHubTracing(WMQFactoryFactory.java:335)
|   |       at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.<init>(WMQFactoryFactory.java:305)
|   |       at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.getInstance(WMQFactoryFactory.java:186)
|   |       at com.ibm.msg.client.wmq.factories.WMQComponent.getFactoryInstance(WMQComponent.java:140)
|   |       at com.ibm.msg.client.jms.internal.JmsFactoryFactoryImpl.getInstance(JmsFactoryFactoryImpl.java:157)
|   |       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 com.ibm.msg.client.jms.JmsFactoryFactory.getInstance(JmsFactoryFactory.java:182)
|   |       at com.ibm.mq.jms.MQConnectionFactory.initialiseMQConnectionFactory(MQConnectionFactory.java:3314)
|   |       at com.ibm.mq.jms.MQConnectionFactory.<init>(MQConnectionFactory.java:283)
|   |       at com.ibm.mq.jms.MQQueueConnectionFactory.<init>(MQQueueConnectionFactory.java:81)
|   |       at com.ibm.mq.jms.MQQueueConnectionFactoryFactory.getObjectInstance(MQQueueConnectionFactoryFactory.java:77)
|   |       at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
|   |       at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
|   |       at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
|   |       at javax.naming.InitialContext.lookup(InitialContext.java:417)
|   |       at com.company.Main.main(Main.java:31)
|   |       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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
|   |   

                              Version information
                              -------------------

IBM WebSphere MQ JMS Provider
7.5.0.3
p750-003-140123
Production

Common Services for Java Platform, Standard Edition
7.5.0.3
p750-003-140123
Production

Java Message Service Client
7.5.0.3
p750-003-140123
Production

WebSphere MQ classes for Java Message Service
7.5.0.3
p750-003-140123
Production



                                  Stack trace
                                  -----------

Stack trace to show the location of the FFST call
|   FFST Location  :-  java.lang.Exception
|       at com.ibm.msg.client.commonservices.trace.Trace.getCurrentPosition(Trace.java:1959)
|       at com.ibm.msg.client.commonservices.trace.Trace.createFFSTString(Trace.java:1898)
|       at com.ibm.msg.client.commonservices.trace.Trace.ffstInternal(Trace.java:1787)
|       at com.ibm.msg.client.commonservices.trace.Trace.ffst(Trace.java:1660)
|       at com.ibm.msg.client.jms.JmsFactoryFactory.getInstance(JmsFactoryFactory.java:214)
|       at com.ibm.mq.jms.MQConnectionFactory.initialiseMQConnectionFactory(MQConnectionFactory.java:3314)
|       at com.ibm.mq.jms.MQConnectionFactory.<init>(MQConnectionFactory.java:283)
|       at com.ibm.mq.jms.MQQueueConnectionFactory.<init>(MQQueueConnectionFactory.java:81)
|       at com.ibm.mq.jms.MQQueueConnectionFactoryFactory.getObjectInstance(MQQueueConnectionFactoryFactory.java:77)
|       at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
|       at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
|       at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
|       at javax.naming.InitialContext.lookup(InitialContext.java:417)
|       at com.company.Main.main(Main.java:31)
|       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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
|   

                            Property Store Contents
                            -----------------------

All currently set properties
|   awt.toolkit                    :-  sun.lwawt.macosx.LWCToolkit
|   file.encoding                  :-  UTF-8
|   file.encoding.pkg              :-  sun.io
|   file.separator                 :-  /
|   ftp.nonProxyHosts              :-  local|*.local|169.254/16|*.169.254/16
|   gopherProxySet                 :-  false
|   http.nonProxyHosts             :-  local|*.local|169.254/16|*.169.254/16
|   idea.launcher.bin.path         :-  /Applications/IntelliJ IDEA 15 CE.app/Contents/bin
|   idea.launcher.port             :-  7533
|   java.awt.graphicsenv           :-  sun.awt.CGraphicsEnvironment
|   java.awt.printerjob            :-  sun.lwawt.macosx.CPrinterJob
|   java.class.path                :-  /Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/lib/tools.jar:/Users/vladimirpopov/IdeaProjects/JmsSample/out/production/JmsSample:/Users/vladimirpopov/IdeaProjects/JmsSample/com.ibm.mq.jar:/Users/vladimirpopov/IdeaProjects/JmsSample/com.ibm.mqjms.jar:/Users/vladimirpopov/Downloads/jar/jms.jar:/Users/vladimirpopov/Downloads/jar/jndi.jar:/Users/vladimirpopov/Downloads/jar/fscontext.jar:/Users/vladimirpopov/Downloads/jar/com.ibm.mq.commonservices.jar:/Users/vladimirpopov/Downloads/jar/com.ibm.mq.defaultconfig.jar:/Users/vladimirpopov/Downloads/jar/providerutil.jar:/Applications/IntelliJ IDEA 15 CE.app/Contents/lib/idea_rt.jar
|   java.class.version             :-  52.0
|   java.endorsed.dirs             :-  /Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/endorsed
|   java.ext.dirs                  :-  /Users/vladimirpopov/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
|   java.home                      :-  /Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre
|   java.io.tmpdir                 :-  /var/folders/v0/vk3bz2wn79q5_9qggqqf_ynh0000gn/T/
|   java.library.path              :-  /Users/vladimirpopov/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
|   java.runtime.name              :-  Java(TM) SE Runtime Environment
|   java.runtime.version           :-  1.8.0_72-b15
|   java.specification.name        :-  Java Platform API Specification
|   java.specification.vendor      :-  Oracle Corporation
|   java.specification.version     :-  1.8
|   java.vendor                    :-  Oracle Corporation
|   java.vendor.url                :-  http://java.oracle.com/
|   java.vendor.url.bug            :-  http://bugreport.sun.com/bugreport/
|   java.version                   :-  1.8.0_72
|   java.vm.info                   :-  mixed mode
|   java.vm.name                   :-  Java HotSpot(TM) 64-Bit Server VM
|   java.vm.specification.name     :-  Java Virtual Machine Specification
|   java.vm.specification.vendor   :-  Oracle Corporation
|   java.vm.specification.version  :-  1.8
|   java.vm.vendor                 :-  Oracle Corporation
|   java.vm.version                :-  25.72-b15
|   line.separator                 :-  
|   
|   os.arch                        :-  x86_64
|   os.name                        :-  Mac OS X
|   os.version                     :-  10.10.5
|   path.separator                 :-  :
|   socksNonProxyHosts             :-  local|*.local|169.254/16|*.169.254/16
|   sun.arch.data.model            :-  64
|   sun.boot.class.path            :-  /Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/classes
|   sun.boot.library.path          :-  /Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib
|   sun.cpu.endian                 :-  little
|   sun.cpu.isalist                :-  
|   sun.io.unicode.encoding        :-  UnicodeBig
|   sun.java.command               :-  com.intellij.rt.execution.application.AppMain com.company.Main
|   sun.java.launcher              :-  SUN_STANDARD
|   sun.jnu.encoding               :-  UTF-8
|   sun.management.compiler        :-  HotSpot 64-Bit Tiered Compilers
|   sun.os.patch.level             :-  unknown
|   user.country                   :-  US
|   user.dir                       :-  /Users/vladimirpopov/IdeaProjects/JmsSample
|   user.home                      :-  /Users/vladimirpopov
|   user.language                  :-  en
|   user.name                      :-  vladimirpopov
|   user.timezone                  :-  

                           WorkQueueMananger Contents
                           --------------------------

|   Current ThreadPool size      :-  0
|   Maintain ThreadPool size     :-  false
|   Maximum ThreadPool size      :-  -1
|   ThreadPool inactive timeout  :-  0

                               Runtime properties
                               ------------------

|   Available processors         :-  4
|   Free memory in bytes (now)   :-  107069912
|   Max memory in bytes          :-  1908932608
|   Total memory in bytes (now)  :-  128974848

                           Component Manager Contents
                           --------------------------

Common Services Components:
|   CMVC               :-  p750-003-140123
|   Class Name         :-  class com.ibm.msg.client.commonservices.j2se.J2SEComponent
|   Component Name     :-  com.ibm.msg.client.commonservices.j2se
|   Component Title    :-  Common Services for Java Platform, Standard Edition
|   Factory Class      :-  class com.ibm.msg.client.commonservices.j2se.CommonServicesImplementation
|   Version            :-  7.5.0.3
|   inPreferenceTo[0]  :-  com.ibm.msg.client.commonservices.j2me

Messaging Provider Components:
|   CMVC             :-  p750-003-140123
|   Class Name       :-  class com.ibm.msg.client.wmq.factories.WMQComponent
|   Component Name   :-  com.ibm.msg.client.wmq
|   Component Title  :-  IBM WebSphere MQ JMS Provider
|   Factory Class    :-  class com.ibm.msg.client.wmq.factories.WMQFactoryFactory
|   Version          :-  7.5.0.3

3 个答案:

答案 0 :(得分:1)

您是否意识到可以查看JAR文件?具有该类的MQ Java JAR文件是'dhbcore.jar'。

不是选择性地复制然后使用某些MQ JAR文件(IBM不支持),为什么不遵循IBM已经列出的supported path

答案 1 :(得分:0)

在类路径中添加dhbcore.jar,你应该很好。

答案 2 :(得分:0)

我正在与WAS8合作,但我相信答案是相似的。

您必须引用${was8Path}/installedConnectors/wmq.jmsra.rar/路径中的lib。

我有一个类似的异常**Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/msg/client/commonservices/trace/Trace**,我通过将${was8Path}/installedConnectors/wmq.jmsra.rar/com.ibm.msg.client.commonservices.jar库引用到项目来解决它。