|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
calling EJB from JavaComputeNode |
« View previous topic :: View next topic » |
Author |
Message
|
covxr5 |
Posted: Sun Oct 01, 2006 5:47 am Post subject: calling EJB from JavaComputeNode |
|
|
Novice
Joined: 10 Apr 2006 Posts: 10
|
Hello,
I am trying to call EJB from JavaComputeNode to enrich the message and I am getting error:
"Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory"
Code Snippet:
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
p.put(Context.PROVIDER_URL,"iiop://localhost:2809");
InitialContext ic = new InitialContext(p);
Object tmpObj = (Object) ic.lookup("ejb/ejbs/SimpleSessionHome");
SimpleSessionHome home = (SimpleSessionHome) PortableRemoteObject.narrow(tmpObj,SimpleSessionHome.class);
SimpleSession ss = home.create();
SqrtBean result = ss.getSuqareRoot(81);
System.out.println(result.getResultValue());
I have the following jar files in MQSI classes folder:
j2ee.jar, implfactory.jar, naming.jar, namingclient.jar, namingserver.jar
I would appreciate any help, who had already gone through this path, in identifying other jar required to make EJB work within WMQI/WMB.
Thanks in advance. |
|
Back to top |
|
 |
jefflowrey |
Posted: Sun Oct 01, 2006 10:21 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You should install a full WAS Application Client on the Broker machine. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
covxr5 |
Posted: Sun Oct 01, 2006 2:50 pm Post subject: |
|
|
Novice
Joined: 10 Apr 2006 Posts: 10
|
jefflowery, I have RAD V6 installed on the windows machine (that has broker also). How do I make broker runtime aware of websphere j2ee client libraries? |
|
Back to top |
|
 |
jefflowrey |
Posted: Sun Oct 01, 2006 3:31 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Using CLASSPATH.
The easiest thing to do might be to COPY mqsiprofile.cmd, to save a backup, and then edit it to call the appropriate setupCmdLine.bat from one of the WAS runtimes.
But please note that RAD is not remotely like the WAS Application Client, and is not at all what I meant. There is a separate installer for the WebSphere J2EE Application Client (or maybe it's JEE these days?) that comes with WAS and not with RAD.
The correct thing to do is carefully re-read the documentation for the JMSInput and JMSOutput nodes, and copy all the jars you can think are apporpriate into the shared-classes folder of the Broker runtime (NOT your Toolkit!). _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
covxr5 |
Posted: Tue Oct 17, 2006 6:20 am Post subject: Resolved |
|
|
Novice
Joined: 10 Apr 2006 Posts: 10
|
added Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader() before getting InitialContext and it worked.
I was told by IBM that this will be taken care of in FP3. |
|
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
|
|
|
|