Monday, September 29, 2008

JARs for BPEL Java API

What forced me into it?

To get the BPEL Java API working the first thing to do is to have the java class be available for you to code.
And to get these classes into your work space, what else but include the libs.
Every time I do this I Google. I am either very bad at Google or there are not many people who write about this.
Now I want this as a reference for myself, and also for those who want the list.

What are the jars that I included? And why in that Order?

The first jar that I included was orabpel.jar
For what other reason that the fact that it has what I need.
And what I need to start is Locator.
To be more specific I need com.oracle.bpel.client.Locator class

Is this jar enough?

Well if you think this is enough then it is time for you to run and see for yourself.
Do not be surprised to get error that looks like this
Exception in thread "main" java.lang.NoClassDefFoundError: javax/ejb/EJBException

Make this error disappear?

How else but include the jar that has this class. And the jar is ejb.jar
I think now it is time to run this and see for your self.

Whatz the next error?

Well you have gussed it right. There is another error that comes up.
This time round it looks like this
Exception in thread "main" java.lang.NoClassDefFoundError: com/collaxa/common/util/NonSyncPrintWriter
at com.oracle.bpel.client.util.ExceptionUtils.handleServerException(ExceptionUtils.java:82)
at com.oracle.bpel.client.Locator.getFinder(Locator.java:962)
.......

Caused by: java.lang.NoClassDefFoundError: com/collaxa/common/util/NonSyncPrintWriter
at com.oracle.bpel.client.util.BeanRegistry.lookupFinderBean(BeanRegistry.java:351)
at com.oracle.bpel.client.Locator.getFinder(Locator.java:956)

...

Make this error disappear? And next error appears.

How else but include the jar that has this class. And the jar is orabpel-common.jar
You know what time this is. Yes run time. So letz see te next error.

The next error you might be seeing is

Exception in thread "main" java.lang.Exception: Failed to create "ejb/collaxa/system/FinderBean" bean; exception reported is: "javax.naming.NoInitialContextException: Cannot instantiate class: com.evermind.server.rmi.RMIInitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.evermind.server.rmi.RMIInitialContextFactory]
....

Caused by: java.lang.ClassNotFoundException: com.evermind.server.rmi.RMIInitialContextFactory
...


Make this error disappear? And...

This time round I include the jar oc4j-internal.jar

The next error you might be seeing is
Exception in thread "main" java.lang.NoClassDefFoundError: oracle/ias/opmn/optic/OpticException
...
Caused by: java.lang.NoClassDefFoundError: oracle/ias/opmn/optic/OpticException
...


Make this error disappear? And...

This time round I include the jar optic.jar

The next error you might be seeing is nothing....

What was the code that I ran?

There might be other jars that need to be included based on what is that you want the Java do perfom.
But the java code that I ran is for undeploying BPEL process.
The code is in the post
http://oraclebpelindepth.blogspot.com/2008/09/undeploy-bpel-with-java.html

9 comments:

Anonymous said...

Thanks a lot! it appears that the only way to solve that Naming exception is including those jars. How did you know that the solution was to include them?

Regards,

Leo Albornoz
Chile.

Kalidass Mookkaiah said...

To be frank it was the hard way. Did not include any jars. Then solved one problem at a time. And yes you can also explore the jars that oracle provides. :)

Amith said...

Can we use deployment plans during deployment of bpel in this way?

Kalidass Mookkaiah said...

Can you explain as how you want to use this for deployment plan please?

Amith said...

Using Ant we can deploy a BPEL process. during deployment we can use of the deployment plan to change any configuration of the BPEL process. So can i make use of the deployment plan and deploy the process in java ( using the jar or apis you suggested)

Kalidass Mookkaiah said...

If you mean use java to run the ANT tasks, yes you can.
These jars are for using the BPEL java APIs.

Amith said...

can you kindly tell which jar's and api's i can use to run the ant tasks and then deploy the BPEL process? i searched the oracle documentation but didnt find any.

Kalidass Mookkaiah said...

The jar for executing ANT tasks are provided by Jakarta Ant.

You can find these in ${OracleAS_HOME}\ant\lib

A good reference to do this can be found here.
http://www.onjava.com/pub/a/onjava/2002/07/24/antauto.html

Amith said...

Using these jar's i can attach the deployment plan to the suitcase and then deploy the BPEL process(suitcase) in way similar to your example. Hope this will work. Thanks a lot