File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Regarding Deploying Ejb in Weblogic server 5.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Regarding Deploying Ejb in Weblogic server 5.1 " Watch "Regarding Deploying Ejb in Weblogic server 5.1 " New topic

Regarding Deploying Ejb in Weblogic server 5.1

vibhor sood

Joined: Oct 05, 2001
Posts: 1
I have just started doing ejbs.. i wrote first example using statelessSessionBean .. aim is to print "hello world"..for this i have written remote interface,home interface, session bean and client .. but the problem is that i dont know how to write "ejb-jar.xml" file and also "weblogic-ejb-jar.xml" file so please help me out with step by step guide to deploying ejb in weblogic server 5.1 and how to create "ejb-jar.xml file" and "weblogic-ejb-jar.xml" file manaually along with the entire solution for deploying.
Mahesh Kulkarni
Ranch Hand

Joined: Jul 05, 2001
Posts: 62
Hi Vibhor,
Please refer to examples directory of weblogic 5.1.Copy one ejb-jar.xml,weblogic-jar.xml files to your directory.Change the same as per your requirement.
Following is the ejb-jar.xml for a stateless session bean
<?xml version="1.0"?>
< !DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' ''>
<env-entry-type>java.lang.Double </env-entry-type>
<env-entry-type>java.lang.Double </env-entry-type>
<env-entry-type>java.lang.Integer </env-entry-type>
Here's the weblogic-jar.xml

<?xml version="1.0"?>
< !DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN' ''>

and here's the build file you have run after creating above files
It's .cmd file
@REM Copyright (c) 2000 BEA Systems, Inc. All Rights Reserved.
@REM Adjust these variables to match your environment
if "" == "%JAVA_HOME%" set JAVA_HOME=\java
if "" == "%WL_HOME%" set WL_HOME=\weblogic
set MYSERVER=%WL_HOME%\myserver
set MYCLASSPATH=%JAVA_HOME%\lib\;%WL_HOME%\classes;%WL_HOME%\lib\weblogicaux.jar;%MYSERVER%\clientclasses
@REM Create the build directory, and copy the deployment descriptors into it
mkdir build build\META-INF build\images
copy *.xml build\META-INF
copy *.gif build\images
@REM Compile ejb classes into the build directory (jar preparation)
javac -d build -classpath %MYCLASSPATH%
@REM Make a standard ejb jar file, including XML deployment descriptors
cd build
jar cv0f std_ejb_basic_statelessSession.jar META-INF examples images
cd ..
@REM Run ejbc to create the deployable jar file
java -classpath %MYCLASSPATH% -Dweblogic.home=%WL_HOME% weblogic.ejbc -compiler javac build\std_ejb_basic_statelessSession.jar %MYSERVER%\ejb_basic_statelessSession.jar
@REM Compile ejb interfaces & client app into the clientclasses directory
javac -d %MYSERVER%\clientclasses -classpath %MYCLASSPATH%
This is for the Trader Example.Please check your jdk path in the build.cmd file.
I hope this will give you lot of inputs for further exploring the EJB.Wish you Happy Exploring EJB.
I agree. Here's the link:
subject: Regarding Deploying Ejb in Weblogic server 5.1
It's not a secret anymore!