Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Standalone JMS client for WAS 6.1

17 views
Skip to first unread message

joj...@hotmail.com

unread,
Nov 17, 2006, 10:17:13 AM11/17/06
to

Hi All,

I am in the process of using the default JMS of WAS 6.1 rather than MQ.

I have setup the connection factory and downloaded the sibc_install-o0635.08.jar and did the steps mentioned at the following url http://www-1.ibm.com/support/docview.wss?uid=swg24012804

I use sun JDK 1.5

But I am getting some corba exception

Here is the code I am using for connection in my client

Context ctx = null;
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
p.put(Context.PROVIDER_URL, "iiop://smage:2809");
p.put("java.naming.security.principal", "webjms" );
p.put("java.naming.security.credentials", "webjms" );
p.put("java.naming.corba.orb",org.omg.CORBA.ORB.init());

Caused by: java.lang.ClassCastException
at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:85)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:174)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:97)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:73)
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:386)
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:305)
.. 36 more

I have added all the three jars sibc.orb.jar,sibc.orb.jar,sibc.jms.jar in classpath of my client app.
I am also getting a naming not found exception.

Can some one please tell me what all jars are required for making a standalone JMS client for WAS 6.1 and the steps to do it

Regards
George S

Tom Weissinger

unread,
Nov 18, 2006, 9:50:00 AM11/18/06
to
The only way I figured out how to do this (that does seem like a complete
hack) is by using a WAS Application Client.

<joj...@hotmail.com> wrote in message
news:604849786.1163776671...@ltsgwas010.sby.ibm.com...

Paul Ilechko

unread,
Nov 18, 2006, 3:39:21 PM11/18/06
to
joj...@hotmail.com wrote:
> Hi All,
>
> I am in the process of using the default JMS of WAS 6.1 rather than MQ.
>
> I have setup the connection factory and downloaded the sibc_install-o0635.08.jar and did the steps mentioned at the following url http://www-1.ibm.com/support/docview.wss?uid=swg24012804
>
> I use sun JDK 1.5
>
> But I am getting some corba exception

> I have added all the three jars sibc.orb.jar,sibc.orb.jar,sibc.jms.jar in classpath of my client app.


> I am also getting a naming not found exception.
>
> Can some one please tell me what all jars are required for making a standalone JMS client for WAS 6.1 and the steps to do it

Did you use the "jms_jndi_sun" install option ?

joj...@hotmail.com

unread,
Nov 19, 2006, 3:42:12 AM11/19/06
to
Yes i have used that only and got three jars

sibc.jndi.jar, sibc.orb.jar and sibc.jms.jar in the lib folder

I get a Naming not found exception

Here is the code and stack trace


Context ctx = null;
Properties p = new Properties();

p.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
p.put(Context.PROVIDER_URL, "iiop://seb-xp:2809");
p.put("java.naming.security.principal", "webuser" );
p.put("java.naming.security.credentials", "webuser" );
//p.put("java.naming.corba.orb",org.omg.CORBA.ORB.init());
//p.put("com.ibm.CORBA.ORBInit",com.ibm.ws.sib.client.ORB.class);
//p.put("java.naming.corba.orb",com.ibm.ws.sib.client.ORB.getORB ());


try {
ctx = new InitialContext(p);


if (null != ctx)
System.out.println("GOT Naming context");

TopicConnectionFactory topicConnectionFactory = (TopicConnectionFactory) ctx
lookup("MY_TOPIC_CONNECTIONFACTORY"); //$NON-NLS-1$


javax.naming.NameNotFoundException: Context: kalau01-xpNode01Cell/nodes/seb-xpNode01/servers/server1, name: jms/MY_TOPIC_CONNECTIONFACTORY: First component in name MY_TOPIC_CONNECTIONFACTORY not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]

at com.ibm.ws.naming.jndicos.CNContextImpl.processNotFoundException(CNContextImpl.java:4392)

at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1752)

at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1707)

at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1412)

at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1290)

at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:145)

at javax.naming.InitialContext.lookup(InitialContext.java:351)

at jms.samples.Publisher.main(Publisher.java:88)

Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0

at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)

at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(Unknown Source)

at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:4043)

at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1746)

... 6 more


Paul Ilechko

