Tuesday, April 25, 2006

Multiple OC4J containers on one server

In development, very often we want to have a controlled, dedicated environment for testing the new codes. This is why sometimes I find having multiple OC4J containers running on a single machine is very helpful. In this way, restarting one container will not affect other “projects”.

One problem with this is port contention. In my Oracle Containers for J2EE 10g (10.1.3.0.0), the HTTP server is running on port 8888, JMS server on port 9127, and RMI server on port 23791 by default.

If run without modification, we will get the following errors:

ERROR jms.xml: port 9,127 already in use

ERROR J2EE RMI0002 Error starting ORMI server atscsun1.sg.oracle.com port 23,791: Address already in use

ERROR J2EE OJR0010 Exception starting HTTP server: Address already in use

The solution I used is to change the port no to other unused port:

1. Change the JMS server  port at $OC4J_HOME/j2ee/home/config/jms.xml:
<jms-server port="9127">

2. Change the RMI server  port at $OC4J_HOME/j2ee/home/config/rmi.xml:

<rmi-server
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/rmi-server-10_0.xsd"
  port="23791"
  ssl-port = "23943"
  schema-major-version="10"
  schema-minor-version="0">

3. Change the HTTP server port at $OC4J_HOME/j2ee/home/config/default-web-site.xml:

<web-site xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/web-site-10_0.xsd"  port="8888" display-name="OC4J 10g (10.1.3) Default Web Site" schema-major-version="10" schema-minor-version="0" >

Save all XML file, start the OC4J, and we are ready to go.

10 Comments:

Anonymous Anonymous said...

Thanks ! Really Appreciated

4/15/2008 5:37 PM  
Anonymous Anonymous said...

Very helpful document, appreciate it.

11/26/2008 12:13 AM  
Anonymous Anonymous said...

Using Myeclipse, I Only killed the procces javaw and that's all. Regards.

3/28/2009 2:44 AM  
Anonymous Anonymous said...

Thanks! This helped me a lot.

5/22/2009 11:49 PM  
Blogger Kishore On th Blog said...

Thanks a Lot,..helped me a Lot,..apprteciate much

7/18/2009 9:13 PM  
Anonymous puj4948 said...

helo sir,
can you gv me example the sample port number for 23791 that u use to change?

thnaks

11/20/2009 7:05 PM  
Anonymous Anonymous said...

what about? SSL port in rmi.xml?

12/04/2009 4:03 AM  
Anonymous Leonardo said...

is posible to have two instances of JDK in two oc4j instances in the same machine?

12/04/2009 10:18 PM  
Anonymous sap project said...

We often face the situation where we need multiple OC4J containers on one server that leads to the error message which is given. To solve this problem the solution is also explained which makes the task of multiple OC4J containers on server work in proper manner.

11/08/2011 2:04 PM  
Blogger Floxblog said...

Nice article, Thank you for sharing the informative articel. I have aslo an article about wordpress. Thank you!!!

9/04/2022 6:00 PM  

Post a Comment

<< Home