Deploying a J2EE EJB JAR to Standalone OC4J or Oracle Application Server
A J2EE EJB module is packaged as an EJB JAR file which contains one or more
EJB components as well as the standard J2EE EJB deployment descriptor, ejb-jar.xml
,
and the OC4J-specific deployment descriptor, orion-ejb-jar.xml
.
Once you've created the deployment profile containing the EJB components and
these deployment descriptors, you can deploy it as an EJB JAR or or a standard
J2EE Enterprise Archive (EAR) file. JDeveloper takes the resulting EAR and deploys
it to the target application server.
To deploy a J2EE EJB JAR directly to a standalone OC4J instance or
to Oracle Application Server in JDeveloper:
- If not already done, create a deployment
profile for the EJB JAR.
- If not already done, create
an application server connection before deploying the EJB JAR.
- (Optional) If you want to edit either the
<ejb_name>.deploy profile or the
corresponding deployment descriptor,
orion-ejb-jar.xml, right-click the icon in Navigator and choose Settings.
- (Optional) If you want to create a J2EE EJB JAR module deployment
profile, right-click
ejb-jar.xml in the Navigator in the specified project and choose Create
EJB JAR Deployment Profile. To edit ejb-jar.xml
,
right-click
ejb-jar.xml in the Navigator and choose Edit
EJB Module. Alternatively, you can choose XML
Editor if you are knowledgeable about the descriptor's XML format.
- Select and right-click
<ejb_name>.deploy which appears
in the Navigator below the specified project. The context menu displays these
deployment options:
- Deploy to <Name_of_server_connection>:
the EJB is packaged as an EJB JAR. JDeveloper also generates an EAR file
which contains the EJB JAR before deploying to the selected application
server connection.
- Deploy to New Connection: Launches
the Connection Wizard which lets you create a new application server connection.
- Deploy to JAR file: the EJB module
is packaged as an EJB JAR and saved to the local directory or mapped network
drive which you specified in the EJB
JAR deployment profile.
- Deploy to EAR file: the EJB module
is packaged as an Enterprise Archive (EAR) file and saved to the local
directory or mapped network drive you specified in the EJB
JAR deployment profile.
Accessing EJBs from Oracle Application Server
After the EJB JAR is deployed to Oracle Application Server, a Java
client can access it using this procedure:
- In the Oracle Enterprise Manager, you must provide a fixed
port number for the specific OC4J instance in which the EJB JAR was deployed.
Specify this port number in Enterprise Manager | OC4J
Instance | Server Properties. For example: 3103.
- Restart this specific OC4J instance as appropriate.
- In JDeveloper, create a Java client which will access the EJB JAR.
- Run the Java client using the same RMI port number that you specified for
the OC4J instance in Enterprise Manager (port 3103).
Notes:
- When deploying to OC4J or Oracle Application Server, do not assemble EJB 1.1 and
EJB 2.0 modules into a single J2EE application EAR file as deployment will
fail and SQL and connection errors will be raised.
- For information on the deployed location of the application files including
the EJB JAR and EAR files, see the "Oracle Application Server Containers for J2EE
User's Guide" provided with the Oracle Application Server documentation
library.
- See About Deploying on Oracle9i
Application Server for information on deploying the EAR file to an Oracle9i
Application Server.
- The EJB Container in OC4J provides full support for EJB 2.0. For more information,
see the EJB 2.0 specification:
http://www.javasoft.com/products/ejb/docs.html
- Make sure that the EJB deployment descriptor is located inside the EJB JAR
META-INF/ejb-jar.xml
.
Related topics
- About J2EE Applications and How They
Are Packaged and Deployed
- Editing orion-ejb-jar.xml
- Deploying EJB JARs to WebLogic
- Deploying BC4J as an EJB Session Bean
to Standalone OC4J or Oracle Application Server
- Deploying BC4J as an EJB Session Bean to WebLogic
- Understanding the n-Tiered
Business Components Architecture
- Sample Business Components EJB Command-line Client Deployed to OC4J
- Running an EJB
- Debugging an EJB