unread,
Nov 19, 2006, 9:30:32 AM11/19/06
to
joj...@hotmail.com wrote:
> Yes i have used that only and got three jars
>
> sibc.jndi.jar, sibc.orb.jar and sibc.jms.jar in the lib folder
>
> I get a Naming not found exception
>
> Here is the code and stack trace
> Context ctx = null;
> Properties p = new Properties();
>
> p.put(Context.INITIAL_CONTEXT_FACTORY,
> "com.ibm.websphere.naming.WsnInitialContextFactory");
> p.put(Context.PROVIDER_URL, "iiop://seb-xp:2809");
> p.put("java.naming.security.principal", "webuser" );
> p.put("java.naming.security.credentials", "webuser" );
> //p.put("java.naming.corba.orb",org.omg.CORBA.ORB.init());
> //p.put("com.ibm.CORBA.ORBInit",com.ibm.ws.sib.client.ORB.class);
> //p.put("java.naming.corba.orb",com.ibm.ws.sib.client.ORB.getORB ());
>

Did you try using the corbaloc format of the provider URL?

env.put(Context.PROVIDER_URL, "corbaloc:iiop:myhost.mycompany.com:2809");

joj...@hotmail.com

unread,
Nov 20, 2006, 3:29:47 AM11/20/06
to
Hi

I have tried with with corbaloc... and advanced a bit further.
Now if I do a Context.lookup("Connection Factory Name") instead of connection factory instance (expected one) I am getting javax.naming.Reference instance.

Any clues on this

Regards
George S

Paul Ilechko

unread,
Nov 20, 2006, 8:00:30 AM11/20/06
to
joj...@hotmail.com wrote:
> Hi
>
> I have tried with with corbaloc... and advanced a bit further. Now if
> I do a Context.lookup("Connection Factory Name") instead of
> connection factory instance (expected one) I am getting
> javax.naming.Reference instance.
>

That sounds right to me - you are getting an initial context from JNDI.

You need to use that initial context to lookup your JMS objects. See here:

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/tmj_devcl.html

joj...@hotmail.com

unread,
Nov 20, 2006, 10:07:30 AM11/20/06
to
Hi Paul,

I am afraid I am taking you to the wrong direction.
Let me explain it again.

Now I am able to connect.

After that I use the InitialContext object to do a lookup

InitailContext ctxt = //initialized
.
.
.

Now TopicConnectionFactory factory = ctxt.lookup("Fact_NAME");

Here I expect the lookup to give me an instance of TopicConnectionFactory but I get a class cast exception.

When I investigated in detail I found that the ctxt.lookup("Fact_NAME"); is giving me an instance of javax.naming.Reference instead of TopicConnectionFactory

I am unable to identify the cause of this

Please help
Regards
George S


David Currie

unread,
Nov 21, 2006, 7:26:11 AM11/21/06
to
If JNDI can't find the appropriate classes (e.g. the ObjectFactory) to
fluff up the reference in to an object then it just returns the
reference i.e. this indicates that there is a problem with the contents
of your classpath.

Regards,
David

joj...@hotmail.com

unread,
Nov 21, 2006, 11:22:33 AM11/21/06
to
Hi David,

Thanks a lot for your reply

I have added sibc.jndi.jar, sibc.orb.jar and sibc.jms.jar in the lib of the extracted client jar to the classpath.

Is there any other classes which is required to be added to classpath to get TopicFactory instance

Is there any specific property to be set before I create an InitialContext Object
for connecting to WAS I have added the normal properties as mentioned in my previous post in the same thread.

Regards
George S

David Currie

unread,
Nov 22, 2006, 4:48:29 AM11/22/06
to
That should suffice and the fact that you are getting a reference back
at all would tend to suggest that you have successfully connected to the
JNDI namespace. If you call getClassName() on the Reference what does it
think it's a reference to?

Regards,
David

joj...@hotmail.com

unread,
Nov 22, 2006, 8:38:03 AM11/22/06
to
Hi David

I have added three more jars to classpath

com.ibm.ws.runtime_6.1.0.jar,
com.ibm.mqjms.jar
com.ibm.mq.jar

I have been able to advance a bit further.

Now I could create an instance of TopicConnectionFactory

After that when I try to create a TopicConnection I get the following error

