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
- Windows platform.
- Java and Apache ANT are installed and work from the command line.
- 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.
- 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.
- The application name is called "whatever," replace it with whatever you want.
- Your app server is installed on localhost, port 8888, and the RPC interface is on port 23791. These are the defaults, yours may vary.
- 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 -installenter an admin username and password.
Start server
C:\jdev1012\jdev\bin>start_oc4j.batDeploy 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.xmladd:
<web-app application="whatever" name="warfile name without .war" root="/yourURL">
</web-app>
Run
http://localhost:8888/yourURLConclusion
Look at that, up and running without 500 pages of Oracle "documentation."Labels: howto, Java, Oracle, programming
