|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Problem to connect JAVA/JMS client to channel with MCAUSER |
« View previous topic :: View next topic » |
Author |
Message
|
noky87 |
Posted: Wed Dec 29, 2010 3:59 am Post subject: Problem to connect JAVA/JMS client to channel with MCAUSER |
|
|
Newbie
Joined: 15 Dec 2010 Posts: 2
|
Hi all,
Can someone please tell me how is my problem when trying to connect a JMS/JAVA application client (windows) to WMQ on Server (unix)?
I have use a SVRCONN type channel with definition:
Code: |
CHANNEL(CHL.SERVER) CHLTYPE(SVRCONN)
TRPTYPE(TCP) DESCR( )
SCYEXIT( ) MAXMSGL(4144304)
SCYDATA( ) HBINT(300)
SSLCIPH( ) SSLCAUTH(REQUIRED)
KAINT(AUTO) MCAUSER(userChl)
ALTDATE(2009-01-19) ALTTIME(11.04.02)
SSLPEER()
SENDEXIT( )
RCVEXIT( )
SENDDATA( )
RCVDATA( ) |
And a queue alias:
Code: |
DESCR(Reception queue)
TARGQ(Queue.local) CLUSTER(nameCluster)
CLUSNL( ) QUEUE(Queue.alias)
ALTDATE(2010-08-02) ALTTIME(11.30.41)
GET(ENABLED) PUT(ENABLED)
DEFPRTY(0) DEFPSIST(NO)
SCOPE(QMGR) DEFBIND(OPEN)
TYPE(QALIAS) |
My JMS code is :
Code: |
JmsConnectionFactory cf = ff.createConnectionFactory();
cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, "XX.XXX.XXX.XXX");
cf.setIntProperty(WMQConstants.WMQ_PORT, 1414);
cf.setStringProperty(WMQConstants.WMQ_CHANNEL, "CHL.SERVER");
cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);
cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, "Qmng");
connection = (MQQueueConnection) cf.createQueueConnection(); |
And my codeError is: 2035 --> MQRC_NOT_AUTHORIZED
In cliente computer, I created the environment variable
Code: |
MQSERVER=CHL.SERVER/TCP/XX.XXX.XXX.XXX |
I tried examples MQ in c code and java code with results very differents:
With c code I send and receive messages to alias queue but if I try send messages to queue local, I get a error 2035 too.
Code: |
amqsputc Queue.alias
Sample AMQSPUT0 start
target queue is Queue.alias
test message
test message 2
Sample AMQSPUT0 end
amqsbcgc Queue.alias
I see my 2 test messages with its descriptor. In its descriptor the userIdentifier is 'userChl'
amqsgetc Queue.alias
Sample AMQSPUT0 start
target queue is Queue.alias
test message
test message 2
Sample AMQSPUT0 end
amqsputc Queue.local
Sample AMQSPUT0 start
target queue is Queue.local
MQOPEN ended with reason code 2035
unable to open queue for output
Sample AMQSPUT0 end
Amqscnxc -X XX.XXX.XXX.XXX -c CHL.SERVER Qmng
Sample AMQSCNXC start
Connecting to queue manager Qmng
using the server connection channel CHL.SERVER
on connection name XX.XXX.XXX.XXX.
MQOPEN ended with reason code 2035
Unable to open queue manager for inquire
Sample AMQSCNXC end
|
And with java code I always get error 2035... I tried IVTRun example:
Code: |
IVTRun -nojndi -client -m Qmng -host XX.XXX.XXX.XXX -channel CHL.SERVER -t
Se est+Ã creando un QueueConnectionFactory
Se est+à creando una conexi+¦n
Excepci+¦n
Mensaje : CC=2;RC=2035;AMQ9509: El programa no puede abrir el objeto del gestor de colas. [1=2035,5=???]
Clase : class javax.jms.JMSException
|
I think my problem is my userID of my computer haven't authorization for use this channel. I tried change the file IVTRun and put -Duser.name="userChl". I can't create authorization for my userID in Server.
I read all post with code error 2035 but I don´t resolve my problem... I'm dessesperated... I don´t know what is my error...
I hope you can help me to resolve my problem.
Thanks!!
Last edited by noky87 on Wed Dec 29, 2010 4:23 am; edited 1 time in total |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 29, 2010 5:15 am Post subject: Re: Problem to connect JAVA/JMS client to channel with MCAUS |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
noky87 wrote: |
I think my problem is my userID of my computer haven't authorization for use this channel. I tried change the file IVTRun and put -Duser.name="userChl". |
If the channel you're using has an MCAUser of "userChl" then it's that user id which doesn't have authority. And the authorization to use the channel is fine, it's the MQOPEN against the queue object which is coming up not authorized.
noky87 wrote: |
I can't create authorization for my userID in Server. |
Unless you're the WMQ administrator then no you can't.
noky87 wrote: |
I'm dessesperated... I don´t know what is my error... |
If I'd read all the literature on 2035 and still didn't know what the problem is I'd be depressed too.
You've already said it's a problem with authorization. What else is there to know?
noky87 wrote: |
I hope you can help me to resolve my problem. |
No, but whoever administers your queue manager will be able to. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Dec 29, 2010 2:19 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
If using JMS you need +inq on top of get and put authorizations  _________________ MQ & Broker admin |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Dec 29, 2010 2:53 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Quote: |
I can't create authorization for my userID in Server. |
This is not a technical explanation.
Why can't you? No computer? No keyboard? Broken fingers?
Or, by chance did you enter some kind of command in an attempt to create authorizations? If so, what command did you enter? What error message did you receive? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
noky87 |
Posted: Thu Dec 30, 2010 7:41 am Post subject: |
|
|
Newbie
Joined: 15 Dec 2010 Posts: 2
|
Sorry for my bad explications and thank you for de answers.
I can't create authorization for my userID in Server because I'm not WMQ administrator. Anyway, I have use the userID "userChl" of get and put messages.
I don`t understand why with examples in c code I put/get messages without problems using userID "userChl" and with java code gets this code error...
For example, I execute
Code: |
amqsputc Queue.alias |
Code: |
Sample AMQSPUT0 start
target queue is Queue.alias
Test message
Sample AMQSPUT0 end
|
Code: |
amqsbcgc Queue.alias
|
Code: |
MQGET of message number 1
****Message descriptor****
StrucId : 'MD ' Version : 2
Report : 0 MsgType : 8
Expiry : -1 Feedback : 0
Encoding : 546 CodedCharSetId : 850
Format : 'MQSTR '
Priority : 0 Persistence : 0
MsgId : X'414D51204D58333530303030313645394D17E07D20016F01'
CorrelId : X'000000000000000000000000000000000000000000000000'
BackoutCount : 0
ReplyToQ : ' '
ReplyToQMgr : 'Qmgr '
** Identity Context
UserIdentifier : 'userChl '
AccountingToken :
X'16010515000000EFA8A00312FC58A7BB6BD18533A6030000000000000000000B'
ApplIdentityData : ' '
** Origin Context
PutApplType : '11'
PutApplName : ' '
PutDate : '20101230' PutTime : '15353715'
ApplOriginData : ' '
GroupId : X'000000000000000000000000000000000000000000000000'
MsgSeqNumber : '1'
Offset : '0'
MsgFlags : '0'
OriginalLength : '-1'
**** Message ****
length - 12 bytes
00000000: 5465 7374 206D 6573 7361 6765 'Test message '
|
I think that it cans be a problem of bad configuration of my JRE. Is it necessary add a new entry in java.policy or another file of java configuration?
Thanks![/b] |
|
Back to top |
|
 |
Vitor |
Posted: Thu Dec 30, 2010 7:47 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
noky87 wrote: |
I don`t understand why with examples in c code I put/get messages without problems using userID "userChl" and with java code gets this code error... |
Because Java (or specifically the JMS) requires more authority against a queue object than the equivalent C code.
Tell your WMQ administrator the userChl id requires inquire authority against the queue objects you're using. As my most worthy associate pointed out a few posts back. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|