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:

  1. If not already done, create a deployment profile for the EJB JAR.
  2. If not already done, create an application server connection before deploying the EJB JAR.
  3. (Optional) If you want to edit either the EJB_deployment_profile_icon <ejb_name>.deploy profile or the corresponding deployment descriptor, ejbjarxml orion-ejb-jar.xml, right-click the icon in Navigator and choose Settings.
  4. (Optional) If you want to create a J2EE EJB JAR module deployment profile, right-click ejbjarxml ejb-jar.xml in the Navigator in the specified project and choose Create EJB JAR Deployment Profile. To edit ejb-jar.xml, right-click ejbjarxml 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.
  5. Select and right-click EJB_deployment_profile_icon <ejb_name>.deploy which appears in the Navigator below the specified project. The context menu displays these deployment options:
    1. 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.
    2. Deploy to New Connection: Launches the Connection Wizard which lets you create a new application server connection.
    3. 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.
    4. 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:

  1. 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.
  2. Restart this specific OC4J instance as appropriate.
  3. In JDeveloper, create a Java client which will access the EJB JAR.
  4. Run the Java client using the same RMI port number that you specified for the OC4J instance in Enterprise Manager (port 3103).

Notes:


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