Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

invoke bpel from java - Failed to create "ejb/collaxa/system/DeliveryBean

432354Oct 24 2006 — edited Oct 25 2006
Hi,

I have a very simple java class to invoke CreditRatingProcess sample:
----
String ssn = null;
if (ssn == null)
ssn = "123-12-1234";
String xml =
"<ssn xmlns=\"http://services.otn.com\">" + ssn + "</ssn>";
Locator locator = new Locator("default", "oc4jadmin", "localhost");
IDeliveryService deliveryService =
(IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME);
// construct the normalized message and send to Oracle BPEL Process Manager
NormalizedMessage nm = new NormalizedMessage();
nm.addPart("payload", xml);
NormalizedMessage res =
deliveryService.request("CreditRatingService", "process", nm);
Map payload = res.getPayload();
System.out.println("BPELProcess CreditRatingService executed!<br>");
System.out.println("Credit Rating is " + payload.get("payload"));
--------

When I try to execute, I have the following error:
java.lang.Exception: Failed to create "ejb/collaxa/system/DeliveryBean" bean; exception reported is: "javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.oracle.bpel.client.util.BeanRegistry.lookupDeliveryBean(BeanRegistry.java:279)
at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:250)
at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:83)
at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:53)
at docsdemo.bpelapi.BPELProcess.callProcess(BPELProcess.java:84)
at docsdemo.bpelapi.tests.Test1.<init>(Test1.java:14)
at docsdemo.bpelapi.tests.Test1.main(Test1.java:18)
".
at com.oracle.bpel.client.util.BeanRegistry.lookupDeliveryBean(BeanRegistry.java:293)
at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:250)
at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:83)
at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:53)
at docsdemo.bpelapi.BPELProcess.callProcess(BPELProcess.java:84)
at docsdemo.bpelapi.tests.Test1.<init>(Test1.java:14)
at docsdemo.bpelapi.tests.Test1.main(Test1.java:18)

I use SOA suite 10.1.3 Developer Preview and JDeveloper 10.1.3

Can you help me?
Cyryl

Message was edited by:
cbalmati

Message was edited by:
cbalmati

Comments

450482
Hi
This constructor for Locator is if you are trying to invoke BPEL process on the same host as where orabpel application is deployed and you define your application to be child application of orabpel application. If you'd like to connect to remote host to invoke BPEL, try public Locator(java.lang.String domainId,
java.lang.String password,
java.lang.String ipAddress,
java.util.Hashtable pInitialContextProperties)

Hope this helps,
^_^
432354
Hi,

Thanks fro your answer. But it does not work ...
My demo runs on my laptop (SOA10.1.3 DP / JDeveloper 10.1.3)

This is my code:
public void test() {
String xml = "<name xmlns=\"http://samples.otn.com/helloworld\">" + "test" + "</name>";

Hashtable jndi = null;
jndi = new Hashtable();

// Change the PROVIDER_URL to your BPEL PM host...
jndi.put(Context.PROVIDER_URL, "ormi://localhost/orabpel");
jndi.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
jndi.put(Context.SECURITY_PRINCIPAL, "admin");
jndi.put(Context.SECURITY_CREDENTIALS, "welcome");
jndi.put("dedicated.connection", "true");


Locator locator = null;
try {
locator = new Locator("default","bpel", jndi);
} catch (ServerException e) {
e.printStackTrace();
}
IDeliveryService deliveryService = (IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );

// construct the normalized message and send to Oracle BPEL Process Manager
NormalizedMessage nm = new NormalizedMessage( );


System.out.println(xml);
nm.addPart("payload" , xml );


try {
deliveryService.post("HelloWorld", "initiate", nm);
} catch (ServerException e) {
e.printStackTrace();
} catch (RemoteException e) {
e.printStackTrace();
}
}

and that's my error:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/ejb/EJBException
at com.oracle.bpel.client.util.ExceptionUtils.handleServerException(ExceptionUtils.java:76)
at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:254)
at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:174)
at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:149)
at docsdemo.ui.XMLMessageHelper.test(XMLMessageHelper.java:62)
at docsdemo.ui.tests.Tests.<init>(Tests.java:15)
at docsdemo.ui.tests.Tests.main(Tests.java:20)

I don't understand because I created a simple JSP to invoke helloWorld process (same code), it's works !!

Any suggestion?
Cyryl
1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 22 2006
Added on Oct 24 2006
2 comments
1,055 views