|
Deploying With Exploded Directory Format
For deploying EJB or complex J2EE applications, you can place the files in its own directory under the applications/ directory. The directory structure is similar as designated for an EAR file. Replace a directory name where the EJB JAR file or Web application WAR file would exist. Deposit the classes where they belong in a directory structure that maps to their package structure. This structure is displayed in following:
Figure1 Development Application Directory Structure
applications (location: j2ee\<oc4j instance name>\)
`------<appname>
|-------META-INF
| `-------application.xml
|
|-------ejb
| |-------EJB classes (my.ejb.class maps to /my/ejb/class)
| `-------META-INF
| `-------ejb-jar.xml
|-------web
| |-------index.html
| |-------JSP pages
| `-------WEB-INF
| |----web.xml
| `----classes
| `-------Servlet classes (my.servlet to /my/servlet)
`-------client
|-------Client classes
`-------META-INF
|-------application-client.xml
`-------orion-application-client.xml
Modify the server.xml, applications.xml, and default-web-site.xml files as stated below:
In server.xml (location: j2ee\<oc4j instance name>\config), add a new or modify the existing <application name=... path=... auto-start="true" /> entry for each J2EE application. The path should be the parent directory where the META-INF for the J2EE application. In our example in Figure 1, if <appname> is "myapp", the path would be as follows:
<application_name="myapp" path="../applications/myapp" parent="default" start="true"/>
In application.xml (location: j2ee\<oc4j instance name>\applications\<appname>\META-INF), modify the <module> elements to contain directories for the Web application, the EJB application, and any client code contained within the exploded directory. This may mean you modify the <web-uri>, the <ejb>, and the <client> elements. The path included in these elements should be relative to the applications/ directory and the parent of the WEB-INF or META-INF directories in each of these application types. The following modifies the <web-uri> for the Web aplication contained within the "myapp" application:
<module>
<web>
<web-uri>web</web-uri>
<context-root>web</context-root>
</web>
</module>
In default-web-site.xml (location: j2ee\<oc4j instance name>\config), you add a <web-app ...> entry for each Web application. This is extremely important, because it binds the Web application within the Web site. The application variable should be the same value as provided in the server.xml file. The <name> should be the directory for the Web application. Note that the directory path given in the name element follows the same rules as designated for the path in the <web-uri> element in application.xml.
For Web application binding for the myapp Web application, add the following:
<web-app application="myapp" name="web" load-on-startup="true" root=" /web" />
Last step: restart OC4J.
|