Hello all.
I'm relatively new to WebSphere, so pardon my ignorance if it is apparent.
I've created a WS MQ Connection Factory from the WS MQ JMS Provider page. I used all of the default settings, other than the name (autopolicyQCF) and the JNDI name, which I named identically (autopolicyQCF). Note that it was created under the scope of "Server", as opposed to Cell or Node.
Easy enough, right? Next, I wrote a simple, standalone, non-J2EE client that I'm using to lookup my qcf. No matter what I try, I can't seem to find my QCF. I've burned about 2 days trying to figure this out, and my Google searches haven't yielded much more than a list of people who are frustraed with trying to do the same thing. Oh, and I tried the same client with a normal WebSphere JMS Provider, but got the same results.
Any help you can give is greatly appreciated, either through this posting or my email address (JeffreyStickel@fairisaac.comm). Thanks!!
Here is the run() method of my class:
public void run() {
// Set up config for Initial Context
Properties props = new Properties();
props.put( Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory" );
props.put( Context.PROVIDER_URL, "corbaloc:iiop:localhost:2809");
// Get Initial Context for resource lookup;
InitialContext ctx = null;
try {
ctx = new InitialContext( props );
System.out.println( "Have context: " + ctx.getNameInNamespace() );
}
catch( NamingException e ) {
System.out.println( e );
return;
}
// Get Establish a QueueConnectionFactory for connecting to reply/response queues
// Lookup fails on all names unless otherwise specified in my // comments.
String resourceName = "java:comp/env/autopolicyQCF"; // Fails for non-J2EE Client
resourceName = "jms/autopolicyQCF";// Fails
resourceName = "JMS/autopolicyQCF";// Fails
resourceName = "JEFFSTICKEL";// Fails
resourceName = "cell/nodes/JEFFSTICKEL/servers/server1/JMS/autopolicyQCF"; // Fails
resourceName = "nodes/JEFFSTICKEL/servers/server1";// Fails
resourceName = "JMS/mq/EmployeeDetailsQcf";// Fails
resourceName = "DefaultDatasource";// This one works.
resourceName = "cell/nodes/JEFFSTICKEL/servers/server1"; // This one works.
resourceName = "autopolicyQCF";// Fails
try {
Object obj = ctx.lookup( resourceName ) ;
System.out.println( "Have resource " + resourceName + " of type " + obj.getClass().getName() );
} catch (Exception ex) {
System.out.println( "Unable to lookup resource: " + resourceName + ": " + ex);
ex.printStackTrace();
}
}
... and here is the output.
Have context: JEFFSTICKEL/nodes/JEFFSTICKEL/servers/server1
javax.naming.NameNotFoundException: Context: JEFFSTICKEL/nodes/JEFFSTICKEL/servers/server1, name: ejb/AutoPolicyRulesServer: First component in name AutoPolicyRulesServer not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound
Unable to lookup resource: ejb/AutoPolicyRulesServer: javax.naming.NameNotFoundException: Context: JEFFSTICKEL/nodes/JEFFSTICKEL/servers/server1, name: ejb/AutoPolicyRulesServer: First component in name AutoPolicyRulesServer not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound]
at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:48)
at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(Unknown Source)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:3491)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1519)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1480)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1187)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1067)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at com.fi.kahg.policydata.AutoPolicyTestClient.run(AutoPolicyTestClient.java:67)
at com.fi.kahg.policydata.AutoPolicyTestClient.main(AutoPolicyTestClient.java:80)