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 » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » WID - Using Process API's in Java snippet

Post new topic  Reply to topic
 WID - Using Process API's in Java snippet « View previous topic :: View next topic » 
Author Message
MaheshPN
PostPosted: Tue Sep 19, 2006 8:24 am    Post subject: WID - Using Process API's in Java snippet Reply with quote

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
View user's profile Send private message
jmac
PostPosted: Tue Sep 19, 2006 8:39 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
chintu
PostPosted: Tue Sep 19, 2006 8:44 am    Post subject: Look in the Universal Test Client Reply with quote

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
View user's profile Send private message
vennela
PostPosted: Tue Sep 19, 2006 8:58 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
MaheshPN
PostPosted: Tue Sep 19, 2006 10:37 am    Post subject: Reply with quote

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
View user's profile Send private message
vennela
PostPosted: Tue Sep 19, 2006 10:52 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
MaheshPN
PostPosted: Tue Sep 19, 2006 11:04 am    Post subject: Reply with quote

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
View user's profile Send private message
jmac
PostPosted: Sat Oct 14, 2006 7:31 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » WID - Using Process API's in Java snippet
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.