Wednesday, April 22, 2009

Setting up standalone Oracle JDeveloper OC4J Server

This is how to set up the Oracle standalone OC4J server that comes with JDeveloper. There's no good quickstart guide, so I wrote one.


Assumptions

  1. Windows platform.

  2. Java and Apache ANT are installed and work from the command line.

  3. Oracle JDeveloper 10.1.2.0.0 installed at C:\jdev1012. If not, substitute your version and the directory it is installed in wherever it is referenced.

  4. Username and password for the OC4J server will be admin/admin. Make them whatever you want as long as you update the code that uses these.

  5. The application name is called "whatever," replace it with whatever you want.

  6. Your app server is installed on localhost, port 8888, and the RPC interface is on port 23791. These are the defaults, yours may vary.

  7. you can change the URL from "/yourURL" to whatever you want as long as you replace it in http-web-site.xml.

Set up server

C:\jdev1012\j2ee\home>java -jar oc4j.jar -install

enter an admin username and password.

Start server

C:\jdev1012\jdev\bin>start_oc4j.bat

Deploy app to server

Ant target
<property name="oc4j.deploy.ormi" value="ormi://localhost:23791" />
<property name="oc4j.deploy.username" value="admin"/>
<property name="oc4j.deploy.password" value="admin"/>

<target name="deploy">
<java jar="${jdev.home}/j2ee/home/admin.jar" fork="yes">
<arg value="${oc4j.deploy.ormi}"/>
<arg value="${oc4j.deploy.username}"/>
<arg value="${oc4j.deploy.password}"/>
<arg value="-deploy"/>
<arg value="-file"/>
<arg value="whatever.ear"/>
<arg value="-deploymentName"/>
<arg value="whatever"/>
</java>
</target>

Bind to server

notepad c:\jdev1012\j2ee\home\config\http-web-site.xml

add:

<web-app application="whatever" name="warfile name without .war" root="/yourURL">
</web-app>

Run

http://localhost:8888/yourURL

Conclusion

Look at that, up and running without 500 pages of Oracle "documentation."

Labels: , , ,

0 Comments:

Post a Comment

Nothing bad will happen to your information, I promise.

Subscribe to Post Comments [Atom]

<< Home