File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes MQ ssl problem in Linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "MQ ssl problem in Linux" Watch "MQ ssl problem in Linux" New topic
Author

MQ ssl problem in Linux

Suresh Achary
Greenhorn

Joined: Oct 10, 2009
Posts: 9
Hi,

I am trying to put a message into mq.
MQ server is running of a Linux machine.
When I run the below client program from Windows XP, I am able to successfully put the message, but when I try to run the java program and put the message from a Linux machine, I am getting an error as given. Please help.

JDK version 1.5
MQ version 6.0.2

public static void main(String[] args)
{
String QMgrName= null;
String QName = null;
MQQueueManager qMgr = null;
MQQueue q = null;
int openOptions;
try
{
MQEnvironment.hostname = "10.0.0.2";
MQEnvironment.channel = "SURESHCHANNEL";
MQEnvironment.port = 1414;
System.setProperty("javax.net.ssl.trustStore","/home/suresh/mq/SureshTrustStore.jks");
System.setProperty("javax.net.ssl.trustStorePassword","Password1");
System.setProperty("javax.net.ssl.keyStore","/home/suresh/mq/sureshkeystore.p12");
System.setProperty("javax.net.ssl.keyStorePassword","password1");
System.setProperty("javax.net.ssl.keyStoreType","pkcs12");
System.out.println("SSL properties set");
MQEnvironment.sslCipherSuite = "SSL_SURESH";
MQEnvironment.sslPeerName = "CN=sureshtest";
MQEnvironment.userID = "suresh";
QMgrName = "SURESHQMGR";
QName = "SURESHQ";
qMgr = new MQQueueManager(QMgrName);
openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_INQUIRE | MQC.MQOO_OUTPUT ;
if(qMgr.isConnected())
System.out.println("Successfully connected to "+QMgrName+" !");
else
System.out.println("Unable to connect to "+QMgrName+" !");
q = qMgr.accessQueue(QName, openOptions, null, null, null);
MQMessage myMsg = new MQMessage();
myMsg.writeString("MQ Test Message");
q.put(myMsg);
System.out.println("Message put to queue");
q.close();
qMgr.disconnect();
}
catch(Exception e)
{
e.printStackTrace();
}

Error log is pasted below. Please help

MQJE001: An MQException occurred: Completion Code 2, Reason 2059
MQJE013: Error accessing socket streams
MQJE001: An MQException occurred: Completion Code 2, Reason 2059
MQJE013: Error accessing socket streams
com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2059
MQJE013: Error accessing socket streams
        at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:276)
        at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:301)
        at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:323)
        at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:84)
        at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:173)
        at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:795)
        at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:709)
        at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:664)
        at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:160)
        at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:479)
        at MQJSSLDemo.main(MQJSSLDemo.java:76)
Caused by: com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2059
MQJE013: Error accessing socket streams
        at com.ibm.mq.SSLHelper.createSSLSocketInstance(SSLHelper.java:705)
        at com.ibm.mq.SSLHelper.createSSLSocket(SSLHelper.java:139)
        at com.ibm.mq.MQInternalCommunications.createSocketConnection(MQInternalCommunications.java:2295)
        at com.ibm.mq.MQv6InternalCommunications$1.run(MQv6InternalCommunications.java:166)
        at java.security.AccessController.doPrivileged(AccessController.java:241)
        at com.ibm.mq.MQv6InternalCommunications.initialize(MQv6InternalCommunications.java:163)
        at com.ibm.mq.MQv6InternalCommunications.<init>(MQv6InternalCommunications.java:111)
        at com.ibm.mq.MQSESSIONClient.MQCONNX(MQSESSIONClient.java:1458)
        at com.ibm.mq.MQSESSIONClient.MQCONN(MQSESSIONClient.java:1369)
        at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:252)
       
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MQ ssl problem in Linux