Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/mq/server/MQSESSION

Discussion in 'Java' started by Andy Howells, Nov 26, 2003.

  1. Andy Howells

    Andy Howells Guest

    Can anybody help me on this? I am getting the below error but have not
    got a clue why. The file in my classpath eing used has the class that
    it says is not defined. Any ideas? I am running java version 1.4.0 and
    WMQ Series version 5.3 with CSD04.

    Exception in thread "main" java.lang.NoClassDefFoundError:
    com/ibm/mq/server/MQSESSION
    at com.ibm.mq.MQSESSIONServer.getMQSESSION(MQSESSIONServer.java:67)
    at com.ibm.mq.MQSESSION.getSession(MQSESSION.java:241)
    at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:
    148)
    at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnec
    tion(MQBindingsManagedConnectionFactoryJ11.java:136)
    at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11.createManagedConnect
    ion(MQBindingsManagedConnectionFactoryJ11.java:154)
    at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.jav
    a:80)
    at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConne
    ctionManager.java:150)
    at com.ibm.mq.MQQueueManager.obtainBaseMQQueueManager(MQQueueManager.jav
    a:649)
    at com.ibm.mq.MQQueueManager.construct(MQQueueManager.java:598)
    at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:375)

    Thanks to anybody who can help.
    Andy
    Andy Howells, Nov 26, 2003
    #1
    1. Advertising

  2. Andy Howells

    Sudsy Guest

    Andy Howells wrote:
    > Can anybody help me on this? I am getting the below error but have not
    > got a clue why. The file in my classpath eing used has the class that
    > it says is not defined. Any ideas? I am running java version 1.4.0 and
    > WMQ Series version 5.3 with CSD04.
    >
    > Exception in thread "main" java.lang.NoClassDefFoundError:
    > com/ibm/mq/server/MQSESSION
    > at com.ibm.mq.MQSESSIONServer.getMQSESSION(MQSESSIONServer.java:67)


    So it looks like it's finding the com.ibm.mq package but not the
    com.ibm.mq.server package. I wouldn't be suprised if that package
    was in a separate jar since it's common practice to separate the
    client and servers sides (smaller files for the client).
    If you're running *nix then you can go to the directory where all
    the IBM MQ-Series jars are installed and grep for the class you
    need, e.g.:
    grep com/ibm/mq/server/MQSESSION *.jar

    You should get something like this on a hit:
    Binary file MQServer.jar matches
    Sudsy, Nov 26, 2003
    #2
    1. Advertising

  3. Andy Howells

    Andy Howells Guest

    Sudsy <> wrote in message news:<>...
    > Andy Howells wrote:
    > > Can anybody help me on this? I am getting the below error but have not
    > > got a clue why. The file in my classpath eing used has the class that
    > > it says is not defined. Any ideas? I am running java version 1.4.0 and
    > > WMQ Series version 5.3 with CSD04.
    > >
    > > Exception in thread "main" java.lang.NoClassDefFoundError:
    > > com/ibm/mq/server/MQSESSION
    > > at com.ibm.mq.MQSESSIONServer.getMQSESSION(MQSESSIONServer.java:67)

    >
    > So it looks like it's finding the com.ibm.mq package but not the
    > com.ibm.mq.server package. I wouldn't be suprised if that package
    > was in a separate jar since it's common practice to separate the
    > client and servers sides (smaller files for the client).
    > If you're running *nix then you can go to the directory where all
    > the IBM MQ-Series jars are installed and grep for the class you
    > need, e.g.:
    > grep com/ibm/mq/server/MQSESSION *.jar
    >
    > You should get something like this on a hit:
    > Binary file MQServer.jar matches


    Thanks for your help on this. The problem was that I was using an
    older set of jars. The error message was a boit strange because the
    class that it could not find was within the class file that it was
    using, however, I have set-up my classpath to look at the latest set
    of jars and the issue has now gone away. It must be something to do
    with the MQ dll being comiled against a different set of jars to that
    which are being used at runtime. Anyway - issue resolve!
    Andy Howells, Nov 27, 2003
    #3
  4. Andy Howells

    hiwa Guest

    (Andy Howells) wrote in message news:<>...
    > Can anybody help me on this? I am getting the below error but have not
    > got a clue why. The file in my classpath eing used has the class that
    > it says is not defined. Any ideas? I am running java version 1.4.0 and
    > WMQ Series version 5.3 with CSD04.
    >
    > Exception in thread "main" java.lang.NoClassDefFoundError:
    > com/ibm/mq/server/MQSESSION
    > at com.ibm.mq.MQSESSIONServer.getMQSESSION(MQSESSIONServer.java:67)
    > at com.ibm.mq.MQSESSION.getSession(MQSESSION.java:241)
    > at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:
    > 148)
    > at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnec
    > tion(MQBindingsManagedConnectionFactoryJ11.java:136)
    > at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11.createManagedConnect
    > ion(MQBindingsManagedConnectionFactoryJ11.java:154)
    > at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.jav
    > a:80)
    > at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConne
    > ctionManager.java:150)
    > at com.ibm.mq.MQQueueManager.obtainBaseMQQueueManager(MQQueueManager.jav
    > a:649)
    > at com.ibm.mq.MQQueueManager.construct(MQQueueManager.java:598)
    > at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:375)
    >
    > Thanks to anybody who can help.
    > Andy

    Classpath for packaged classes can have intricate issues. I recommend
    you to read J2SE standard doc /tooldocs/solaris/classpath.html,
    especially the last part of the doc.
    hiwa, Nov 29, 2003
    #4
  5. Andy Howells

    HiteshMehra

    Joined:
    Aug 21, 2007
    Messages:
    1
    java.lang.NoClassDefFoundError: com/ibm/mq/server/MQSESSION

    Hi,
    well I am facing the same issue while accessing the MQ. The error I am getting is

    java.lang.NoClassDefFoundError: com/ibm/mq/server/MQSESSION
    at com.ibm.mq.MQSESSIONServer.getMQSESSION(MQSESSIONServer.java:68)
    at com.ibm.mq.MQSESSION.getSession(MQSESSION.java:493)
    at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:155)
    at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:153)

    at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11.createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:189)

    at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:80)
    at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:171)
    at com.ibm.mq.MQQueueManager.obtainBaseMQQueueManager(MQQueueManager.java:754)
    at com.ibm.mq.MQQueueManager.construct(MQQueueManager.java:688)
    at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:417)
    at clyde.qbase.impl.MQ.QMQQueueMgrConnection.getMQManager(Unknown Source)
    at clyde.qbase.impl.MQ.QMQQueueMgrConnection.rollback(Unknown Source)
    at clyde.qbase.queue.PoolableQMgrCnxn$5.doit(Unknown Source)
    at clyde.qbase.queue.PoolableQMgrCnxn.tryOperation(Unknown Source)
    at clyde.qbase.queue.PoolableQMgrCnxn.rollback(Unknown Source)
    at clyde.qbase.queue.QueueMgrConnection.rollback(Unknown Source)
    at clyde.qbase.queue.QueueTransaction.rollback(Unknown Source)
    at clyde.q.server.QMsgServerImp.run(Unknown Source)
    at clyde.q.server.QMsgServer.run(Unknown Source)
    at com.nm.cbpel.server.CBPELRunnable.run(CBPELRunnable.java:126)
    at clyde.core.thread.WorkerThreadManager$WorkerRunnable.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:568)


    I checked the class and it looks fine. Also the com.ibm.mq.jar I am using is the new jar and not an old one. I also set the classpath in my environment varibales but still was not able to resolve the issue. Can someone tell me what can be the possible issue. Its urgent...

    Thanks a lot
    HiteshMehra, Aug 21, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Froggy
    Replies:
    5
    Views:
    10,219
    Jose Rubio
    Dec 5, 2003
  2. Piotre Ugrumov
    Replies:
    3
    Views:
    14,085
    Mohan Akula
    Jan 28, 2004
  3. dave
    Replies:
    2
    Views:
    2,462
    Roedy Green
    Jul 16, 2004
  4. Replies:
    1
    Views:
    2,120
    Irmen de Jong
    Jun 22, 2004
  5. Replies:
    2
    Views:
    441
Loading...

Share This Page