Home

Architecture

WebApps

Database

Administration

Web Search

News

Java Servers

Web Services

Enterprise

Learning

Contact Us

JumpPoint - Java - EJB - Servlets - JSP - JMS - JNDI - JDBC - RMI

Deploying an EJB to WebLogic...

Ok now for a little magic. The EJB we created compiles. But it isn't running anywhere yet. But we have built a connection to WebLogic established. So let's see what JDeveloper can do with this connection. It turns out that since JDeveloper "knows about" our WebLogic server it can load an EJB into it.

So that's what we're going to do. There will be plenty of instructions here. If you get stuck, you can also check JDeveloper Help - which provides an overview of the process.

First, again, make sure WebLogic is started if you haven't already. Now we'll create a deployment for it.

(1) First let's create a metadata file for WebLogic for the EJB. Click on File | New.



In Categories, select "
Enterprise JavaBeans"

In Items, select "
WebLogic EJB Descriptor"
   
(2) Now we'll create a JAR to deploy.

Select File | New again.

Set Categories to "
Deployment Profile"

Set Items to
"EJB JAR File - J2EE EJB Module".


   
Let the name of the deployment be ejb1.deploy.


This will generate a jar called "
ejb1.jar."


   
The Files list now appears. Set it as shown at the right. We want only the EJB elements included.











There is one more thing to do. It's not a big thing but it's important.

Go to the "
Projects" menu at the top and click on "Settings"
   
Select Projects | Settings

As you might guess, the
Project Settings dialog appears.



Click on "
Compiler."

WebLogic does not like it if you use "CP1252" encoding in XML deployment files.



Open the Character Encoding pull-down and select
UTF-8.

Character Encoding:


Then click on "
Save"
   

Now you're ready to deploy.

Point to the ejb1.deploy in the Navigator menu,

Right click so the menu displays

Select "Deploy to" and "WebLogicServer."


If all goes well you will see the following messages at the bottom of the screen:

Sending EAR file to remote WebLogic server...
E:\Programs\jdevrc2\jdk\jre\bin\javaw.exe -Ddeploy.debug=true -classpath E:\bea\wlserver6.1\lib\weblogic.jar weblogic.deploy -username system -host authoriz-nh1pet -port 7001 -debug -component ejb1:myserver deploy password ejb1 file:/E:/Programs/jdevrc2/jdev/mywork/Workspace1/Project1/ejb1.ear
Component = ejb1 Server = [Ljava.lang.String;@1
adminUrl = t3://authoriz-nh1pet:7001
url=t3://authoriz-nh1pet:7001
Admin Server Http Url = http://authoriz-nh1pet:7001
[deploy] : deploying ejb1
mydomain:Name=ejb1,Type=Application
Getting the LogBroadcasterRuntimeMBean ...
Admin Server URL = http://authoriz-nh1pet:7001
Uploaded file = ejb1.ear
Upload file = .\config\mydomain\.wlstaging\ejb1.ear
mydomain:Name=ejb1,Type=Application
Verifying components ...
mydomain:Name=myserver,Type=Server
[deploy] : adding target : myserver for: ejb1
Verifying components ...
setTargets() ...
Component = ejb1
Server = myserver
setDeployed(true) ...
deployApplication ...
[deploy$DeploymentListener] : handleNotification
[deploy$DeploymentListener] : notification type: weblogic.log.J2EE.160003
MSGID = 160003
SUBSYSTEM = J2EE
INFO Notification
Setting logNotificationReceived to true.
Done deploying ejb1 with .\config\mydomain\.wlstaging\ejb1.ear
---- Deployment finished. ---- Apr 26, 2002 11:46:02 AM

You can now go to the WebLogic console to verify that "ejb1.jar" shows up in the deployed EJBs.

On to ==> Run the EJB