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.
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:
Thanks ! Really Appreciated
Very helpful document, appreciate it.
Using Myeclipse, I Only killed the procces javaw and that's all. Regards.
Thanks! This helped me a lot.
Thanks a Lot,..helped me a Lot,..apprteciate much
helo sir,
can you gv me example the sample port number for 23791 that u use to change?
thnaks
what about? SSL port in rmi.xml?
is posible to have two instances of JDK in two oc4j instances in the same machine?
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.
Nice article, Thank you for sharing the informative articel. I have aslo an article about wordpress. Thank you!!!
Post a Comment
<< Home