ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » JBoss and MQ with JCA connection factory

Post new topic  Reply to topic
 JBoss and MQ with JCA connection factory « View previous topic :: View next topic » 
Author Message
awatson72
PostPosted: Mon Nov 30, 2009 9:28 am    Post subject: JBoss and MQ with JCA connection factory Reply with quote

Acolyte

Joined: 14 Apr 2004
Posts: 69
Location: Freeport, Maine

Trying to connect to MQ 7 using a JCA connection factory configured in JBoss. An MQ 7 QM is running on the same server as JBoss, I'm attempting to connect using Bindings, and am unable to get past a 2035 - not authorized error. I tried adding the username and password for mqm in the connection factory definition, and also have tried adding the ID which the JBoss server runs under to the mqm group. The JBoss user can interact with the QM objects via runmqsc with no problem. Still the 2035. Any thoughts?

Stack trace:

com.ibm.msg.client.jms.DetailedJMSException: MQJCA1011: Failed to allocate a JMS connection. An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.
at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:141)
at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:100)
at com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createManagedJMSConnection(ConnectionFactoryImpl.java:230)
at com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createConnectionInternal(ConnectionFactoryImpl.java:148)
at com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createConnection(ConnectionFactoryImpl.java:133)
at com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createConnection(ConnectionFactoryImpl.java:118)
at IVT.doGet(IVT.java:290)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'QMJBOSS01' with connection mode 'Bindings' and host name 'localhost'. Please check if the supplied username and password are correct on the QueueManager you are connecting to
at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:540)
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:236)
at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:421)
at com.ibm.msg.client.wmq.internal.WMQXAConnection.(WMQXAConnection.java:70)
at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createV7ProviderConnection(WMQXAConnectionFactory.java:190)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6204)
at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createProviderXAConnection(WMQXAConnectionFactory.java:102)
at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createXAConnectionInternal(JmsConnectionFactoryImpl.java:371)
at com.ibm.mq.jms.MQXAConnectionFactory.createXAConnection(MQXAConnectionFactory.java:124)
at com.ibm.mq.connector.ConnectionBuilder.createConnection(ConnectionBuilder.java:166)
at com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.createConnection(ManagedConnectionFactoryImpl.java:403)
at com.ibm.mq.connector.outbound.ManagedConnectionImpl.(ManagedConnectionImpl.java:131)
at com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.createManagedConnection(ManagedConnectionFactoryImpl.java:176)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:584)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:262)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:500)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:348)
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:330)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:403)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:850)
at com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createManagedJMSConnection(ConnectionFactoryImpl.java:189)
... 24 more
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:223)
... 43 more
_________________
Andrew Watson
L.L. Bean, Inc.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Nov 30, 2009 8:55 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

So you got
Code:
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').


Think about using in bindings mode the same id as the one running JBOSS. (length <=12 char)

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
awatson72
PostPosted: Tue Dec 01, 2009 8:23 am    Post subject: Reply with quote

Acolyte

Joined: 14 Apr 2004
Posts: 69
Location: Freeport, Maine

OK, I can try that. But I need to run my QM as the Jboss user, not the other way around, which leads to an embarrassing question - how do I run the QM as my user of choice, on Linux, I have the user in the mqm group? I've just spent an hour reading doc, and haven't figured it out. If I start as the user of choice, the processes are still running as mqm.
_________________
Andrew Watson
L.L. Bean, Inc.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Dec 02, 2009 9:52 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

awatson72 wrote:
OK, I can try that. But I need to run my QM as the Jboss user, not the other way around, which leads to an embarrassing question - how do I run the QM as my user of choice, on Linux, I have the user in the mqm group? I've just spent an hour reading doc, and haven't figured it out. If I start as the user of choice, the processes are still running as mqm.


Quote:
But I need to run my QM as the Jboss user, not the other way around

NO! What you need to do is give authorizations to your user of choice (i.e. the user running JBoss) to access the qmgr and the objects it needs to...

