Author |
Message
|
nik_iway |
Posted: Thu Mar 23, 2006 1:37 am Post subject: JAVA API ERROR |
|
|
Centurion
Joined: 21 Jul 2005 Posts: 115
|
Hi all ,
I am getting following error wen compiling the MQPUT java API Program
Exception in thread "main" java.lang.NoClassDefFoundError: javax/resource/Resour
ceException
at com.ibm.mq.MQEnvironment.<clinit>(MQEnvironment.java:224)
at MQPUT.pushq(MQPUT.java:23)
at MQPUT.main(MQPUT.java:54)
Any Suggestions
Nik |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu Mar 23, 2006 1:45 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi nik_iway,
What have u tried to fix this problem, other than posting it here
Regards. |
|
Back to top |
|
 |
mvic |
Posted: Thu Mar 23, 2006 1:55 am Post subject: Re: JAVA API ERROR |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
Please post some sample code for this problem, and the classpath you're using. |
|
Back to top |
|
 |
fschofer |
Posted: Thu Mar 23, 2006 1:55 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
Hi,
use the search button and search for ResourceException
then you will find the solution for your problem.
=> Topic "javax/resource/ResourceException"
Greetings
Frank |
|
Back to top |
|
 |
nik_iway |
Posted: Thu Mar 23, 2006 5:11 am Post subject: |
|
|
Centurion
Joined: 21 Jul 2005 Posts: 115
|
import com.ibm.mq.MQC;
import com.ibm.mq.MQEnvironment;
import com.ibm.mq.MQException;
import com.ibm.mq.MQMessage;
import com.ibm.mq.MQPutMessageOptions;
import com.ibm.mq.MQQueue;
import com.ibm.mq.MQQueueManager;
import java.lang.StackTraceElement;
import java.util.*;
public class MQPUT
{
public void pushq()
{
try
{
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES_CLIENT);
MQEnvironment.hostname = "10.106.51.36";
MQEnvironment.port = 1414;
MQEnvironment.channel= "CHAN1";
MQQueueManager qMgr1 = new MQQueueManager("QA");
int openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_INQUIRE |MQC.MQOO_SET;
MQQueue queue = qMgr1.accessQueue("TEST", openOptions);
MQPutMessageOptions pmo = new MQPutMessageOptions();
MQMessage msg = new MQMessage();
msg.writeString("Hello");
queue.put(msg, pmo);
qMgr1.commit();
queue.close();
qMgr1.disconnect();
}
catch(MQException mqe)
{
mqe.printStackTrace();
}
catch (Exception exc)
{
exc.printStackTrace();
}
}
public static void main(String args[])
{
MQPUT mmm=new MQPUT();
mmm.pushq();
}
}
When i am Compiling I am getting the follwing error
Unable to load message catalog - mqji
com.ibm.mq.MQException: Message catalog not found
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:
171)
at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnecti
on(MQClientManagedConnectionFactoryJ11.java:228)
at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnectio
n(MQClientManagedConnectionFactoryJ11.java:245)
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:666)
at com.ibm.mq.MQQueueManager.construct(MQQueueManager.java:615)
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:392)
at MQPUT.pushq(MQPUT.java:27)
at MQPUT.main(MQPUT.java:54)
Help needed Please.
Regards
Nik |
|
Back to top |
|
 |
mvic |
Posted: Thu Mar 23, 2006 5:38 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
Seems likely to be a classpath problem, or an incomplete / corrupted installation of MQ or its jar files.
What is the classpath? (NB. I asked this before).
One more thing: is this really an error when compiling (javac)? Or is it in fact when running the program (java or javaw) you've compiled? |
|
Back to top |
|
 |
nik_iway |
Posted: Mon Mar 27, 2006 2:13 am Post subject: |
|
|
Centurion
Joined: 21 Jul 2005 Posts: 115
|
Hi,
I am getting the error while running my java program.]
my classpath is :
C:\Program Files\IBM\MQSeries\Java\lib\com.ibm.mq.jar;
C:\Program Files\IBM\MQSeries\Java\lib\com.ibm.mqjms.jar;
C:\Program Files\IBM\MQSeries\Java\lib\connector.jar;
C:\Program Files\IBM\MQSeries\Java\lib\fscontext.jar;
C:\Program Files\IBM\MQSeries\Java\lib\jms.jar;
C:\Program Files\IBM\MQSeries\Java\lib\jndi.jar;
C:\Program Files\IBM\MQSeries\Java\lib\jta.jar;
C:\Program Files\IBM\MQSeries\Java\lib\ldap.jar;
C:\Program Files\IBM\MQSeries\Java\lib\providerutil.jar;
C:\Program Files\IBM\Java14\lib;.;
Any suggestion please........
Regards
Nik |
|
Back to top |
|
 |
mvic |
Posted: Mon Mar 27, 2006 2:24 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
nik_iway wrote: |
Unable to load message catalog - mqji
com.ibm.mq.MQException: Message catalog not found |
From this, it looks as though an important MQ file is missing or inaccessible for some reason. Have any MQ files been deleted or had their permissions changed? |
|
Back to top |
|
 |
nik_iway |
Posted: Mon Mar 27, 2006 2:44 am Post subject: |
|
|
Centurion
Joined: 21 Jul 2005 Posts: 115
|
hi mvic,
No MQ files were Deleted. I downloaded MA88 fix pack from the net to write the java API program.
Any suggestions ???????//
Nik |
|
Back to top |
|
 |
mvic |
Posted: Mon Mar 27, 2006 2:55 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
nik_iway wrote: |
Any suggestions ??????? |
I don't have much experience with MA88. From memory this applies only to MQ v5.2, which is long out of support. If you install MQ v5.3 or v6, you'll have all the JAR files needed without having to install a separate SupportPac. |
|
Back to top |
|
 |
wschutz |
Posted: Mon Mar 27, 2006 3:11 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
The missing class javax/resource/ResourceException is in connector.jar:
Quote: |
[wschutz@wschutz lib]$ unzip -l connector.jar | grep resource
0 08-16-01 11:47 javax/resource/
962 08-16-01 11:47 javax/resource/ResourceException.class
209 08-16-01 11:47 javax/resource/Referenceable.class
0 08-16-01 11:47 javax/resource/spi/
...
|
As mvic says, you should NOT be using MA88, ensure that is completely uninstalled and ensure that you installed the java classes from the MQ CD iteslf. _________________ -wayne |
|
Back to top |
|
 |
|