• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

MQ ssl problem in Linux

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
       
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic