Author |
Message
|
vea |
Posted: Thu Jun 30, 2005 1:50 am Post subject: MQ reasoncode 2012 on AS400 ILE RPG |
|
|
Newbie
Joined: 30 Jun 2005 Posts: 5
|
Hi there,
I've the following situation.
I've created a java programm on the AS400 connecting to a MQQueueManager, the only thing I specify is the name of the Queue manager, since the programm is running on the same machine as MQ a binding connection should be made. When I run this java code on the AS400 via the JAVA command everything works fine. However when I call the same java programm from a ILE RPG programm on the same AS400 the following error occurs.
MQJE001: Completion Code 2, Reason 2012
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2012
at java/lang/Throwable.<init>(Throwable.java:180)
at java/lang/Exception.<init>(Exception.java:29)
at com/ibm/mq/MQException.<init>(MQException.java:717)
at com/ibm/mq/MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:126)
at com/ibm/mq/MQBindingsManagedConnectionFactoryJ11._createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:115)
at com/ibm/mq/MQBindingsManagedConnectionFactoryJ11.createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:189)
at com/ibm/mq/StoredManagedConnection.<init>(StoredManagedConnection.java:72)
at com/ibm/mq/MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:118)
at com/ibm/mq/MQQueueManager.obtainBaseMQQueueManager(MQQueueManager.java:714)
at com/ibm/mq/MQQueueManager.construct(MQQueueManager.java:658)
at com/ibm/mq/MQQueueManager.<init>(MQQueueManager.java:411)
at AMP/READMQ_ObFnc.ObRun(READMQ_ObFnc.java:121)
at ObRun/ObFunction/ObLocalJavaCall.call(ObCall.java:216)
at ObRun/ObFunction/ObApplication.obCallFunction(ObApplication.java:583)
at ObRun/ObUtils/ObUserApi.callFunction(ObUserApi.java:42)
Can anyone help me out with this ?
Thanks in advance............ |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jun 30, 2005 3:20 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Messages wrote: |
2012 X'07DC' MQRC_ENVIRONMENT_ERROR
The call is not valid for the current environment.
On z/OS, one of the following applies:
An MQCONN or MQCONNX call was issued, but the application has been linked with an adapter that is not supported in the environment in which the application is running. For example, this can arise when the application is linked with the WebSphere MQ RRS adapter, but the application is running in a DB2 Stored Procedure address space. RRS is not supported in this environment. Stored Procedures wishing to use the WebSphere MQ RRS adapter must run in a DB2 WLM-managed Stored Procedure address space.
An MQCMIT or MQBACK call was issued, but the application has been linked with the RRS batch adapter CSQBRSTB. This adapter does not support the MQCMIT and MQBACK calls.
An MQCMIT or MQBACK call was issued in the CICS or IMS environment.
The RRS subsystem is not up and running on the z/OS system that ran the application.
On Compaq OpenVMS Alpha, OS/2, OS/400, Compaq NonStop Kernel, UNIX systems, and Windows, one of the following applies:
The application is linked to the wrong libraries (threaded or nonthreaded).
An MQBEGIN , MQCMIT , or MQBACK call was issued, but an external unit-of-work manager is in use. For example, this reason code occurs on Windows when an MTS object is running as a DTC transaction. This reason code also occurs if the queue manager does not support units of work.
The MQBEGIN call was issued in a WebSphere MQ client environment.
An MQXCLWLN call was issued, but the call did not originate from a cluster workload exit.
Corrective action: Do one of the following (as appropriate):
On z/OS:
Link the application with the correct adapter.
Modify the application to use the SRRCMIT and SRRBACK calls in place of the MQCMIT and MQBACK calls. Alternatively, link the application with the RRS batch adapter CSQBRRSI. This adapter supports MQCMIT and MQBACK in addition to SRRCMIT and SRRBACK.
Modify the application to use the SRRCMIT and SRRBACK calls in place of the MQCMIT and MQBACK calls. Alternatively, link the application with the RRS batch adapter CSQBRRSI. This adapter supports MQCMIT and MQBACK in addition to SRRCMIT and SRRBACK.
For a CICS or IMS application, issue the appropriate CICS or IMS call to commit or backout the unit of work.
Start the RRS subsystem on the z/OS system that is running the application.
In the other environments:
Link the application with the correct libraries (threaded or nonthreaded).
Remove from the application the call that is not supported.
|
My emphasis. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
vea |
Posted: Thu Jun 30, 2005 4:37 am Post subject: |
|
|
Newbie
Joined: 30 Jun 2005 Posts: 5
|
jefflowrey,
Thanks for your reply but I allready found the description of the error.
The main question is how to find out which of the problems occur.
1.The application is linked to the wrong libraries (threaded or nonthreaded). Can you tell to which libraries it should be linked, as far as I know QMQM and QMQMJAVA should be in the librarylist of the job.
2. An MQBEGIN , MQCMIT , or MQBACK call was issued, but an external unit-of-work manager is in use. For example, this reason code occurs on Windows when an MTS object is running as a DTC transaction. This reason code also occurs if the queue manager does not support units of work. I think the programm calls mentioned are calls from RPG but I'm calling a java method from an RPG programm so I don't think this is the case. Perhaps the queueu manager doesn't support units of work but how can I check that ?
3.The MQBEGIN call was issued in a WebSphere MQ client environment. I'm using a binding connection so that can't be the case.
Remember the java method is working when calling it with the JAVA command on the AS400 only calling from an ILE RPG programm doesn't work. Maybe the ILE environment is the problem ? |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jun 30, 2005 4:50 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
vea wrote: |
Remember the java method is working when calling it with the JAVA command on the AS400 only calling from an ILE RPG programm doesn't work. Maybe the ILE environment is the problem ? |
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
vea |
Posted: Thu Jun 30, 2005 5:09 am Post subject: |
|
|
Newbie
Joined: 30 Jun 2005 Posts: 5
|
jefflowrey wrote: |
vea wrote: |
Remember the java method is working when calling it with the JAVA command on the AS400 only calling from an ILE RPG programm doesn't work. Maybe the ILE environment is the problem ? |
|
Can you help me out with this, do I have to do special things when calling my method from ILE RPG (calling the method itself isn't the problem). |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jun 30, 2005 5:37 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Sorry.
I meant to put more information there, I just got distracted and hit submit.
It's definitely the ILE RPG environment. What I suspect is happening, but I am not an OS/400 or AS/400 expert, or even a qualified USER of these, that the RPG environment has it's own transaction manager, and the java code is trying to enlist resources that the RPG tran manager has in a session with the java tran manager.
Or otherwise a conflict between the two different transaction environments.
I would think there would be something in the WebSphere MQ platform specific documentation for OS/400 that would help. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kforster |
Posted: Sat Jul 02, 2005 8:40 pm Post subject: Re: MQ reasoncode 2012 on AS400 ILE RPG |
|
|
Newbie
Joined: 02 Jul 2005 Posts: 3 Location: Melbourne, Australia
|
I received the same error, but from within QShell.. The fix was to set the following environment variable:
ADDENVVAR ENVVAR(QIBM_MULTI_THREADED) VALUE('Y') |
|
Back to top |
|
 |
vea |
Posted: Sun Jul 03, 2005 9:36 pm Post subject: |
|
|
Newbie
Joined: 30 Jun 2005 Posts: 5
|
@kforster
Thanks for your reply, I allready tried this but with no result but thanks anyway........... I'm using the client connection (passing system name qmanager and chanel) for now but I'm still trying to find out how to get the binding connection to work. |
|
Back to top |
|
 |
kforster |
Posted: Sun Jul 03, 2005 10:37 pm Post subject: |
|
|
Newbie
Joined: 02 Jul 2005 Posts: 3 Location: Melbourne, Australia
|
Vea,
If you do find the answer, could pls. post it ? In the next couple of months I will required to something similar to what you have done. |
|
Back to top |
|
 |
vennela |
Posted: Sun Jul 03, 2005 11:15 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
From the java manual:
Quote: |
To use WebSphere MQ Java in bindings mode on i5/OS, ensure that the library
QMQMJAVA is in your library list. |
|
|
Back to top |
|
 |
vea |
Posted: Sun Jul 03, 2005 11:19 pm Post subject: |
|
|
Newbie
Joined: 30 Jun 2005 Posts: 5
|
Hi all,
PROBLEM SOLVED !!!
Since my ILE RPG job is a submitted job (the programm is waiting till a message appears in a que) the SBMJOB command has to set the keyword ALWMLTTHD (Allow Multiple threads) to *YES to get it working. |
|
Back to top |
|
 |
vennela |
Posted: Sun Jul 03, 2005 11:27 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
From the java manual:
Quote: |
On i5/OS, the environment variable QIBM_MULTI_THREADED must be set to Y.
You can then run multithreaded applications in the same way that you run single
threaded applications. |
|
|
Back to top |
|
 |
SSachdeva |
Posted: Thu Mar 16, 2006 6:42 am Post subject: |
|
|
Apprentice
Joined: 04 Apr 2002 Posts: 33
|
Hi,
I am having the same problem too. Unfortunately I am not submiting a job but simply calling my application with the cl CALL LIBRARY/PGM. This PGM calls a Java method that uses WMQ. When I call it it constantly gives me a RC 2012. If i use the client connection in my Java program it fails still but this time with a 2009. Any ideas - I am extremely new to the AS/400 and would really appreciate any help i can get.
p.s. I did set my class path and QIBM_MULTI_THREADED to Y by using addenvvar before i ran. I finds the classpath cause its getting far enough to actually call the Queueu Manager object bu then it fails.
Thanks in advance
Shammy |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 16, 2006 8:35 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I think OS/400 (iSeries, AS/400) doesn't have a client implementation - even with the Java API.
So I don't think you will be able to make your code work with a client connection.
Otherwise, please read this thread again and confirm all the steps that have been suggested have been done. I caught myself about to repeat myself. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Mar 16, 2006 9:48 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
|
Back to top |
|
 |
|