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 » Documentation on MQ Java API

Post new topic  Reply to topic
 Documentation on MQ Java API « View previous topic :: View next topic » 
Author Message
dmholmes
PostPosted: Fri Jun 25, 2004 1:15 pm    Post subject: Documentation on MQ Java API Reply with quote

Newbie

Joined: 25 Jun 2004
Posts: 4

I'm starting to use MQ via Java API from examples I found. Basic put and retrieve messages. I've looked around on the IBM site and cannot find a basic reference to use MQ in Java. Does anyone have a link or good book to refer? Also I spent alot of time trying to connect to MQ using JMS before discovering that you have to use IBM's JDK/JVM. Is there any other way to use JMS with MQ and non-IBM JVM?

Thank you,
David
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Jun 25, 2004 1:30 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The manual you want is available from http://www-306.ibm.com/software/integration/mqfamily/library/manualsa/, and is called "Using Java". You can also get there by clicking the "Documentation" button at the top of the page.

You do not, to the best of my knowledge, have to use IBM's JDK or JVM in order to use the Java or JMS APIs. In fact, I've successfully run the Java client on Apple's JDK.

You may, however, have to use a JDK at the correct release level - and some software vendors may not supply a JDK that is at the correct level. But Sun's should always work - if there is one for your platform.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
dmholmes
PostPosted: Fri Jun 25, 2004 2:00 pm    Post subject: Reply with quote

Newbie

Joined: 25 Jun 2004
Posts: 4

Thanks for the help. Straight Java API is working fine. But I was using a test class that I've been using to use JMS against WebLogic and JBoss, but trying to use it with MQ is not working. I tracked down jar files from MQ and WebSphere for a couple of hours because when you plugin com.ibm.websphere.naming.WsnInitialContextFactory for the JNDI factory I get NoClassDefFoundErrors. I read on another site the IBM's JDK is required which I believe to be true because of the classes that are being looked for. There was some mention of a wrapper to go around whatever JVM you are using to make it work, but I never found it. I gave up on this last exception:
Exception in thread "main" javax.naming.NamingException: Failed to initialize the ORB [Root exception is org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation com.ibm.CORBA.iiop.ORB vmcid: 0x0 minor code: 0 completed: No]
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:293)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:365)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:102)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:408)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:131)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at QueueSend.init(QueueSend.java:51)
at QueueSend.main(QueueSend.java:92)
Caused by: org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation com.ibm.CORBA.iiop.ORB vmcid: 0x0 minor code: 0 completed: No
at org.omg.CORBA.ORB.create_impl(ORB.java:297)
at org.omg.CORBA.ORB.init(ORB.java:336)
at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:77)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:174)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:9
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:74)
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:386)
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:284)
... 7 more
Caused by: java.lang.NoClassDefFoundError: com/ibm/jvm/ExtendedSystem
at com.ibm.rmi.util.JDKBridge.setCodebaseProperties(JDKBridge.java:226)
at com.ibm.rmi.util.JDKBridge.<clinit>(JDKBridge.java:205)
at com.ibm.rmi.util.RepositoryId.<clinit>(RepositoryId.java:122)
at com.ibm.rmi.iiop.CDROutputStream.<clinit>(CDROutputStream.java:1077)
at com.ibm.rmi.corba.ORB.<init>(ORB.java:250)
at com.ibm.rmi.iiop.ORB.<init>(ORB.java:166)
at com.ibm.CORBA.iiop.ORB.<init>(ORB.java:521)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at org.omg.CORBA.ORB.create_impl(ORB.java:295)
... 14 more

The jar file with this class, ibmorb.jar, is in my classpath. My JVM is 1.4.2_03 running on Apple OS X.

David
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jun 25, 2004 4:57 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

dm
You are partially right!. To get the JMS setup with the class you specified
Quote:
com.ibm.websphere.naming.WsnInitialContextFactory
you need to connect to Websphere Application Server as this initial factory will allow you to get the information from WAS.
And yes this is an IBM product so you will need an IBM JVM to run WAS correctly...
Try the file implementation. Create the entries with JMSAdmin. Then use with javax.naming. Should give you no problem and you will only need Sun jvm.

Hope it helps.
Back to top
View user's profile Send private message Send e-mail
dmholmes
PostPosted: Fri Jun 25, 2004 8:13 pm    Post subject: Reply with quote

Newbie

Joined: 25 Jun 2004
Posts: 4

Thanks, I'll give it a try. The other two message servers (WebLogic and JBoss) are coupled with their JNDI, so MQ without the application server would be different. Too busy trying stuff to realize that.
Back to top
View user's profile Send private message
dmholmes
PostPosted: Mon Jun 28, 2004 7:06 am    Post subject: Reply with quote

Newbie

Joined: 25 Jun 2004
Posts: 4

Are there any javadocs for the MQ API? All I can find are PDF.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Jun 28, 2004 7:13 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

dmholmes wrote:
Are there any javadocs for the MQ API? All I can find are PDF.


Nope.
_________________
I am *not* the model of the modern major general.
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 » Documentation on MQ Java API
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.