Exception in thread "main" java.lang.NoClassDefFoundError: javax/resource/spi/ApplicationServerInternalException
at com.ibm.mq.jms.MQConnection.<init>(MQConnection.java:336)
at com.ibm.mq.jms.MQTopicConnection.<init>(MQTopicConnection.java:103)
at com.ibm.mq.jms.MQTopicConnectionFactory.createMQTopicConnection(MQTopicConnectionFactory.java:378)
at com.ibm.mq.jms.MQTopicConnectionFactory.createMQTopicConnection(MQTopicConnectionFactory.java:309)
at com.ibm.mq.jms.MQTopicConnectionFactory.createTopicConnection(MQTopicConnectionFactory.java:198)
at jms.samples.Publisher.main(Publisher.java:58)

Any idea why this happens
Regards
George S

Paul Ilechko

unread,
Nov 22, 2006, 9:50:22 AM11/22/06
to

I thought you were using SI Bus, not MQ ?

joj...@hotmail.com

unread,
Nov 22, 2006, 11:34:51 AM11/22/06
to
Hi Paul,

I tried using SI Bus initially and was totally lost and then I posted in developerworks.

Later I tried creating a TopicConnectionFactory in V5 default JMS provider rather than the default JMS provider.

By doing in that fashion I have been able to get away with Naming not found issue.

Since I advanced a bit in that then I thought of using the same for my purpose.
I wanted to use SI Bus only but couldn't get through.

I did not want to create a separate ApplicationClient instead I wanted to access the JMS by using simple Java application.

It would be great if some one can help me in getting some more information on configuring default JMS provider using SI Bus for TopicConnection

Regards
george S

David Currie

unread,
Nov 23, 2006, 4:49:07 AM11/23/06
to
Trying to use the v5 default messaging provider is not going to prove
very productive if you're not running a server migrated from Version 5
of the Application Server. Go back to configuring a
TopicConnectionFactory on the v6 default messaging provider, do the
lookup and then tell us what you get back.

Regards,
David

joj...@hotmail.com

unread,
Nov 27, 2006, 4:26:47 AM11/27/06
to
Hi

I have started using v6 messaging using SI Bus
Now I get the following error after look up and try to create a topic connection

Example configuration failed :CWSIA0241E: An exception was received during the call to the method JmsManagedConnectionFactoryImpl.createConnection: com.ibm.websphere.sib.exception.SIResourceException: CWSIT0006E: It is not possible to connect to bus MyBus because the following bootstrap servers could not be contacted [localhost:7276:BootstrapBasicMessaging] and the following bootstrap servers returned an error condition []. See previous messages for the reason for each bootstrap server failure..
javax.jms.JMSException: CWSIA0241E: An exception was received during the call to the method JmsManagedConnectionFactoryImpl.createConnection: com.ibm.websphere.sib.exception.SIResourceException: CWSIT0006E: It is not possible to connect to bus ECMIB because the following bootstrap servers could not be contacted [localhost:7276:BootstrapBasicMessaging] and the following bootstrap servers returned an error condition []. See previous messages for the reason for each bootstrap server failure..
at com.ibm.ws.sib.api.jms.impl.JmsManagedConnectionFactoryImpl.createConnection(JmsManagedConnectionFactoryImpl.java:240)
at com.ibm.ws.sib.api.jms.impl.JmsTopicConnectionFactoryImpl.createTopicConnection(JmsTopicConnectionFactoryImpl.java:152)
at com.ibm.ws.sib.api.jms.impl.JmsTopicConnectionFactoryImpl.createTopicConnection(JmsTopicConnectionFactoryImpl.java:116)
at jms.samples.Publisher.main(Publisher.java:58)
Caused by: com.ibm.websphere.sib.exception.SIResourceException: CWSIT0006E: It is not possible to connect to bus MyBus because the following bootstrap servers could not be contacted [localhost:7276:BootstrapBasicMessaging] and the following bootstrap servers returned an error condition []. See previous messages for the reason for each bootstrap server failure.
at com.ibm.ws.sib.trm.client.TrmSICoreConnectionFactoryImpl2.bootstrapRequest(TrmSICoreConnectionFactoryImpl2.java:607)
at com.ibm.ws.sib.trm.client.TrmSICoreConnectionFactoryImpl2.remoteBootstrap(TrmSICoreConnectionFactoryImpl2.java:404)
at com.ibm.ws.sib.trm.client.TrmSICoreConnectionFactoryImpl2.createConnection(TrmSICoreConnectionFactoryImpl2.java:239)
at com.ibm.ws.sib.trm.client.TrmSICoreConnectionFactoryImpl2.createConnection(TrmSICoreConnectionFactoryImpl2.java:144)
at com.ibm.ws.sib.api.jmsra.impl.JmsJcaConnectionFactoryImpl.createCoreConnection(JmsJcaConnectionFactoryImpl.java:545)
at com.ibm.ws.sib.api.jmsra.impl.JmsJcaConnectionFactoryImpl.createCoreConnection(JmsJcaConnectionFactoryImpl.java:481)
at com.ibm.ws.sib.api.jmsra.impl.JmsJcaConnectionFactoryImpl.createConnection(JmsJcaConnectionFactoryImpl.java:302)
at com.ibm.ws.sib.api.jms.impl.JmsManagedConnectionFactoryImpl.createConnection(JmsManagedConnectionFactoryImpl.java:206)
... 3 more

