|
|
|||||||||||||
|
|
Under product information for Application Server at OTN, you can expand a list of features for each version. The two tables below show a consolidated listing for each type. Common elements are aligned at the top.
The J2EE downloads (pure Java) version is of interest to us in that this version installs without Oracle Universal Installer. Click the "Pure Java" link and you will see several standalone versions (the product comparison matrix is somewhat misleading given that there is, in fact, a standalone version). Version 10.1.2.0.2 is a quick download (just over 35MB) and results in a compressed file named oc4j_extended.zip. Reader's Note: For the purposes of this particular article, it is not necessary to install this product – finish reading before deciding whether or not you want to sample this version. One thing to take note of is that Oracle Corporation is not consistent in how it refers to features. Sometimes OC4J is used, sometimes not. Is it Application Server Web Cache, or HTTP Server Web Cache? Installing Oracle Application Server Containers for J2EEExpand the zipped file and open the Readme.txt file. I staged the uncompressed version of the download under C:\oracle\oc4j. To perform the installation, you need the Java "java" executable (may have to add the C:\Program Files\Java\jdk1.5.0_02\bin folder to your path). To test your environment and setup, run "java –version" at a command prompt. C:\>java -version java version "1.5.0_02" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09) Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode, sharing) In the j2ee\home directory, start the installation with java –jar oc4j.jar –install. C:\oracle\oc4j\j2ee\home>java -jar oc4j.jar -install Auto-unpacking C:\oracle\oc4j\j2ee\home\applications\dms0.war... done. To enable in-process JSP compilation (which can be faster in some cases), please add the path to your tools.jar in application.xml Example: <library path="../../../jdk/lib/tools.jar" /> Enter an admin password to use: oracle Confirm admin password: oracle If you are using J2SE 1.4 or higher, please ensure that all your imported classes are with in packages, as required by the Java Language Specification. Installation done C:\oracle\oc4j\j2ee\home> If the installation was successful, the next step is to test it by starting an OC4J instance. This part should be familiar to Forms developers running a Developer Suite OC4J instance (used to run Forms on the Web without using Application Server). C:\oracle\oc4j\j2ee\home>java -jar oc4j.jar 06/01/08 18:48:18 Oracle Application Server Containers for J2EE 10g (10.1.2.0.2) initialized 06/01/08 18:48:18 !!! No valid java compiler found !!! 06/01/08 18:48:18 javac.exe not found under C:\Program Files\Java\ jre1.5.0_02, please use a valid jdk or specify the location of your java compiler in server.xml using the <java-compiler .../> tag Note the error about javac.exe not being found under C:\Program Files\Java\jre1.5.0_02. Let's see, which version – JDK or JRE – does javac come with? That would be JDK, so why is Oracle looking for javac under a Java Runtime Environment (JRE) installation path? I have JDK listed first in my path statement, not JRE, but that doesn't make a difference. The Standalone User's Guide (installs with the product) even mentions JDK as being a prerequisite, yet Oracle is looking for javac under JRE. Anyway, this leads into one of the topic areas for this series, namely that of XML-based configuration files. XML Configuration FilesFor an overview of all the files involved, Figure 2-1 shows a good representation. The specifics of these files will be covered later (along with an XML editor), but for now, the server.xml is what needs our attention.
The server.xml file is located in J2EE_HOME\j2ee\home\config, which resolves to C:\oracle\oc4j\j2ee\home\config given that I used C:\oracle\oc4j as my Oracle, oops, make that J2EE, home. The error message stated that a java-compiler tag needs to be used to set the JDK location. The default server.xml file does not contain this directive (more on what a directive is later, but for now, consider it to be a very close cousin of an HTML tag), so it must be added. The contents of the server.xml file are shown below.
<?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"/>
<!-- JMS-server config link, uncomment to activate the JMS service -->
<jms-config path="./jms.xml"/>
<j2ee-logging-config path="./j2ee-logging.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" /> -->
</application-server>
Directives, just like tags in HTML, have beginning and ending parts. Some tags are self-closing, like "br" , and some are not, like "table." With the server.xml file, the configuration part is between the "application-server" tags. Somewhere in between the opening and ending is good enough as far as adding java-compiler tag. Three usage notes for adding the java-compiler tag include:
An example is shown below.
<j2ee-logging-config path="./j2ee-logging.xml" />
<java-compiler name="javac"
bindir="C:\\Program Files\\Java\\jdk1.5.0_02\\bin" />
<log>
<file path="../log/server.log"/>
</log>
Let's restart the OC4J instance and see what happens. C:\oracle\oc4j\j2ee\home>java -jar oc4j.jar 06/01/08 20:52:37 Oracle Application Server Containers for J2EE 10g (10.1.2.0.2) initialized Looks like a clean start. At this point, the basic webapp should be available. Access it via a URL of http://localhost:8888.
As another example, the Standalone User's Guide should be available at http://localhost:8888/standaloneguide.pdf. This URL suggests that where the PDF is located is also the Web server document root. The root (for me) is C:\oracle\oc4j\j2ee\home\default-web-app, and a simple test of trying to access other files within the default-web-app directory should prove this to be true.
Where is Enterprise Manager for this version of Application Server? Despite Oracle's Web site saying this version includes Enterprise Manager, it does not. The next version up – J2EE and Web Cache – is the minimum version type to get Enterprise Manager. Just for grins, if you note that the contents of the server.xml file remind you of a simple HTML file, try opening this (or any) XML file in a browser. In ClosingSo far, we have seen a listing of the features included in the four types of installation for Application Server. Applications can be deployed via the standalone OC4J version, and administration can be performed via the direct editing of (many) XML files. Knowing the specifics of XML is not necessary, but it certainly helps to have an appreciation of the who-what-where of what Enterprise Manager changes when you, as the administrator, are making changes via the EM console.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
![]()