[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how to run both ears on different ports in oc4j

Posted on 2005-04-15
19
Medium Priority
?
976 Views
Last Modified: 2013-11-24


i have deployed two ears in oc4j container in this directory;
C:\OC4J_EXTENDED\j2ee\home\applications..

i want to run both ears on different ports;what changes should i made to oc4j container;

0
Comment
Question by:chaitu chaitu
  • 10
  • 9
19 Comments
 
LVL 15

Expert Comment

by:aozarov
ID: 13799695
I have no experience with Oracle application server but I would not be surprised if the way to achive that is
by running two seperate instances of your application server (each instance is configured to a different port) and
each instances holds one of the ears.
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 13803678
in my machine only oc4j stand-alone application server installed not  Oracle application server suite;

how to create nstances of oc4j stand-alone application server ;

Is it  just copy the oc4j server and name it other name and change the port numbers
0
 
LVL 15

Accepted Solution

by:
aozarov earned 1200 total points
ID: 13803726
>>in my machine only oc4j stand-alone application server installed not  Oracle application server suite;
I think that should be enough.
>> how to create nstances of oc4j stand-alone application server ;
Read http://www.oracle.com/technology/tech/java/oc4j/htdocs/how-to-ejb-clustering.html
Section (Configuring multiple OC4J Nodes on the same machine)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 20

Author Comment

by:chaitu chaitu
ID: 13803919
i followed the steps in the above URL what they have given?
my jdk path is in C:\j2sdk1.4.2_06\bin still not able to recognise??

C:\OC4J_EXTENDED\j2ee\home>java -jar oc4j.jar -config ./node1/config/server.xml
05/04/18 11:35:07 Error initializing data-source 'oraclePool': DriverManagerData
Source driver 'com.p6.engine.spy.P6SpyDriver' not found
05/04/18 11:35:12 Auto-deploying - EJB.jar (New server version detected)...
05/04/18 11:35:12 Error instantiating application 'egl-gffs-12' at file:/C:/OC4J
_EXTENDED/j2ee/home/node1/applications/tln-app-312.ear: Error initializing ejb-m
odule; Exception javac.exe not found under C:\Program Files\Java\j2re1.4.2_06, p
lease use a valid jdk or specify the location of your java compiler in server.xm
l using the <java-compiler .../> tag
05/04/18 11:35:12 Error initializing site Oracle9iAS Containers for J2EE HTTP We
b Site: javac.exe not found under C:\Program Files\Java\j2re1.4.2_06, please use
 a valid jdk or specify the location of your java compiler in server.xml using t
he <java-compiler .../> tag
05/04/18 11:35:12 Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)
initialized

server.xml iss

<?xml version = '1.0' standalone = 'yes'?>
<!DOCTYPE application-server PUBLIC "Orion Application Server Config" "http://xmlns.oracle.com/ias/dtds/application-server-9_04.dtd">
<application-server application-directory="../applications" deployment-directory="../application-deployments" connector-directory="../connectors">
   <rmi-config path="./rmi.xml"/>
   <transaction-config timeout="8787189743917"/>
   <!-- JMS-server config link, uncomment to activate the JMS service -->
   <jms-config path="./jms.xml"/>
   <log>
      <file path="../log/server.log"/>
   </log>
   <global-application name="default" path="application.xml"/>
   <global-web-app-config path="global-web-application.xml"/>

   <!-- <web-site path="./secure-web-site.xml" /> -->
   <web-site path="./http-web-site.xml"/>
   <!-- Uncomment the following, to deploy these apps.
     <application name="callerInfo" path="../jazn/demo/callerInfo/callerInfo.ear" />
     <application name="ssoInfo" path="../jazn/demo/ssoInfo/build/ssoInfo.ear" />
     <application name="ejbsamples" path="../demo/ejb" />
     <application name="news" path="../applications/news.ear" />
     <application name="logger"
     path="../demo/messagelogger.ear" />
     <application name="petstore"
     path="../applications/estore-patched.ear" />
     <application name="ws_example" path="../demo/web_services/java_services/ws_example.ear" />
     <application name="ojspdemos" path="../demo/ojspdemos.ear" />
     -->
   <!-- Compiler, activate this to specify an alternative compiler such
         as jikes for EJB/JSP compiling. -->
   <!-- <compiler executable="jikes" classpath="/myjdkdir/jre/lib/rt.jar" /> -->
   <java-compiler path="C:/j2sdk1.4.2_06/bin"/>
   <application name="egl-gffs-12" path="../applications/tln-app-312.ear"/>
   <max-http-connections value="100"/>
   <application name="bc4j" path="../../../../BC4J/redist/bc4j.ear" auto-start="true"/>
</application-server>
0
 
LVL 15

Expert Comment