Any insights on this

Regards
George S

Stephen Cocks

unread,
Nov 27, 2006, 6:02:47 AM11/27/06
to
In the TopicConnectionFactory (and other connection factories) for the
default provider there is a "provider endpoints" attribute which by default
has the value "localhost:7276:BootstrapBasicMessaging".

When the factory is used in a client context (or in a server context outside
the bus' cell), this information is used to connect the client to a server
offering a SI Bus service as a bootstrap mechanism. The default value will
work if the client is running on the same box as a server whose sib service
is offered on the default sib inbound address (i.e. localhost and port
7276). If these conditions are not met you'll have to enter a different
provider endpoint setting in the connection factory.

To offer a sib bootstrap service the target server must be a member of a bus
(or have had its sib service explicitly enabled).

If you think the error message is incorrect and that the necessary
conditions are met, then we'd have to look at a trace of the underlying
connection attempt to see if that was informative.
--
Stephen Cocks
WESB/WPS System Administration

<joj...@hotmail.com> wrote in message
news:744572606.1164619654...@ltsgwas010.sby.ibm.com...

bkrish...@gmail.com

unread,
Nov 28, 2006, 4:01:27 AM11/28/06
to
Hi George,

When we encountered the same exception, we used a JMS client to resolve
this problem. You can find the same from the following location:

http://www.alphaworks.ibm.com/tech/jmsclient

Hope this helps.

Regards,
-Krishna Menon B.
NCR / Teradata, Hyderabad.

joj...@hotmail.com

unread,
Nov 28, 2006, 5:00:28 AM11/28/06
to
Hi Stephen,

My environment is like this

I have WAS 6.1 set up on m/c geotest1

I have created a SI Bus by name MyBus I have created a Topic Connection factory MY_TCF in the same bus have the following configuration for bus and TCF

Bus Details

Name = MyBus
Configuration reload enabled =enabled

In Bus members I Have
Name= geotest1Node01:server1
Type = Server
It has a message engine and is in started state


Topic Connection Factory details

Name =MY_QCF
JNDI Name = MY_QCF
Provider = Default messaging provider
Scope =Node=geotest1Node01,Server=server1

Bus Name = MyBus

Target significance =Preferred

Target inbound transport chain =<blank>
Provider endpoints 155.35.36.173:7276:BootstrapBasicMessaging (Ip address of geotest1)

Connection proximity =Bus

Client identifier =<blank>


Every thing else is default.

Now I try to create a TopicConnection from another machine geodev1

In this machine I have only the client jars
sibc.orb, sibc.jms and sibc.jndi

After doing all this and when I run my client program I get the following exception

Can you please guide me in which direction shall I proceed

GOT Naming context

javax.jms.JMSException: CWSIA0241E: An exception was received during the call to the method JmsManagedConnectionFactoryImpl.createConnection: com.ibm.websphere.sib.exception.SIResourceException: CWSIT0006E: It is not possible to connect to bus MyBus because the following bootstrap servers could not be contacted [] and the following bootstrap servers returned an error condition [155.35.36.173:7276:BootstrapBasicMessaging]. See previous messages for the reason for each bootstrap server failure..


at com.ibm.ws.sib.api.jms.impl.JmsManagedConnectionFactoryImpl.createConnection(JmsManagedConnectionFactoryImpl.java:240)
at com.ibm.ws.sib.api.jms.impl.JmsTopicConnectionFactoryImpl.createTopicConnection(JmsTopicConnectionFactoryImpl.java:152)

at jms.samples.Publisher.main(Publisher.java:57)
Caused by: com.ibm.websphere.sib.exception.SIResourceException: CWSIT0006E: It is not possible to connect to bus MyBus because the following bootstrap servers could not be contacted [] and the following bootstrap servers returned an error condition [155.35.36.173:7276:BootstrapBasicMessaging]. See previous messages for the reason for each bootstrap server failure.


at com.ibm.ws.sib.trm.client.TrmSICoreConnectionFactoryImpl2.bootstrapRequest(TrmSICoreConnectionFactoryImpl2.java:607)
at com.ibm.ws.sib.trm.client.TrmSICoreConnectionFactoryImpl2.remoteBootstrap(TrmSICoreConnectionFactoryImpl2.java:404)
at com.ibm.ws.sib.trm.client.TrmSICoreConnectionFactoryImpl2.createConnection(TrmSICoreConnectionFactoryImpl2.java:239)
at com.ibm.ws.sib.trm.client.TrmSICoreConnectionFactoryImpl2.createConnection(TrmSICoreConnectionFactoryImpl2.java:144)
at com.ibm.ws.sib.api.jmsra.impl.JmsJcaConnectionFactoryImpl.createCoreConnection(JmsJcaConnectionFactoryImpl.java:545)

at com.ibm.ws.sib.api.jmsra.impl.JmsJcaConnectionFactoryImpl.createConnection(JmsJcaConnectionFactoryImpl.java:440)
at com.ibm.ws.sib.api.jms.impl.JmsManagedConnectionFactoryImpl.createConnection(JmsManagedConnectionFactoryImpl.java:209)
... 2 more


Regards
George S

nlalit...@yahoo.com

unread,
Apr 3, 2007, 5:49:19 AM4/3/07
to
Hi George,

We are getting the same problem , could you please share your resolution of the issue.

navnith...@satyam.com

unread,
May 8, 2007, 12:52:03 AM5/8/07
to
Hi Stephen,

Answer looks like pretty much a solution.
>..conditions are not met you'll have to enter a different

>provider endpoint setting in the connection factory.
>To offer a sib bootstrap service the target server must be a member of a bus
>(or have had its sib service explicitly enabled).

I am pretty new to JMS and things, We all would love if you could tell us how to actually do it. Its a little obscure.


TIA

cheers...

Ben_

unread,
May 8, 2007, 2:22:58 AM5/8/07
to
> javax.jms.JMSException: CWSIA0241E: An exception was received during the
> call to the method JmsManagedConnectionFactoryImpl.createConnection:
> com.ibm.websphere.sib.exception.SIResourceException: CWSIT0006E: It is not
> possible to connect to bus MyBus because the following bootstrap servers
> could not be contacted [] and the following bootstrap servers returned an
> error condition [155.35.36.173:7276:BootstrapBasicMessaging]. See previous
> messages for the reason for each bootstrap server failure..

Did you check the following ?

http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg21195691
http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg21211800
http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg21199330

Stephen Cocks

unread,
May 8, 2007, 7:01:27 AM5/8/07
to
Set the provider endpoints property on the connection factory object
whereever this is defined.

If you are using the admin console to create the connection factory then
type in the correct value for the provider endpoints in the relevant field.
If you are using a Jacl or Jython script (wsadmin) to create the connection
factory, then use the "-providerEndPoints" option of the
createSIBJMSConnectionFactory command.

The value you will set will look something like
"otherhost:7276:BootstrapBasicMessaging" although to avoid a single point of
failure you can specify multiple such values separated by commas. There must
be an application server at "otherhost:7276" which is a member of the bus
you are trying to connect to. The port number will be whatever is shown as
the "SIB_ENDPOINT_ADDRESS" port in the server's port list (7276 is the
default). If the bus is enabled for security then you'll need to use
BootstrapSecureMessaging and the port SIB_ENDPOINT_SECURE_ADDRESS.

If you're using a wsadmin script but not using the
createSIBJMSConnectionFactory command, or need more help, post back here
with the full details of how you currently define the connection factory.

PS. Which client environment are you using? The original posting here
related to the Client for JMS on J2SE with WebSphere Application Server
which is a downloadable option.

--
Stephen Cocks
WESB/WPS System Administration

<navnith...@satyam.com> wrote in message
news:915662698.1178599955...@ltsgwas009.sby.ibm.com...

0 new messages