Author |
Message
|
MaheshPN |
Posted: Tue Sep 19, 2006 8:24 am Post subject: WID - Using Process API's in Java snippet |
|
|
 Master
Joined: 21 May 2003 Posts: 245 Location: Charlotte, NC
|
Hi guys,
I am trying to make a query using Process API's (bpe.api) in the java snippet.
I tried
LocalBusinessFlowManagerHome bfmHome =(LocalBusinessFlowManagerHome)ServiceManager.INSTANCE.locateService("com/ibm/bpe/api/BusinessFlowManagerHome");
and
Object object = context.lookup("com/ibm/bpe/api/BusinessFlowManagerHome");
None of them works. Does anybody tried to call the API's in java snippet?.
If you were succesful, please share.
Thanks,
-Mahesh |
|
Back to top |
|
 |
jmac |
Posted: Tue Sep 19, 2006 8:39 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Mahesh:
I have not done exactly what you are asking, but have called a static class which accesses the BFM using code like this:
Code: |
javax.naming.Context ctx = new javax.naming.InitialContext();
Object obj = ctx.lookup(
"local:ejb/com/ibm/bpe/api/BusinessFlowManagerHome");
com.ibm.bpe.api.LocalBusinessFlowManagerHome fmh = (com.ibm.bpe.api.LocalBusinessFlowManagerHome)
javax.rmi.PortableRemoteObject.narrow(
obj,
com.ibm.bpe.api.LocalBusinessFlowManagerHome.class
);
_bfm = fmh.create(); |
_________________ John McDonald
RETIRED |
|
Back to top |
|
 |
chintu |
Posted: Tue Sep 19, 2006 8:44 am Post subject: Look in the Universal Test Client |
|
|
 Acolyte
Joined: 27 Dec 2004 Posts: 64
|
Can you see com/ibm/bpe/api/BusinessFlowManagerHome in the universal test client?
If you dont..do you see any relevant entries? like comp/env/ejb/LocalBusinessFlowManagerHome? |
|
Back to top |
|
 |
vennela |
Posted: Tue Sep 19, 2006 8:58 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Quote: |
None of them works |
Meaning what?
You getting any compilation/build error
Any runtime error? |
|
Back to top |
|
 |
MaheshPN |
Posted: Tue Sep 19, 2006 10:37 am Post subject: |
|
|
 Master
Joined: 21 May 2003 Posts: 245 Location: Charlotte, NC
|
John,
You are right. I was able to query using web application. I was trying to use the same in the java snippet.
The error I get is,
for
LocalBusinessFlowManagerHome bfmHome =(LocalBusinessFlowManagerHome)ServiceManager.INSTANCE.locateService("com/ibm/bpe/api/BusinessFlowManagerHome");
[9/18/06 17:30:14:435 EDT] 0000009e SystemErr R java.lang.ClassCastException: Unable to load class: com.ibm.bpe.api._BusinessFlowManagerHome_Stub
at com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:371)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:157)
at apitestsample.APIProcess20060915T182359EntityAbstractBase$JSE_7.execute(APIProcess20060915T182359EntityAbstractBase.java:44)
And for Object object = context.lookup("com/ibm/bpe/api/BusinessFlowManagerHome
9/18/06 17:30:14:435 EDT] 0000009e SystemErr R java.lang.ClassCastException: Unable to load class: com.ibm.bpe.api._BusinessFlowManagerHome_Stub
at com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:371)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:157)
Hope this helps.
Thanks,
-Mahesh |
|
Back to top |
|
 |
vennela |
Posted: Tue Sep 19, 2006 10:52 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
You will have to add the bpel jars (don't remember all the jar names) into your runtime classpath (not build classpath).
Search in the IBM website I am sure you will hit across the exact same error |
|
Back to top |
|
 |
MaheshPN |
Posted: Tue Sep 19, 2006 11:04 am Post subject: |
|
|
 Master
Joined: 21 May 2003 Posts: 245 Location: Charlotte, NC
|
I think,
John's suggestion worked!!!
old code
lookup( "com/ibm/bpe/api/BusinessFlowManagerHome")
New code
lookup( "local:ejb/com/ibm/bpe/api/BusinessFlowManagerHome");
I don't know what are those two means exactly. But by adding it to the lookup it worked!!.
John, if I need to access from the remove process(Running on other server) do I need to replace 'local' with 'remote'?
Thanks for the replies.
-Mahesh |
|
Back to top |
|
 |
jmac |
Posted: Sat Oct 14, 2006 7:31 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
MaheshPN wrote: |
John, if I need to access from the remote process(Running on other server) do I need to replace 'local' with 'remote'?
|
Mahesh:
Sorry, but I am out of my league on this kind of stuff... I am a 360 Assembly Language guy struggling to keep up with all of this new stuff.
I am fine with Java, but all of these J2EE concepts are magic to me. I would say give it a shot... and of course let me know the results. That way, I know I can just search for this thread the next time I need to do the same thing. This way we help each other  _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
|