|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
I've got an error of "java.lang.NoClassDefFoundError: java/s |
« View previous topic :: View next topic » |
Author |
Message
|
wildtiger |
Posted: Fri May 03, 2002 10:38 am Post subject: |
|
|
 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 |
|
 |
amurugan |
Posted: Wed May 08, 2002 1:12 am Post subject: |
|
|
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 |
|
 |
ourtown |
Posted: Fri Jan 03, 2003 4:38 pm Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|