What forced me into it?
Undeploying BPEL process from BPEL Console is a nightmare especially when you have many environments. And with each test cycle, the environment is refreshed and recreated.
It takes hell a lot of time and AS admin time to get this. (Well these admin guy are always short of time with their hand full of work)
Best option, automate the process. So I have small piece of code that I have pulled.
You will be surprised how short this is?
package bpelUndeployment;
import java.util.Properties;
import com.oracle.bpel.client.BPELProcessId;
import com.oracle.bpel.client.IBPELDomainHandle;
import com.oracle.bpel.client.Locator;
import com.oracle.bpel.client.ServerException;
/**
* @author Kalidass Mookkaiah
*/
public class UnDeployBPELProcess {
public static void main(String[] args) throws ServerException {
//Properties with BPEL server connection information
Properties props = new Properties();
props.put("orabpel.platform", "ias_10g");
props.put("java.naming.factory.initial", "com.evermind.server.rmi.RMIInitialContextFactory");
props.put("java.naming.provider.url", "opmn:ormi://hostname:6008:home/orabpel");
props.put("java.naming.security.principal", "oc4jadmin");
props.put("java.naming.security.credentials", "oc4jadmin");
props.put("dedicated.connection","true");
//Get a locator in default domain
Locator locator = new Locator("default","welcome1",props);
//Get a handle to the domain
IBPELDomainHandle iBPELDomainHandle = locator.lookupDomain();
//Undeploy this process from default domain
iBPELDomainHandle.undeployProcess(new BPELProcessId("default","MyUndeployedBPELProcess"));
}
}
Explanation!!!
If you do not know that the properties mean, see this post
http://oraclebpelindepth.blogspot.com/2008/08/bpel-context-properties-for-client-api.html
Well if you have read the above post then you know what the Properties are for.
In one word it is values to connect to the AS server.
Use the locator to get a handle to the domain.
Use this handle to perform undeployment.
Here I have used the BPELProcessId class to identify the domain and ProcessName.
The ProcessName should match exactly.
What about versioned BPEL process?
Help your self.
But what I can hint you with is this.
The Class BPELProcessId has overloaded constructor.
3 of them.
One takes domain and processID
Other takes domain, processID and revision Tag.
There is another one tooo with domain, processID, revision Tag and process GUID.
Happy hunting with the overloaded constructors.
And don't forget to run the code ;)
What Jars to include?
And if you are looking to find the jars to include to run this see the link
http://oraclebpelindepth.blogspot.com/2008/09/jars-for-bpel-java-api.html
Showing posts with label Java API. Show all posts
Showing posts with label Java API. Show all posts
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
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
Labels:
Java API
Friday, August 15, 2008
BPEL context properties for Client API invocation
Java Class Locator
"Locator" class Java APIs are used to connect to oracle BPEL.
The locator requires a BPEL Context properties to be loaded as parameter as part of the Locator initialization. So I need to know what the properties looks like.
Properties looks like this
The propeties should look like
=================properties file START===========================================
orabpel.platform={Oracle Application Server Platform}
java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
java.naming.provider.url=opmn:ormi://{hostname}:{port}:{oc4jinstance}/orabpel
java.naming.security.principal={username}
java.naming.security.credentials={password}
=================properties file END=============================================
Sample properties
=================properties file START=======================================
orabpel.platform=ias_10g
java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
java.naming.provider.url=opmn:ormi://localhost:6003:home/orabpel
java.naming.security.principal=oc4jadmin
java.naming.security.credentials=welcome1
=================properties file END=========================================
Where do I find the property values?
There are multiple ways to identify what the these property values are.
One of the easiest wasy is through the BPEL Console. Here is how I do it.
Open the BPEL console --> Click Goto BPEL Admin --> Login to the Admin console
The default page that opens is SERVER --> under the tab Configuration
the following value correspond to the following property
"jndiProviderURL" = "java.naming.provider.url"
"bpelPlatform" = "orabpel.platform"
"Locator" class Java APIs are used to connect to oracle BPEL.
The locator requires a BPEL Context properties to be loaded as parameter as part of the Locator initialization. So I need to know what the properties looks like.
Properties looks like this
The propeties should look like
=================properties file START===========================================
orabpel.platform={Oracle Application Server Platform}
java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
java.naming.provider.url=opmn:ormi://{hostname}:{port}:{oc4jinstance}/orabpel
java.naming.security.principal={username}
java.naming.security.credentials={password}
=================properties file END=============================================
Sample properties
=================properties file START=======================================
orabpel.platform=ias_10g
java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
java.naming.provider.url=opmn:ormi://localhost:6003:home/orabpel
java.naming.security.principal=oc4jadmin
java.naming.security.credentials=welcome1
=================properties file END=========================================
Where do I find the property values?
There are multiple ways to identify what the these property values are.
One of the easiest wasy is through the BPEL Console. Here is how I do it.
Open the BPEL console --> Click Goto BPEL Admin --> Login to the Admin console
The default page that opens is SERVER --> under the tab Configuration
the following value correspond to the following property
"jndiProviderURL" = "java.naming.provider.url"
"bpelPlatform" = "orabpel.platform"
Labels:
Java API
Subscribe to:
Posts (Atom)