« Calling BPEL EJBs from AS 10.1.3 | Main | Tuning Synchronous BPEL Processes »

ORMI Providor URLs

Calling EJBs in AS10g


It seems quite a few people have problems with calling BPEL PM remotely.  These are often related to calling EJBs in an AS10g container and so I thought it might be appropriate to review the AS10g architecture as it relates to EJBs.


Calling an EJB is a matter of looking up the EJB home using JNDI and then invoking the methods to get the bean itself.  Where the bean is looked up depends on the environment of course.  With AS10g we basically have two different environments.


Stand-Alone OC4J


Stand alone OC4J is the environment we run inside JDeveloper or when running OC4J on its own.


In this case OC4J runs inside the JVM with nothing else around it.



Because it is running in an isolated environment then it uses fixed port numbers (23791 for ORMI and 8888 for HTTP by default).  This makes calling it from a client or another container very simple.  The provider URL then takes this form:


ormi://HostName:RmiPortNumber/ApplicationName


Note that the port number is optional if the container is listening for ORMI on the default port of 23791, for example "ormi://wallace.oracle.com/MyApplication" and "ormi://wallace.oracle.com:23791/MyApplication" are equivalent.


AS10g with OPMN


When we have a full AS10g installation then the RMI issue becomes a little more complicated.  In a full installation we have a seperate web server (Oracle HTTP Server based on Apache) that communicates to one or more OC4J instances in the same installation.



In this case the application server by default assigns dynamic ports to the OC4J containers.  The OPMN process keeps track of the ports in use by the application server and dynamically assigns the port numbers when starting up the JVMs.  Instead of listening for HTTP traffic the OC4J containers receives web requests via the HTTP server on their AJP (Apache JServ Protocol) port.


It is possible to configure the application server to use fixed ports, but this can cause problems with restart of failed processes and may cause problems when running multiple JVMs per OC4J container.  Hence it is better to let the app server use dynamic ports.  Because the ports are dynamic we cannot look up EJBs using fixed port numbers.  To address this problem there is another form of the provider URL that we can use.


opmn:ormi://HostName:OpmnPort:OC4JContainerName/ApplicationName


If the OPMN process is listening on the default port of 6003 then the port number may be ommitted, for example "opmn:ormi://wallace.oracle.com:MyContainer/MyApplication" and "ormi://wallace.oracle.com:6003:MyContainer/MyApplication" are equivalent.  The application server may have more than one OC4J container and the name is used to identify the specific container.  Note that a container may have more than one JVM running.


Hopefully this clears up what the provider URL should look like.

Comments (2)

Sean:

Shouldn't the URL format be opmn:ormi://hostname:6003:container/app Note the colon after the port number.

Antony Reynolds:

Quite right, I've corrected it now.   Thats what I get for not pasting in from working code!
Antony

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on March 9, 2006 11:43 AM.

The previous post in this blog was Calling BPEL EJBs from AS 10.1.3.

The next post in this blog is Tuning Synchronous BPEL Processes.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type and Oracle