• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding Deploying Ejb in Weblogic server 5.1

vibhor sood
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
<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' 'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'>

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\classes.zip;%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% Trader.java TraderHome.java TradeResult.java TraderBean.java
@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% Trader.java TraderHome.java TradeResult.java Client.java
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic