You are on page 1of 1

How to run EJB prog in Weblogic

8.1
Reply from Kamlesh Nanda on 3/23/2005 1:24:00 PM
Here are the steps you need to take to run EJB on weblogic 8.1:
1) Create the EJB class, put any business methods that you want and other framework methods (like
ejbRemove, etc.) that are required due to interface implementation.
2) Create ejb-jar.xml and weblogic-ejb-jar.xml
[For exact format of declaration refer to http://java.sun.com/dtd/ejb-jar_2_0.dtd and
http://www.bea.com/servers/wls810/dtd/weblogic-ejb- jar.dtd]
3) In case it is an Entity bean also create weblogic-cmp-rdbms-jar.xml [To map tables and colums to the
bean attributes]
4) Package them in a jar file say myejb.jar with the following internal structure:
==============
myejb.class
..other dependent class files
WEB-INF/ejb-jar.xml
WEB-INF/weblogic-ejb-jar.xml
WEB-INF/weblogic-cmp-rdbms-jar.xml
==============
5) Copy this jar to your weblogic domain's application directory. e.g.
C:\bea\user_project\mydomain\applications
6) Start weblogic server - in case the server is in DEVELOPMENT mode then it will automatically deploy
this jar. Check the log to confirm that.
7) If the server is in PRODUCTION mode then open the weblogic admin console in a browser window.
e.g. if the server is running on port 7001 then the URL will be http://localhost:7001/console
Go to deployments->Applications and click on Deploy new application and select the jar file in the
following screens and click deploy in the final screen.

That should do it. I hope this helps.

Kamlesh

You might also like