You could of course add the user of choice to the mqm group but then no authorization is ever needed...


_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
awatson72
PostPosted: Fri Dec 04, 2009 8:22 am    Post subject: Reply with quote

Acolyte

Joined: 14 Apr 2004
Posts: 69
Location: Freeport, Maine

This turned out to be a problem with the way I had the QCF defined for JBoss. I had added parameters for User ID and Password, with valid credentials for the QM no less, which for some reason was causing the MQRC 2035. I deleted these parameters, and the connect works fine. For some reason, the very existence of credential parameters in the JBoss QCF causes a binding connection to fail with a 2035. As long as the user running JBoss is in a group which allows the appropriate access to MQ, life is good.

The only reason I was trying to run the QM as the JBoss ID was because I was grasping at straws, knowing it was unsatisfactory, but trying to make it work somehow.

I still haven't figured out how to make a QM run as anything other than mqm on Linux, (not a problem on AIX), but I guess I don't care that much anymore because I found the root problem.
_________________
Andrew Watson
L.L. Bean, Inc.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Dec 04, 2009 4:06 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Ata Boy for resolving this the right way.

Note that in "bindings" mode you will get a 2035 for passing any user different from the user running the JVM. If you want to pass a different user use a client connection.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mishka_3001
PostPosted: Thu Dec 24, 2009 6:18 am    Post subject: JMSWMQ2013 com.ibm.msg.client.jms.DetailedJMSSecurityExcepti Reply with quote

Newbie

Joined: 24 Dec 2009
Posts: 2

I am new to WebSphere MQ and JMS. I have installed the MQ Server and the client on Windows Server 2003. When accessing queues locally from java client in CLIENT mode everything works fine. When trying to run the same code from other machine that doesn't have MQ server I receive the Security exception. I am not sure where and what needs to be configured. The code to start the connection is this:

JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);
JmsConnectionFactory cf = ff.createConnectionFactory();

cf.setIntProperty(WMQConstants.WMQ_PORT, port);
cf.setStringProperty(WMQConstants.WMQ_CHANNEL, channel);
cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, hostName);
cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, connectionMode);
cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, queueManager);

connection = cf.createConnection();
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

sendToDestination = session.createQueue(sendToQueueName);
receiveFromDestination = session.createQueue(receiveFromQueueName);

producer = session.createProducer(sendToDestination);
consumer = session.createConsumer(receiveFromDestination);

connection.start();

===============================================

This is the exception that is thrown:

Exception in thread "main" com.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'QM_mike' with connection mode 'Client' and host name '192.168.0.147'.

Can somebody help me?
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Dec 24, 2009 7:52 am    Post subject: Re: JMSWMQ2013 com.ibm.msg.client.jms.DetailedJMSSecurityExc Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mishka_3001 wrote:
I am new to WebSphere MQ and JMS. I have installed the MQ Server and the client on Windows Server 2003. When accessing queues locally from java client in CLIENT mode everything works fine. When trying to run the same code from other machine that doesn't have MQ server I receive the Security exception. I am not sure where and what needs to be configured. The code to start the connection is this:

JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);
JmsConnectionFactory cf = ff.createConnectionFactory();

cf.setIntProperty(WMQConstants.WMQ_PORT, port);
cf.setStringProperty(WMQConstants.WMQ_CHANNEL, channel);
cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, hostName);
cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, connectionMode);
cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, queueManager);

connection = cf.createConnection();
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

sendToDestination = session.createQueue(sendToQueueName);
receiveFromDestination = session.createQueue(receiveFromQueueName);

producer = session.createProducer(sendToDestination);
consumer = session.createConsumer(receiveFromDestination);

connection.start();

===============================================

This is the exception that is thrown:

Exception in thread "main" com.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'QM_mike' with connection mode 'Client' and host name '192.168.0.147'.

Can somebody help me?


This is a double post of this and not relevant to this thread.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » JBoss and MQ with JCA connection factory
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.