Deploying an EJB JAR to WebLogic
A J2EE EJB module deployed to a BEA WebLogic server 6.1 or 7.0SP1 is packaged
as an EJB JAR file which contains one or more EJB components and two EJB deployment
descriptor files named ejb-jar.xml
and weblogic-ejb-jar.xml
.
JDeveloper lets you create the deployment profile containing the EJB components
and these deployment descriptor files and packages them into a standard J2EE
EJB JAR archive for deployment to WebLogic via the BEA WebLogic Server Console.
To deploy a J2EE EJB JAR file in JDeveloper to WebLogic:
- If not already done, create a deployment
profile for an EJB JAR .
- If not already done, create an application
server connection to BEA WebLogic before deploying the EJB JAR.
- Select and right-click the
<ejb_name>.deploy profile icon
and choose any of the available 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. Use the BEA WebLogic Server Console to deploy
this EJB JAR file. See your WebLogic Server documentation for more information.
- (Optional) If you want to edit either the
<ejb_name>.deploy profile or any
of the corresponding deployment descriptors, ejb-jar.xml
or weblogic-ejb-jar.xml
,
right-click its icon in the Navigator and choose Settings.
Notes:
- The J2EE 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
.
- Oracle has certified WebLogic versions 6.1 and 7.0SP1.
- For clients that access EJBs on the WebLogic server, the following code is
required in the client:
env.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "system");
env.put(Context.SECURITY_CREDENTIALS, "welcome1");
env.put(Context.PROVIDER_URL, "t3://localhost:7001");
-
When deploying to WebLogic, if you use the same EJB
in two or more different applications, the second deployment will usually
cause a JNDI name collision. Therefore, you must rename the JNDI name of
the EJB for the second and any subsequent deployments:
- Right-click
weblogic-ejb-jar.xml
, and
select Settings.
- Under Enterprise Java Beans, select the relevant
ModuleBM bean. The EJB tab is displayed on the right.
- In the EJB tab, change the JNDI Name field so that
it is different from any other JNDI Name in
weblogic-ejb-jar.xml
and any other EJBs that are already deployed to WebLogic.
- Deploy the application accessing the EJB to WebLogic.
During deployment, the IDE automatically fills in the
weblogic.xml
with appropriate EJB references.
Related topics
- About J2EE Applications and How They
Are Packaged and Deployed
- Editing weblogic-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
- Running an EJB
- Debugging an EJB
- Sample Client Code for an EJB Client for WebLogic