by:aozarov
ID: 13804001
Try this instead of your java-compiler entry:
<java-compiler name="javac" in-process="false" encoding="ISO8859_1" bindir="C:/j2sdk1.4.2_06/bin" extdirs="C:/j2sdk1.4.2_06/lib/ext" />

This is based on the dtd values: http://www.oracle.com/technology/ias/dtds/application-server-9_04.dtd
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 13812686
my batch file like this to start the server

set path=c:\j2sdk1.4.2_06\bin;
java -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000 -Xdebug -Xnoagent -Djava.compiler=NONE -Xmx512m -Dhttp.session.debug=true -Djdbc.connection.debug=true -Dp6.home=C:\OC4J_EXTENDED\j2ee\home\lib -Dp6trace=true -jar C:\OC4J_EXTENDED\j2ee\home\oc4j.jar  -config ./node1/config/server.xml -userThreads -verbosity 10 -out C:\OC4J_EXTENDED\j2ee\home\node1\log\std_out.log -err C:\OC4J_EXTENDED\j2ee\home\node1\log\std_err.log

i am getting following exception

05/04/19 10:08:21 Invalid jsp taglib location: C:\OC4J_EXTENDED\j2ee\home\.\node1\config\..\jsp\lib\taglib does not exist or is not a directory
05/04/19 10:13:39 Error initializing data-source 'oraclePool': DriverManagerDataSource driver 'com.p6.engine.spy.P6SpyDriver' not found

where this is "C:\OC4J_EXTENDED\j2ee\home\.\node1\config\..\jsp\lib\taglib" located????


datasources.xml is

 <?xml version="1.0" standalone='yes'?>
<!DOCTYPE data-sources PUBLIC "Orion data-sources" "http://xmlns.oracle.com/ias/dtds/data-sources-9_04.dtd">

<data-sources>
      <!--
            An example/default DataSource that uses
            Oracle JDBC-driver to create the connections.
            This tag creates all the needed kinds
            of data-sources, transactional, pooled and EJB-aware sources.
            The source generally used in application code is the "EJB"
            one - it provides transactional safety and connection
            pooling. Oracle thin driver could be used as well,
            like below.
            url="jdbc:oracle:thin:@host:port:sid"
-->

 <data-source
            class="com.evermind.sql.DriverManagerDataSource"
            name="oraclePool"
            location="oraclePool"
            xa-location="oraclePool"
            ejb-location="oraclePool"
            connection-driver="com.p6.engine.spy.P6SpyDriver"
            username="lvqa"
            password="lvqa"
            url="jdbc:oracle:thin:@192.168.68.44:1521:egl"
            inactivity-timeout="30"
      />
      


      
      <!-- <data-source
            class="com.evermind.sql.DriverManagerDataSource"
            name="oraclePool"
            location="oraclePool"
            xa-location="oraclePool"
            ejb-location="oraclePool"
            connection-driver="com.p6.engine.spy.P6SpyDriver"
            username="egl1005"
            password="egl"
            url="jdbc:oracle:thin:@172.16.31.12:1521:egl"
            inactivity-timeout="30"
      />-->      

<!--<data-source
            class="com.evermind.sql.DriverManagerDataSource"
            name="oraclePool"
            location="oraclePool"
            xa-location="oraclePool"
            ejb-location="oraclePool"
            connection-driver="com.p6.engine.spy.P6SpyDriver"
            username="talontest"
            password="talontest"
            url="jdbc:oracle:thin:@57.33.0.115:1521:TALDEV0"
            inactivity-timeout="30"
      />-->

</data-sources>
0
 
LVL 15

Expert Comment

by:aozarov
ID: 13815799
>> 05/04/19 10:13:39 Error initializing data-source 'oraclePool': DriverManagerDataSource driver 'com.p6.engine.spy.P6SpyDriver' not found
Add to your class path (in the java run command) the the jar (p6psy.jar ?) that contains the above driver.

>> where this is "C:\OC4J_EXTENDED\j2ee\home\.\node1\config\..\jsp\lib\taglib" located????
I think: C:\OC4J_EXTENDED\j2ee\home\node1\jsp\lib\taglib  -> is there such a directory?
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 13823325
p6psy.jar  is in C:\OC4J_EXTENDED\j2ee\home\lib directory

i put the classpath still doesnt recognize??

set path=c:\j2sdk1.4.2_06\bin;
set classpath=C:\OC4J_EXTENDED\j2ee\home\lib;C:\OC4J_EXTENDED\lib;%classpath%
java -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000 -Xdebug -Xnoagent -Djava.compiler=NONE -Xmx512m -Dhttp.session.debug=true -Djdbc.connection.debug=true -Dp6.home=C:\OC4J_EXTENDED\j2ee\home\lib -Dp6trace=true -jar oc4j.jar -config node1\config\server.xml -userThreads -verbosity 10 -out node1\log\std_out.log -err node1\log\std_err.log
0
 
