Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!

Sudhesh Rajan

Greenhorn
+ Follow
since Nov 24, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sudhesh Rajan

Yeah, i already imported
1. com.ibm.mq.jar
2. com.ibm.mqbind.jar
3. com.ibm.mqjms.jar

Thanks,
Sudhesh
17 years ago
Hi, I am trying to run a simple point-to-point JMS program. I configured a server with a queue and queueconnectionfactory and trying to run the java program as a WebSphere 5 Application client program. I picked the "MQ Simulator for Java" for JMS provider while configuring the server.

here are the first 4 statements in my program:
final InitialContext context = new InitialContext();

// Lookup the queue connection factory from the
// initial context.
final QueueConnectionFactory qcf = (QueueConnectionFactory) context.lookup("HelloWorldQCF");

// Create a new queue connection from the queue
// connection factory.
final QueueConnection conn = qcf.createQueueConnection();
// Start the connection

conn.start();

When I run, the program is failing at 3rd statement ie while getting the QueueConnection. Here is the error message:

com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2012
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:246)
at com.ibm.mq.MQJDManagedConnectionFactoryJ11._createManagedConnection(MQJDManagedConnectionFactoryJ11.java:128)
at com.ibm.mq.MQJDManagedConnectionFactoryJ11.createManagedConnection(MQJDManagedConnectionFactoryJ11.java:146)
at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:80)
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:171)
at com.ibm.mq.MQQueueManager.obtainBaseMQQueueManager(MQQueueManager.java:737)
at com.ibm.mq.MQQueueManager.construct(MQQueueManager.java:671)
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:452)
at com.ibm.mq.MQSPIQueueManager.<init>(MQSPIQueueManager.java:52)
at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:1659)
at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1129)
at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:170)
at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:80)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:145)
at PointToPoint.<init>(PointToPoint.java:31)
at PointToPoint.main(PointToPoint.java:89)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.websphere.client.applicationclient.launchClient.createContainerAndLaunchApp(launchClient.java:616)
at com.ibm.websphere.client.applicationclient.launchClient.main(launchClient.java:420)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'WAS_localhost_server1'
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:556)
at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:1736)
at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1129)
at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:170)
at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:80)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:145)
at PointToPoint.<init>(PointToPoint.java:31)
at PointToPoint.main(PointToPoint.java:89)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.websphere.client.applicationclient.launchClient.createContainerAndLaunchApp(launchClient.java:616)
at com.ibm.websphere.client.applicationclient.launchClient.main(launchClient.java:420)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
------------------------------------------------------------

Any help is greatly appreciated.
17 years ago
Hi Kaustubh,

When the second parameter, byte array, of the setBytes is Null,
the java.lang.NullPointerException is thrown from the Connection
Manager code. Excerpt of the exception stack trace:
11/10/03 20:33:37:991 CST] 73510c8e ExceptionUtil E CNTR0020E:
Non-application exception occurred while processing method
"importOrganization" on bean
"BeanId(IBM_WBI_Monitor#monitorserver.jar#ClientAgent, null)".
Exception data: java.lang.NullPointerException
at
com.ibm.ejs.cm.proxy.OraclePreparedStatementProxy.setBytes(Ora
clePreparedStatementProxy.java:39)
at
com.holosofx.monitor.server.database.DBPreparedStatement.setBy
tes(Unknown Source)
...


So before sending back always check the byte[] for null.


Regards

Sudhesh
17 years ago
Hi Nair,

Before executing your client please ensure that all the necessary jar files are attched to it.

For example

naming.jar
namingclient.jar
namingserver.jar
implfactory.jar

then try may be it will solve your problem if then also it won't work then and some other exception will come then check your bootstrap hostaddress in adminconsole.

Change the hostaddress from localhost to your mc name where the server is running. these chages are incorporated with your server. After saving the changes restart your server.

For changing bootstrap hostaddress go to adminconsole then to server then to process definition then to endpoints and change the value there.

Regards

Sudhesh
17 years ago
Hi Lin,

Once again Thanks for your kind reply.

I got the solution, actually i didn't set the BootstrapHostAddress from localhost to machine address that's why the problem was coming during execution.

If any one have the same type of problem with the deployment of client code then just go to the Adminconsole the to the server
in processdefinition change the value of BootStrapHostAddress from localhost to mc name then restart your server.


or you can change this value in serverindex.xml file also.

Thanks & Regards

Sudhesh
17 years ago
hi all,

I tried it with the InitialContext properties as
properties.put( javax.naming.Context.PROVIDER_URL,
"IIOP://remote_host_ip_address:2809/" );

But during execution of client it is giving the exception below

javax.naming.CommunicationException: A communication failure occurred while attempting to obtain an initial context using the provider url: "corbaloc:iiop:remote_host_ip_address:2809". Make sure that the host and port information is correct and that the server identified by the provider url is a running name server. If no port number is specified, the default port number 2809 is used. Other possible causes include the network environment or workstation network configuration. Root exception is org.omg.CORBA.COMM_FAILURE: WRITE_ERROR_SEND_1 minor code: 49421050 completed: No


Thanks & Regards

sudhesh Rajan
17 years ago
hi all,
Thanks for your kind reply.
I tried it with the InitialContext properties as
properties.put( javax.naming.Context.PROVIDER_URL,
"IIOP://remote_host_ip_address:2809/" );


but again the same exception came. On adding namingserver.jar file the
previous exception has gone.
Now it is giving

javax.naming.CommunicationException: A communication failure occurred while attempting to obtain an initial context using the provider url: "corbaloc:iiop:remote_host_ip_address:2809". Make sure that the host and port information is correct and that the server identified by the provider url is a running name server. If no port number is specified, the default port number 2809 is used. Other possible causes include the network environment or workstation network configuration. Root exception is org.omg.CORBA.COMM_FAILURE: WRITE_ERROR_SEND_1 minor code: 49421050 completed: No

Regards

sudhesh Rajan
17 years ago
I am getting the following exception when i am trying to run my client code.

client code is running perfectly, when i tried it on the same system on which server is running. I am using WSAD 5.0.
is there any further settings required for running clients from a remote machine. Please, somebody help me out.

javax.naming.ServiceUnavailableException: A communication failure occurred while attempting to obtain an initial context using the provider url: "iiop://<mc-name>:2809". Make sure that the host and port information is correct and that the server identified by the provider url is a running name server. If no port number is specified, the default port number 2809 is used. Other possible causes include the network environment or workstation network configuration. Root exception is org.omg.CORBA.TRANSIENT: Connection refused: connect:host=<mc-name>.<my - company>.com,port=2809 minor code: 4942F301 completed: No


the code for looking up is:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL,"iiop://<mc-name>:2809");
Context ctx = new InitialContext(env);



Thanks & Regards
Rajan
17 years ago