Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 962457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:30:32+00:00 2026-05-16T01:30:32+00:00

I am running a simple Java client to connect to a remote MQ queue.

  • 0

I am running a simple Java client to connect to a remote MQ queue.

  1. When I run the Java code to read write messages with Alias queue name, it works fine.

  2. When i try to run the code on the same queue but witha a physical queue name (Because i wish to invoke getQueueDepth), I get a 2035 error at the point when the code tries to establish a connection

The authority on the queue are:
browse +dsp +get +inq +put +set +setall

The java code is as under

import com.ibm.mq.MQC;
import com.ibm.mq.MQEnvironment;
import com.ibm.mq.MQException;
import com.ibm.mq.MQGetMessageOptions;
import com.ibm.mq.MQMessage;
import com.ibm.mq.MQPutMessageOptions;
import com.ibm.mq.MQQueue;
import com.ibm.mq.MQQueueManager;
public class MQSniffer {

/**
 * @param args
 */
/**
 * @param args
 */
public static void main(String[] args) {
    String hostname = "XXXX";     
    String channel  = "CHANNEL";  
    String qManager = "qmgr";  

    MQQueueManager qMgr;                      


    MQEnvironment.hostname = hostname;          
    MQEnvironment.channel  = channel;            
    MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES);

    try {  
    qMgr = new MQQueueManager(qManager);  

    int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_INQUIRE | MQC.MQOO_OUTPUT ;

    MQQueue system_default_local_queue =  
    qMgr.accessQueue("PHYSICAL_QUEUE_NAME",  // *****Get an exception on this call*****
    openOptions,  
    null,           
    null,            
    null);           

    System.out.println("****Current Depth is "+ system_default_local_queue.getCurrentDepth());

    MQMessage hello_world = new MQMessage();  
    hello_world.writeUTF("Hello World!");  


    MQPutMessageOptions pmo = new MQPutMessageOptions();   


    system_default_local_queue.put(hello_world,pmo);  
    System.out.println("Put the message");


    system_default_local_queue.close();  

    // Disconnect from the queue manager  

    qMgr.disconnect();  

    }  

    catch (MQException ex)  
    {  
    System.out.println("An MQSeries error occurred : Completion code " +  
    ex.completionCode +  
    " Reason code " + ex.reasonCode);  

    ex.printStackTrace();
    }  
    catch (java.io.IOException ex)  
    {  
    System.out.println("An error occurred whilst writing to the  message buffer: " + ex);  
    }  



}

}


om.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2035
at com.ibm.mq.MQQueueManager.accessQueue(MQQueueManager.java:2858)
at org.ku.benchmarkos.MQSniffer.main(MQSniffer.java)

Any help is appreciated!

Thanks
J

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T01:30:33+00:00Added an answer on May 16, 2026 at 1:30 am

    WMQ checks permissions on the first object encountered. So if you open an alias, the permissions are checked on the alias and not the base queue. If you open a base queue, the permissions are checked on the base queue and not on any aliases that may point to it. There is no expectation that the ability to open an alias implies an ability to open the base queue. One would need to run setmqaut against both the alias and the base queue with the appropriate permissions.

    I have a longer explanation posted here: Understanding WebSphere MQ authorization and the setmqaut command.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 499k
  • Answers 500k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This is not pretty but it works: rm -R $(ls… May 16, 2026 at 12:45 pm
  • Editorial Team
    Editorial Team added an answer Yes. Override the base1 and base2 methods in Derived to… May 16, 2026 at 12:45 pm
  • Editorial Team
    Editorial Team added an answer No, you can't. Unfortunately, UIEvent doesn't expose any public way… May 16, 2026 at 12:45 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

How do I develop apps that run on Orkut.com using the OpenSocial java client
On my system I can't run a simple Java application that start a process.
I am trying to make a simple TCP client and host chat program in
Suppose I have some PHP code running inside a web server, for example, running
I've been developing a minimalistic Java rich client CRUD application framework for the past
i'm developing an application running on WebLogic 10 and of course in java. Ok,
Now we have a project with java 1.4 and ejb 2.1 running on jboss
this problem is killing me, here is my code import java.text.ParseException; import java.text.SimpleDateFormat; import
I an issue that has me completely stumped. I am simply running a simple
I am having trouble trying to connect to a secure OpenLDAP server which I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.