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 » I've got an error of "java.lang.NoClassDefFoundError: java/s

Post new topic  Reply to topic
 I've got an error of "java.lang.NoClassDefFoundError: java/s « View previous topic :: View next topic » 
Author Message
wildtiger
PostPosted: Fri May 03, 2002 10:38 am    Post subject: Reply with quote

Acolyte

Joined: 21 Apr 2002
Posts: 55
Location: Canada

Hi,

I wrote a small MQ/JMS program which can run very well on WinNT. When I ftp the source code to AIX. There is no problem when compiling it. But when I run it, I got the following exception:

java.lang.NoClassDefFoundError: java/security/PrivilegedAction
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(Compile
d Code)
at MQPutFile.main(Compiled Code)

I don't have MQ Class for Java (ma88) installed on AIX. I just ftp all the jar files and properties from WinNT to AIX, and add them to classpath. Should it work? The following is part of the source code:

=================================================

MQQueueConnectionFactory queueConnectionFactory;
QueueConnection queueConnection;
QueueSession queueSession;
Queue queue;
QueueSender queueSender;
TextMessage textMessage;

System.out.print ( "Connectting to "" + qmName + "" at " + qmAddress + " through channel "" + channelName + "" . . ." );
queueConnectionFactory = new MQQueueConnectionFactory ( );
queueConnectionFactory.setTransportType ( JMSC.MQJMS_TP_CLIENT_MQ_TCPIP );
queueConnectionFactory.setQueueManager ( qmName );
queueConnectionFactory.setHostName ( qmAddress );
if ( qmAddressPort != null )
queueConnectionFactory.setPort ( Integer.valueOf(qmAddressPort).intValue() );
queueConnectionFactory.setChannel ( channelName );

=================================================

Thanks in advance!
//queueConnection = queueConnectionFactory.createQueueConnection ( "", "" );
queueConnection = queueConnectionFactory.createQueueConnection ( );
queueSession = queueConnection.createQueueSession ( false, Session.AUTO_ACKNOWLEDGE );
System.out.println ( "done." );
System.out.print ( "Openning queue "" + queueName + "" for putting file content . . ." );
queue = queueSession.createQueue ( "queue:///" + queueName );
queueSender = queueSession.createSender ( queue );
textMessage = queueSession.createTextMessage ( );
textMessage.setText ( fileContent );
queueConnection.start ( );
queueSender.send ( textMessage );
queueConnection.close ( );
System.out.println ( "done." );

Back to top
View user's profile Send private message
amurugan
PostPosted: Wed May 08, 2002 1:12 am    Post subject: Reply with quote

Voyager

Joined: 10 Sep 2001
Posts: 75
Location: india

hi ,
Its clearly a classpath problem . Either the classpath was not set for the particular package or the class is not available . to check just before running the program type in the command prompt as follows

javap java/security/PrivilegedAction

this class file disassemebler will list all the methods and attriutes of teh class if its in the classpath or else it will also return classnot found exception .just do this and try to set the classpath correctly.hope this works

cheers,
murugan
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
ourtown
PostPosted: Fri Jan 03, 2003 4:38 pm    Post subject: Reply with quote

Acolyte

Joined: 05 Feb 2002
Posts: 67
Location: Somerset, NJ

Just to close these out - the issue is that /usr/bin/java version is likely to be 1.1.8

You need to add /usr/WebSphere/AppServer/java/bin at the start of your path - or wherever your jdk is installed

By magic the correct rt.jar will then be picked up
_________________
Brian S. Crabtree
WBI Consultant
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » I've got an error of "java.lang.NoClassDefFoundError: java/s
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.