|   | 
	 
  
    | 
RSS Feed - WebSphere MQ Support
 | 
RSS Feed - Message Broker Support
 |   
 
  
	     | 
	 | 
   
 
  
	|  Java application failing with RC=2035 on MQOPEN | 
	« View previous topic :: View next topic »  | 
   
  
  	
	  
		
		
		  | Author | 
		  Message
		 |  
		
		  | bgoldstein | 
		  
		    
			  
				 Posted: Wed Aug 21, 2002 12:43 pm    Post subject: Java application failing with RC=2035 on MQOPEN | 
				     | 
			   
			 
		   | 
		 
		
		   Novice
 
 Joined: 14 Feb 2002 Posts: 19 Location: Ameren Services, St.Louis,Mo., USA 
  | 
		  
		    
			  
				We moved a Java 1.31 pgm using MQ Native (not JMS) from an NT server to a Solaris 8 server.  Both Servers have MQ 5.2 QueueManagers on them.  Why is this failing with a RC=2035, not authorized, on creation of the qMgr = new MQQueueManager('MyMQmgr');
 
 
Here is the source program:
 
 
   
	| Code: | 
   
  
	//======================================================================
 
//Licensed Materials -Property of IBM
 
//5639-C34
 
//(c)Copyright IBM Corp.1995,1999
 
//======================================================================
 
//MQSeries classes for Java sample application
 
//
 
//This sample runs as a Java application 
 
//using the command :-java MQSample
 
import com.ibm.mq.*;
 
import javax.transaction.xa.*;
 
 
//Include the MQSeries classes for Java package
 
public class MQSample
 
{
 
  private String qManager ="SQSD1D7";
 
 
  //define name of queue
 
  //manager to connect to.
 
  private MQQueueManager qMgr;
 
 
  //define a queue manager object
 
  public static void main(String args [])
 
  {
 
    new MQSample();
 
  }
 
 
 
  public MQSample()
 
  {
 
  try{
 
 
  //Create a connection to the queue manager
 
  qMgr =new MQQueueManager(qManager);
 
 
  //Set up the options on the queue we wish to open...
 
  //Note.All MQSeries Options are prefixed with MQC in Java.
 
  int openOptions =MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT ;
 
 
  //Now specify the queue that we wish to open,
 
  //and the open options...
 
  MQQueue XPCinBoundQueue =
 
  qMgr.accessQueue("IP.DOC.OUTBND",openOptions);
 
  //qMgr.accessQueue("SYSTEM.DEFAULT.LOCAL.QUEUE",openOptions);
 
 
  //Define a simple MQSeries message,and write some text in UTF format..
 
  MQMessage hello_world =new MQMessage();
 
  hello_world.writeUTF("Neal Was Here!");
 
 
  //specify the message options...
 
  MQPutMessageOptions pmo =new MQPutMessageOptions();//accept the //defaults,
 
 
  //same as MQPMO_DEFAULT
 
  //put the message on the queue
 
  XPCinBoundQueue.put(hello_world,pmo);
 
 
  //get the message back again...
 
  //First define a MQSeries message buffer to receive the message into..
 
  MQMessage retrievedMessage =new MQMessage();
 
  retrievedMessage.messageId =hello_world.messageId;
 
 
  //Set the get message options...
 
  MQGetMessageOptions gmo =new MQGetMessageOptions();//accept the defaults
 
 
  //same as MQGMO_DEFAULT
 
  //get the message off the queue...
 
  XPCinBoundQueue.get(retrievedMessage,gmo);
 
 
  //And prove we have the message by displaying the UTF message text
 
  String msgText =retrievedMessage.readUTF();
 
  System.out.println("The message is:"+msgText);
 
 
  //Close the queue...
 
  XPCinBoundQueue.close();
 
 
  //Disconnect from the queue manager
 
  qMgr.disconnect();
 
  System.out.println("QMGR DISCONNECTED. DONE.");
 
  }
 
 
  //If an error has occurred in the above,try to identify what went wrong
 
  //Was it an MQSeries error?
 
  catch (MQException ex)
 
  {
 
  System.out.println("An MQSeries error occurred :Completion code:"+
 
  ex.completionCode +"  Reason code:"+ex.reasonCode);
 
  }
 
 
  //Was it a Java buffer space error?
 
  catch (java.io.IOException ex)
 
  {
 
    System.out.println("An error occurred whilst writing to the message buffer:"+ex);
 
  }
 
  }
 
}//end of sample | 
   
 
 
 
The mq trace indicates that the MQCONN is successful, but the MQOPEN is failing. The queuename appears to be blank, why?
 
 
MQ trace of the agent process:
 
   
	| Quote: | 
   
  
	...
 
 15:32:15.834400     5700.59           Principal(e27183      ) EntityType(1)    
 
 15:32:15.834400     5700.59           ObjectName(SQSD1D7                       
 
                  ) ObjectType(5)                                               
 
 15:32:15.834400     5700.59           PrimaryOnly(0) AccessTemplate(1) Authoriz
 
ation(40001)                                                                    
 
 15:32:15.834421     5700.59      ---------}  zfu_as_calculateauthority rc=OK   
 
 15:32:15.834439     5700.59      --------}  zfu_as_checkobjectauthority rc=OK  
 
...
 
 15:32:15.848026     5700.59           Principal(e27183      ) EntityType(1)
 
 15:32:15.848026     5700.59           ObjectName(
 
                  ) ObjectType(5)
 
 15:32:15.848026     5700.59           PrimaryOnly(0) AccessTemplate(10) Authori
 
