|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Getting error in getLocalInstance of class Broker Proxy |
« View previous topic :: View next topic » |
Author |
Message
|
jkr |
Posted: Tue Apr 19, 2016 2:28 am Post subject: Getting error in getLocalInstance of class Broker Proxy |
|
|
Novice
Joined: 19 Apr 2016 Posts: 10
|
I have made a user defined configurable service ,and I am accessing it through java code which is in turn called by an esql wrapper. My java code looks something like this:
Code: |
public class ConfigService_Java {
public static String getUserDefinedConfigServProp(String cs){
String rs = "exception occurred: ";
try{
BrokerProxy bp = BrokerProxy.getLocalInstance("My Broker");
short c = 0;
while(!bp.hasBeenPopulatedByBroker()){
try{
c++;
Thread.sleep(100);
}catch(InterruptedException e){
return rs+e.toString();
}
if(c > 4)
return rs+"timed out";
}
try{
ConfigurableService udcs = bp.getConfigurableService("UserDefined",cs);
// ConfigurableService[] udcs = bp.getConfigurableService("UserDefined");
// String[] props = udcs.getProperties()
Properties props = udcs.getProperties();
String out = "";
for(String key : props.stringPropertyNames()){
out = out + key + "=" + props.getProperty(key) + ",";
}
if(out.length() > 0)
rs=out.substring(0,out.length()-1);
else
rs=rs+"no properties returned";
}catch(Exception e){
return rs+e.toString();
}
}catch(Exception e){
return rs+e.toString();
}
return rs;
}
} |
While I debug my flow,it gives me a source not found error when it reaches the line,
BrokerProxy bp = BrokerProxy.getLocalInstance("My Broker");
The broker is present on my local machine. Am I missing something? Why is it not able to connect to the broker? |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Apr 21, 2016 7:47 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Remember that case matters! and Broker is not the same as broker!!  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jkr |
Posted: Thu Apr 21, 2016 10:32 pm Post subject: |
|
|
Novice
Joined: 19 Apr 2016 Posts: 10
|
I am sorry I forgot to post the error. I was getting MQ error 2035 because of the line
BrokerProxy bp = BrokerProxy.getLocalInstance("My Broker");
The error read 'System is not authorized to access the Queue manager'
I tried using the following commands
alter channel(SYSTEM.BKR.CONFIG) chltype(SVRCONN) mcauser('SYSTEM')
refresh security
But it did not work
So for the time being I have disabled channel authority by using command ALTER QMGR CHLAUTH(DISABLED).
Any suggestions on how I can enable channel authority for some users and block for others? |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Apr 22, 2016 1:35 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
jkr wrote: |
Any suggestions on how I can enable channel authority for some users and block for others? |
Enable CHLAUTH thus disabling it for everyone and then grant specific users access to the channel. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
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
|
|
|
|