Author |
Message
|
Saraswathy |
Posted: Tue Jun 01, 2004 9:29 pm Post subject: WMQI 2.1 , Call EJB method from java plugin node |
|
|
Newbie
Joined: 01 Jun 2004 Posts: 9
|
I have a java plugin node that makes a call to an EJB method. The bean is deployed on WAS 5.0
An exception is raised when I try to retrieve the initial context.
b4 context
exe Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory
Broker is on z/OS , WMQI 2.1.
I have faced this issue with HP UX too. Has anyone got this working ? _________________ ----------------------------------
Saraswathy
IBM Certified Solution Designer - WebSphere MQ
IBM Certified Specialist -MQSeries |
|
Back to top |
|
 |
kirani |
Posted: Tue Jun 01, 2004 10:28 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Do you get this error at deploy time or at runtime?
Are there more errors logged into system error log? Is your classpath set correctly? _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
Saraswathy |
Posted: Wed Jun 02, 2004 3:15 am Post subject: |
|
|
Newbie
Joined: 01 Jun 2004 Posts: 9
|
kirani wrote: |
Do you get this error at deploy time or at runtime?
Are there more errors logged into system error log? Is your classpath set correctly? |
I get this error at runtime, when i put a message and the evaluate method is executed.
This is my code in evaluate
public void evaluate(MbMessageAssembly assembly, MbInputTerminal in)
throws MbException
{
System.out.println("Start Of Evaluate");
try {
File elogFile = new File ("/tmp/mfplugin.log");
PrintStream elog = new PrintStream (new FileOutputStream (elogFile), true);
System.setOut (elog);
MbMessage glb_env = assembly.getGlobalEnvironment();
System.out.println("After MnMessage");
MbElement mbElem_env = glb_env.getRootElement();
System.out.println("After MbElement");
String name = (String)((mbElem_env.getLastChild()).getName());
System.out.println("Element Name " + name);
MbElement mbElem_env1 =
mbElem_env.getFirstElementByPath("/Variables/MyVar");
String val = (String)mbElem_env1.getValue();
System.out.println("Element Val " + val);
System.out.println("Test the new jar " );
Hashtable env = new Hashtable();
env.put( Context.INITIAL_CONTEXT_FACTORY,INITIAL_CONTEXT_FACTORY );
env.put( Context.PROVIDER_URL, "iiop://10.100.81.3:2809");
System.out.println("b4 context");
Context cxt = new InitialContext( env );
System.out.println("after context");
System.out.println("before lookup");
Object obj = cxt.lookup("cell/nodes/test/HelloWorldHome");
System.out.println("af lookup");
System.out.println("The Class Name is");
System.out.println(obj.getClass().getName());
HelloWorldHome home =
(HelloWorldHome) PortableRemoteObject.narrow(
obj,
HelloWorldHome.class);
System.out.println("To create remote : " );
HelloWorld bean = home.create();
System.out.println("Invoking Bean Function");
System.out.println(bean.hello(val));
System.out.println("After a call to Bean Function");
}catch( Exception exe ){
System.out.println("exe " + exe.getMessage());
exe.printStackTrace();
} _________________ ----------------------------------
Saraswathy
IBM Certified Solution Designer - WebSphere MQ
IBM Certified Specialist -MQSeries |
|
Back to top |
|
 |
JLRowe |
Posted: Wed Jun 02, 2004 4:42 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
I would suggest you get the ejb call working as a standalone client first, before implementing as a plugin. |
|
Back to top |
|
 |
Saraswathy |
Posted: Wed Jun 02, 2004 7:19 am Post subject: |
|
|
Newbie
Joined: 01 Jun 2004 Posts: 9
|
jlrowe wrote: |
I would suggest you get the ejb call working as a standalone client first, before implementing as a plugin. |
Yes , It works fine from a standalone program _________________ ----------------------------------
Saraswathy
IBM Certified Solution Designer - WebSphere MQ
IBM Certified Specialist -MQSeries |
|
Back to top |
|
 |
JLRowe |
Posted: Wed Jun 02, 2004 8:47 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
Well, in that case you've probably got jar's missing from the jplugin directory that contain the JNDI provider.
Check the classpath for your standalone program, and make sure everything is present in the jplugin directory. |
|
Back to top |
|
 |
Saraswathy |
Posted: Thu Jun 03, 2004 9:27 pm Post subject: |
|
|
Newbie
Joined: 01 Jun 2004 Posts: 9
|
jlrowe wrote: |
Well, in that case you've probably got jar's missing from the jplugin directory that contain the JNDI provider.
Check the classpath for your standalone program, and make sure everything is present in the jplugin directory. |
Tried it on Windows Broker , I used the 'interact with desktop option to see the system messages' it hangs after printing b4 context.
Why do u say the 'jplugin ' directory? I have only the java node jar in the jplugin folder and the rest are in the classes folder where wmqi system jars are present.Does'nt it load from there? _________________ ----------------------------------
Saraswathy
IBM Certified Solution Designer - WebSphere MQ
IBM Certified Specialist -MQSeries |
|
Back to top |
|
 |
JLRowe |
Posted: Fri Jun 04, 2004 5:59 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
Put it in jplugin, that's where it belongs. |
|
Back to top |
|
 |
|