zation(40001)
 
 15:32:15.848047     5700.59      -----------}  zfu_as_calculateauthority rc=OK
 
 15:32:15.848068     5700.59      ----------}! zfu_as_checkobjectauthority rc=MQ
 
RC_NOT_AUTHORIZED
 
... | 
   
 
 
MQ trace of the application process:
 
   
	| Quote: | 
   
  
	...
 
 15:32:15.835542    13419.1            MQCONN <<
 
 15:32:15.835698    13419.1            Name          : Input  Parm
 
 15:32:15.835715    13419.1            Hconn:
 
 15:32:15.835761    13419.1              0x0000:  00328488
 
       |.2              |
 
 15:32:15.835780    13419.1            ConnectOpts: NULL
 
 15:32:15.835795    13419.1            Compcode:
 
 15:32:15.835810    13419.1              0x0000:  00000000
 
       |....            |
 
 15:32:15.835825    13419.1            Reason:
 
 15:32:15.835840    13419.1              0x0000:  00000000
 
       |....            |
 
...       
 
15:32:15.845771    13419.1            MQOPEN >>
 
15:32:15.845786    13419.1            Hconn:
 
15:32:15.845800    13419.1              0x0000:  00328488
 
      |.2              |
 
15:32:15.845816    13419.1            Objdesc:
 
15:32:15.845831    13419.1              0x0000:  4f442020 00000001 00000005 000
 
0000  |OD  ............|
 
15:32:15.845831    13419.1              0x0010:  00000000 00000000 00000000 000
 
0000  |................|
 
15:32:15.845831    13419.1              0x0020:  00000000 00000000 00000000 000
 
0000  |................|
 
15:32:15.845831    13419.1              0x0030:  00000000 00000000 00000000 000
 
0000  |................|
 
15:32:15.845831    13419.1              0x0040:  00000000 00000000 00000000 000
 
0000  |................|
 
15:32:15.845831    13419.1              0x0050:  00000000 00000000 00000000 000
 
0000  |................|
 
15:32:15.845831    13419.1              0x0060:  00000000 00000000 00000000 414
 
512e  |............AMQ.|
 
 15:32:15.845831    13419.1              0x0050:  00000000 00000000 00000000 000
 
00000  |................|
 
 15:32:15.845831    13419.1              0x0060:  00000000 00000000 00000000 414
 
d512e  |............AMQ.|
 
 15:32:15.845831    13419.1              0x0070:  2a000000 00000000 00000000 000
 
00000  |*...............|
 
 15:32:15.845831    13419.1              0x0080:  00000000 00000000 00000000 000
 
00000  |................|
 
 15:32:15.845831    13419.1              0x0090:  00000000 00000000 00000000 000
 
00000  |................|
 
 15:32:15.845831    13419.1              0x00a0:  00000000 00000000 00000000 ff3
 
a0030  |.............:.0|
 
 15:32:15.845831    13419.1              0x00b0:  000000d4 00000000 00000000 000
 
00000  |... ............|
 
 15:32:15.845831    13419.1              0x00c0:  ec301284 0033531c 00000000 000
 
00000  | 0. .3S.........|
 
 15:32:15.845831    13419.1              0x00d0:  00000000 00000000 00000000 000
 
00000  |................|
 
 15:32:15.845831    13419.1              0x00e0:  00000000 00000000 00000000 000
 
00000  |................|
 
 15:32:15.845831    13419.1              0x00f0:  00000000 00000000 0220002a 002
 
0002a  |......... .*. .*|
 
@
 
...
 
 15:32:15.849560    13419.1              0x0140:  3d63f8cf 000ce69e 00000000 000
 
0346b  |=c... ........4k|
 
 15:32:15.849578    13419.1            Options       : Input  Parm
 
 15:32:15.849593    13419.1            Hobj:
 
 15:32:15.849608    13419.1              0x0000:  000a0f80
 
       |. ..            |
 
 15:32:15.849622    13419.1            Compcode:
 
 15:32:15.849638    13419.1              0x0000:  00000002
 
       |....            |
 
 15:32:15.849653    13419.1            Reason:
 
 15:32:15.849668    13419.1              0x0000:  000007f3
 
       |....            |
 
 15:32:15.849683    13419.1       -}! zstMQOPEN rc=MQRC_NOT_AUTHORIZED
 
... | 
   
 
 _________________ +
 
| Barry Goldstein
 
| Ameren Services
 
| Saint Louis, Missouri 
 
| bgoldstein@ameren.com 
 
| (314) 554-4351
 
+ | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | RogerLacroix | 
		  
		    
			  
				 Posted: Wed Aug 21, 2002 8:14 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Jedi Knight
 
 Joined: 15 May 2001 Posts: 3265 Location: London, ON  Canada 
  | 
		  
		    
			  
				Hi,
 
 
2035 is not authorized error.  
 
 
The UserId that the program is running under (on Solaris) is not in the mqm group or did not have the appropriate authorizations added via setmqaut program.
 
 
So, either add the UserId to the mqm group or set the appropriate authorizations with the setmqaut program (using setmqaut is the better solution).
 
 
later
 
Roger... _________________ Capitalware: Transforming tomorrow into today.
 
Connected to MQ!
 
Twitter | 
			   
			 
		   | 
		 
		
		  | 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
  | 
  		 
	   
	 | 
   
 
  	 | 
	  |