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

JMS Client J2SE and WAS 6.02- port problem

27 views
Skip to first unread message

goldham...@de.ibm.com

unread,
Nov 29, 2007, 3:22:28 AM11/29/07
to
Hello,<br />
<br />
I want to connect to the JMS Server on WAS 6.02 with a standalone jms-client. I have seen that I need specific jars to get it working, so I have considered the instructions in http://www-1.ibm.com/support/docview.wss?uid=swg21195691 (IBM Client for JMS on J2SE with IBM WebSphere Application Server)<br />
<br />
I am using following lines of code to get it working:<br />
<br />
Hashtable env = new Hashtable();<br />
env.put(Context.INITIAL_CONTEXT_FACTORY,<br />
"com.ibm.websphere.naming.WsnInitialContextFactory");<br />
env.put(Context.PROVIDER_URL, "iiop://localhost:2810");<br />
Context c = new InitialContext(env);<br />
ConnectionFactory factory = (ConnectionFactory) c<br />
.lookup("jms/JMSCustomBindingFactory");<br />
Destination destination = (Destination) c<br />
.lookup("jms/JMSCustomBinding_Export_Receive_Q");<br />
// Create the connection and session<br />
Connection connection = factory.createConnection(); // HERE I AM GETTING THE ERROR<br />
Session session = connection.createSession(false,<br />
Session.AUTO_ACKNOWLEDGE);<br />
<br />
// Use the session and destination to create the producer<br />
MessageProducer producer = session.createProducer(destination);<br />
<br />
I am getting following error:<br />
<br />
Exception in thread "P=729787:O=0:CT" 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 SCA.APPLICATION.esbCell.Bus because the following bootstrap servers could not be contacted <a href="http://www-128.ibm.com/developerworks/forums/">localhost:7276:BootstrapBasicMessaging] and the following bootstrap servers returned an error condition [</a>. See previous messages for the reason for each bootstrap server failure..<br />
at com.ibm.ws.sib.api.jms.impl.JmsManagedConnectionFactoryImpl.createConnection(JmsManagedConnectionFactoryImpl.java:240)<br />
at com.ibm.ws.sib.api.jms.impl.JmsManagedConnectionFactoryImpl.createConnection(JmsManagedConnectionFactoryImpl.java:159)<br />
at com.ibm.de.jms.SessionClient.lookupSessionAddBean(SessionClient.java:103)<br />
at com.ibm.de.jms.SessionClient.main(SessionClient.java:61)<br />
Caused by: com.ibm.websphere.sib.exception.SIResourceException: CWSIT0006E: It is not possible to connect to bus SCA.APPLICATION.esbCell.Bus because the following bootstrap servers could not be contacted <a href="http://www-128.ibm.com/developerworks/forums/">localhost:7276:BootstrapBasicMessaging] and the following bootstrap servers returned an error condition [</a>. See previous messages for the reason for each bootstrap server failure.<br />
at com.ibm.ws.sib.trm.client.TrmSICoreConnectionFactoryImpl2.bootstrapRequest(TrmSICoreConnectionFactoryImpl2.java:607)<br />
at com.ibm.ws.sib.trm.client.TrmSICoreConnectionFactoryImpl2.remoteBootstrap(TrmSICoreConnectionFactoryImpl2.java:404)<br />
at com.ibm.ws.sib.trm.client.TrmSICoreConnectionFactoryImpl2.createConnection(TrmSICoreConnectionFactoryImpl2.java:239)<br />
at com.ibm.ws.sib.trm.client.TrmSICoreConnectionFactoryImpl2.createConnection(TrmSICoreConnectionFactoryImpl2.java:144)<br />
at com.ibm.ws.sib.api.jmsra.impl.JmsJcaConnectionFactoryImpl.createCoreConnection(JmsJcaConnectionFactoryImpl.java:545)<br />
at com.ibm.ws.sib.api.jmsra.impl.JmsJcaConnectionFactoryImpl.createCoreConnection(JmsJcaConnectionFactoryImpl.java:481)<br />
at com.ibm.ws.sib.api.jmsra.impl.JmsJcaConnectionFactoryImpl.createConnection(JmsJcaConnectionFactoryImpl.java:302)<br />
at com.ibm.ws.sib.api.jms.impl.JmsManagedConnectionFactoryImpl.createConnection(JmsManagedConnectionFactoryImpl.java:206)<br />
... 3 more<br />
<br />
I have seen that the error is listed in<br />
http://www-1.ibm.com/support/docview.wss?uid=swg21195691<br />
<br />
I have checked the resources.xml and see that the ports are not equal to my one. On Port 7276 does nobody listen, only on port 7277.<br />
netstat -an|find "7276" -&gt; nothing<br />
netstat -an|find "7277" -&gt; listening port<br />
<br />
I have created two profiles, so I think the port difference is caused by the second profile.<br />
<br />
My question is now:<br />
1. How can I change the port in the client?<br />
2. If I would change the port to the needed port, the other profile cannot work correctly, right?<br />
<br />
Thanks for your help.<br />
Regards,<br />
Jens

goldham...@de.ibm.com

unread,
Nov 29, 2007, 3:47:30 AM11/29/07
to
It works now.<br />
I have changed the SIB_ENDPOINT_ADDRESS in the server settings (admin console) and restarted the server.<br />
Now I can create a connection.<br />
<br />
BUT:<br />
I think it is a big problem that you cannot specify outside of jms on which service bus port you will connect.<br />
Or does anybody have an idea??<br />
<br />
Thanks in advance.<br />
Regards,<br />
Jens

Martin Phillips

unread,
Nov 29, 2007, 4:42:25 AM11/29/07
to
You can specify the port that your JMS Client will bootstrap to in the
ConnectionFactory property called Provider Endpoints. See the infocenter
article linked below

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.pmc.nd.doc/tasks/tjn0033_.html


--

Martin Phillips
mphillip at uk.ibm.com


<goldham...@de.ibm.com> wrote in message
news:1028931684.119632608...@ltsgwas010.sby.ibm.com...

goldham...@de.ibm.com

unread,
Nov 29, 2007, 6:20:06 AM11/29/07
to
Hello Martin,<br />
<br />
thanks for your reply. It works not for me. The problem is that it is not documented very well. How is the correct property-name for ProviderEndpoints (like the one I have?)?<br />

<br />
Hashtable env = new Hashtable();<br />
env.put(Context.INITIAL_CONTEXT_FACTORY,<br />
"com.ibm.websphere.naming.WsnInitialContextFactory");<br />
env.put(Context.PROVIDER_URL, "iiop://localhost:2810");<br />
env.put("ProviderEndpoints", "localhost:7277");<br />

Context c = new InitialContext(env);<br />
<br />
I have changed the port back to 7277 in the server settings. While creating a connection the following error occured:<br />
<br />
Exception in thread "P=769141:O=0:CT" 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 SCA.APPLICATION.esbCell.Bus because the following bootstrap servers could not be contacted <a href="http://www-128.ibm.com/developerworks/forums/">localhost:7276:BootstrapBasicMessaging] and the following bootstrap servers returned an error condition [</a>. See previous messages for the reason for each bootstrap server failure..<br />
<br />
In my eyes, JMS wants to connect to the default SI-BUS, so the property is not set correctly, or?<br />
<br />
I have seen following topics:<br />
http://www-1.ibm.com/support/docview.wss?uid=swg21211800<br />
<br />
Maybe I am running the wrong versions?<br />
<br />
Server - TestEnvironment of WID v6.021, WebSphere Platform 6.0 <a class="jive-link-external" href="http://ND 6.0.2.17 cf170648.10">http://ND 6.0.2.17 cf170648.10</a> <a class="jive-link-external" href="http://WBI 6.0.2.0 o0648.28">http://WBI 6.0.2.0 o0648.28</a> <br />
Client - extracted from the client, delivered with original WAS 6.0 (Package C587VML from XL Software Downloads)<br />
<br />
However, the communication works if I manual change the server settings...<br />
<br />
Any idea??<br />
<br />
Jens Goldhammer

Stephen Cocks

unread,
Nov 29, 2007, 8:20:23 AM11/29/07
to
It is not a property of the JNDI Initial Context.
The property must be set (by the administrator) on the Connection Factory
itself (e.g. via the console).

--
Stephen Cocks
WESB/WPS System Administration

<goldham...@de.ibm.com> wrote in message
news:190169492.1196335237...@ltsgwas010.sby.ibm.com...

0 new messages