LVL 15

Expert Comment

by:aozarov
ID: 13823500
You will need to put in in the classpath directly (and not the folder).
hence:
set classpath=C:\OC4J_EXTENDED\j2ee\home\lib;C:\OC4J_EXTENDED\lib;C:\OC4J_EXTENDED\j2ee\home\lib\p6psy.jar;%classpath%
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 13831380
now i changed my batch file like this

set path=c:\j2sdk1.4.2_06\bin;
set classpath=C:\OC4J_EXTENDED\j2ee\home\lib\commons-logging.jar;C:\OC4J_EXTENDED\j2ee\home\lib\p6psy.jar;%classpath%
java -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000 -Xdebug -Xnoagent -Djava.compiler=NONE -Xmx512m -Dhttp.session.debug=true -Djdbc.connection.debug=true -Dp6.home=C:\OC4J_EXTENDED\j2ee\home\lib -Dp6trace=true -jar oc4j.jar -config node1\config\server.xml -userThreads -verbosity 10 -out node1\log\std_out.log -err node1\log\std_err.log

when i run the node1 server i am getting this exception in server.log

org.apache.commons.logging.LogConfigurationException: java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl
      at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:497)
      at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:350)
      at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:400)
      at com.foursoft.java.SessionAttributeListener.<init>(SessionAttributeListener.java:22)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
      at java.lang.Class.newInstance0(Class.java:308)
      at java.lang.Class.newInstance(Class.java:261)
      at com.evermind.server.http.HttpApplication.initDefaultServlets(HttpApplication.java:4892)
      at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:701)
      at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:497)
      at com.evermind.server.Application.getHttpApplication(Application.java:886)
      at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:688)
      at com.evermind.server.http.HttpSite.getApplication(HttpSite.java:420)
      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:422)
      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
      at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl
      at com.evermind.naming.ContextClassLoader.findClass(ContextClassLoader.java:486)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
      at com.evermind.naming.ContextClassLoader.loadClass(ContextClassLoader.java:138)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
      at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:493)
0
 
LVL 15

Expert Comment

by:aozarov
ID: 13836223
Now you are missing commons-logging.jar.
find where it is and then add it to your classpath -> path\commons-logging.jar
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 13840102
required jars are in this path C:\OC4J_EXTENDED\j2ee\home\lib;now i am not missing anything still i am getting above error;
0
 
LVL 15

Expert Comment

by:aozarov
ID: 13840124
Just adding C:\OC4J_EXTENDED\j2ee\home\lib to your classpath is not enough (as we saw in the case of p6psy.jar)
You will need to add to your classpath
C:\OC4J_EXTENDED\j2ee\home\lib\commons-logging.jar and any other jar that will be needed.
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 13840188
hi

u have not seen the batch file that i have pasted in my above post;in that i clearly mentioned the whole  path

set path=c:\j2sdk1.4.2_06\bin;
set classpath=C:\OC4J_EXTENDED\j2ee\home\lib\commons-logging.jar;C:\OC4J_EXTENDED\j2ee\home\lib\p6psy.jar;%classpath%
java -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000 -Xdebug -Xnoagent -Djava.compiler=NONE -Xmx512m -Dhttp.session.debug=true -Djdbc.connection.debug=true -Dp6.home=C:\OC4J_EXTENDED\j2ee\home\lib -Dp6trace=true -jar oc4j.jar -config node1\config\server.xml -userThreads -verbosity 10 -out node1\log\std_out.log -err node1\log\std_err.log
0
 
LVL 15

Expert Comment

by:aozarov
ID: 13840370
Can you verify that the class org.apache.commons.logging.impl.LogFactoryImpl can be found in
C:\OC4J_EXTENDED\j2ee\home\lib\commons-logging.jar ?
you can do that by: jar tf C:\OC4J_EXTENDED\j2ee\home\lib\commons-logging.jar | find "LogFactoryImpl"
That exception clearly indicates that the JVM does not find this class.
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 13840394
yea i know LogFactoryImpl class is there in commons-logging.jar ;

if any exceptions come it should go to std_err.log why it is showing in server.log
0
 
LVL 15

Expert Comment

by:aozarov
ID: 13840418
>> yea i know LogFactoryImpl class is there in commons-logging.jar ;
Doesn't make any sense. :-(
You can try putting those jars also in your WEB-INF/lib web application folder...

>> if any exceptions come it should go to std_err.log why it is showing in server.log
Don't know.
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 13840422
its already there in WEB-INF/lib web application folder...

0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 13840442
atlast i got success;

thank u aozarov  u have lot of patience solving this problem ;

i put comming-logging.jar  in this directory C:\OC4J_EXTENDED\j2ee\home\node1\jsp\lib\taglib

now i am able to log in to the application
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
A solution for Fortify Path Manipulation.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month19 days, 4 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question