Error message: java.lang.NoClassDefFoundError: com/ibm/mq/server/MQSESSION

Hi, I have a Java Agent that try to connect to MQSeries, but when the agents gets to the first line of the “connect” (qMgr = new MQQueueManager(mqQmName)) it rise the following error: java.lang.NoClassDefFoundError: com/ibm/mq/server/MQSESSION.I have verified JavaUserClasses (notes.ini), CLASSPATH environment variable (.profile), acces file permission on “.jar*”, but it seems to be everything all rigth.

Could you help me, please.

Thanks, Nataly.

Subject: error message: java.lang.NoClassDefFoundError: com/ibm/mq/server/MQSESSION

Ok, It is a detail on the notes.ini configuration but you must know that : More help means less clothes in the picture you are going to send me.

Big kis

Hen.

Subject: error message: java.lang.NoClassDefFoundError: com/ibm/mq/server/MQSESSION

Nataly,

The JAR file you need most is connect.jar.

You will find that there isn’t enough room in the JavaUserClasses notes.ini parameter to spell out the full path to all 9 JAR files you need. There are only two alternatives:

A) Import all the JAR files into your MQ Java agent by clicking on the “Edit Project” button on the bottom of Designer.

–OR–

B) Put all the JAR files in the Notes program directory, i.e., C:\Lotus\Notes. Then you can just specify the JAR file names in JavaUserClasses without the full path as shown below…

JavaUserClasses=connector.jar;fscontext.jar;jms.jar;jndi.jar;jta.jar;ldap.jar;providerutil.jar;com.ibm.mqjms.jar;com.ibm.mq.jar;.

I tried (A) for awhile, but found that it bombed with the same NoClassDefFoundError after about 8 tests in a row.

Then I went with (B), but that has the downside of having to deploy all those files into the core product folder which would be easy to miss in a reinstall.

I finally went with a third approach (C) where I wrote a standalone Java program outside of Notes and I call it from a batch file which Notes executes via the LotusScript Shellid statement. All the JAR files reside in a subfolder where my standalone progam is.

Ken

Subject: RE: error message: java.lang.NoClassDefFoundError: com/ibm/mq/server/MQSESSION

I would suggest using the javauserclasses environment variable only in cases where you need to place a jar file in the beginning of the class path so that it is found before a “native” jar file at runtime.Otherwise, for jar files that are not subject to change on a frequent basis (e.g., JDBC drivers, XML parsers, etc) you should try adding them to the extensions directory on the server which should be under the program directory. For example:

/jvm/lib/ext

After doing so restart the server.

hth,

dgg

Subject: RE: error message: java.lang.NoClassDefFoundError: com/ibm/mq/server/MQSESSION

Ken,

thanks for you information, I copied *.jar into notes_data_dir, and then I changed JavaUserClass, eliminating all path to each jar … but this not function :frowning:

Now, I back all the change to first.

My environment is the next:

NOTES_DATA_DIR=/notes/notesr5

JavaUserClasses=/usr/tmp/com.ibm.mq.jar:/usr/tmp/connector.jar:/usr/tmp/jta.jar:/usr/tmp/com.ibm.mqjms.jar:/usr/tmp/ldap.jar:/

usr/tmp/jndi.jar:/usr/tmp/jms.jar:/usr/tmp/fscontext.jar:/usr/tmp/providerutil.jar

Verify files:

ls -la /usr/tmp/com.ibm.mq.jar /usr/tmp/connector.jar /usr/tmp/jta.jar /usr/tmp/com.ibm.mqjms.jar /usr>

-rwxr-xr-x 1 notes notes 344276 Mar 14 11:50 /usr/tmp/com.ibm.mq.jar

-rwxr-xr-x 1 notes notes 1779517 Mar 14 11:50 /usr/tmp/com.ibm.mqjms.jar

-rwxr-xr-x 1 notes notes 17978 Mar 14 11:50 /usr/tmp/connector.jar

-rwxr-xr-x 1 notes notes 22769 Mar 14 11:50 /usr/tmp/fscontext.jar

-rwxr-xr-x 1 notes notes 25998 Mar 14 11:50 /usr/tmp/jms.jar

-rwxr-xr-x 1 notes notes 98496 Mar 14 11:50 /usr/tmp/jndi.jar

-rwxr-xr-x 1 notes notes 8809 Mar 14 11:50 /usr/tmp/jta.jar

-rwxr-xr-x 1 notes notes 123717 Mar 14 11:50 /usr/tmp/ldap.jar

-rwxr-xr-x 1 notes notes 77116 Mar 14 11:50 /usr/tmp/providerutil.jar

again thanks.

Regards Nataly.

PD: if you need more information that it can to help you, tell me please.

Subject: please read/try suggestions posted on 03/15

Subject: error message: java.lang.NoClassDefFoundError: com/ibm/mq/server/MQSESSION

Hello Nataly

I’m a Lotus Notes expert and i know exactly what is your problem. I can give you a hand if you send me your picture

Tks

Subject: RE: error message: java.lang.NoClassDefFoundError: com/ibm/mq/server/MQSESSION

OK Henry, but you must give me a clue of the solution and I will send the picture. Be aware that I did a lot of test.

bye bye :slight_smile: