ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » java.lang.NoClassDefFoundError

Post new topic  Reply to topic
 java.lang.NoClassDefFoundError « View previous topic :: View next topic » 
Author Message
mqs_guy
PostPosted: Fri Mar 28, 2003 2:30 pm    Post subject: java.lang.NoClassDefFoundError Reply with quote

Acolyte

Joined: 09 May 2002
Posts: 71

Hi Guys,

I wrote a small MQ program on AIX to do a MQGET from a queue. There is no problem when i compiling it. But when I run it, I got the following exception:

java.lang.NoClassDefFoundError: java/security/PrivilegedAction
at
at com.ibm.mq.MQSESSIONServer.getMQSESSION(Compiled Code)
at com.ibm.mq.MQSESSION.getSession(Compiled Code)
at com.ibm.mq.MQManagedConnectionJ11.<init>(Compiled Code)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnection(Compiled Code)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11.createManagedConnection(Compiled Code)
at com.ibm.mq.StoredManagedConnection.<init>(Compiled Code)
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(Compiled Code)
at com.ibm.mq.MQQueueManager.obtainBaseMQQueueManager(Compiled Code)
at com.ibm.mq.MQQueueManager.construct(Compiled Code)
at com.ibm.mq.MQQueueManager.<init>(Compiled Code)
at MQConnect.<init>(Compiled Code)
at MQConnect.main(Compiled Code)


I executed javap java/security/PriviledgedAction to get the following message:

This utility can be used to reverse assemble code. Many program license
agreements do not permit reverse assembly. If you are not the copyright
owner of the code which you want to reverse assemble, please check the
license agreement under which you acquired such code to confirm whether
you are permitted to perform such reverse assembly.

Class 'java/security/PriviledgedAction' not found

I guess it has something to do with the classpath. My classpath is

$ echo $CLASSPATH
.:/usr/jdk_base/lib/classes.zip:/usr/mqm/java/lib/com.ibm.mq.jar:/usr/mqm/java/lib/com.ibm.mqbind.jar:/usr/mqm/java/lib/com.ibm.mqjms.jar:/usr/mqm/java/lib/connector.jar:/usr/mqm/java/lib/jta.jar:

I am using MQSeries 5.3 where me have MA88 (support for java classes) built in.
Can u please help me solving this.
Any inputs on this would be of great help.

Thanks & Regards,
Vishal
Back to top
View user's profile Send private message
vennela
PostPosted: Fri Mar 28, 2003 4:04 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

What version of JDK are you using. Is it SUN's or IBM's.
Usually java/something means that's not an MQ class.

Is your LD_LIBRARY_PATH set to /usr/mqm/java/lib?

May be you should post your code so that if we make some changes it will not hit the class...

-------
Venny
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dpchiesa
PostPosted: Mon Mar 31, 2003 8:54 am    Post subject: PrivilegedAction Reply with quote

Apprentice

Joined: 29 May 2002
Posts: 46

PrivilegedAction is a class that is included in JDK 1.4.
See http://java.sun.com/j2se/1.4/docs/api/java/security/PrivilegedAction.html .

It looks like you are trying to run an app that requires Java 1.4

Also, when you ran javap - you spelled the classname incorrectly. But it wouldn't matter since the class is not installed anyway.

Solution: install Java 1.4, then re-run.
_________________
-dpchiesa
Back to top
View user's profile Send private message
mqs_guy
PostPosted: Mon Mar 31, 2003 9:37 am    Post subject: Reply with quote

Acolyte

Joined: 09 May 2002
Posts: 71

Hi,

Now i get an different error. please find the same below

***************************************************
java.lang.NoClassDefFoundError: javax/resource/spi/ConnectionRequestInfo
at com.ibm.mq.MQSESSION.getConnectionRequestInfo(Compiled Code)
at com.ibm.mq.MQQueueManager.obtainBaseMQQueueManager(Compiled Code)
at com.ibm.mq.MQQueueManager.construct(Compiled Code)
at com.ibm.mq.MQQueueManager.<init>(Compiled Code)
at MQConn.connect(Compiled Code)
at MQConn.main(Compiled Code)

***********************************************

This error "java.lang.NoClassDefFoundError" comes when your classpath is not properly set. The JVM is trying to locate the class file but it's not able to do so. i have changed my CLASSPATH and PATH but it still doesn't help.
CLASSPATH
$ echo $CLASSPATH
.:/usr/bin/:/usr/mqm/java/lib/com.ibm.mq.jar:/usr/mqm/java/lib:

PATH
$ echo $PATH
/usr/bin:/usr/mqm/java/lib/com.ibm.mq.jar:/usr/mqm/java/lib:etc:/usr/sbin:/usr/ucb:/home/mqm/bin:/usr/bin/X11:/sbin:.:

I am unable to proceed further..please any inputs would be of great help.

- Vishal
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » java.lang.NoClassDefFoundError
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.