ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » calling EJB from JavaComputeNode

Post new topic  Reply to topic
 calling EJB from JavaComputeNode « View previous topic :: View next topic » 
Author Message
covxr5
PostPosted: Sun Oct 01, 2006 5:47 am    Post subject: calling EJB from JavaComputeNode Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Sun Oct 01, 2006 10:21 am    Post subject: Reply with quote

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
View user's profile Send private message
covxr5
PostPosted: Sun Oct 01, 2006 2:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Sun Oct 01, 2006 3:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
covxr5
PostPosted: Tue Oct 17, 2006 6:20 am    Post subject: Resolved Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » calling EJB from JavaComputeNode
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.