• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Here is the complete BEA/WebLogic Config. for EJB

Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here are the steps to deploy EJB using BEA/WebLogic Config. for :

1.Create a directory where you are going to write all your session beans(Applicable to both Stateless and stateful ).
2.If your session beans are to be in a package then a good option would be to use JCreator for compilation otherwise you have to compile always with the –d option and have to create complicated batch files with classpath settings.
3.For eg. if you have a package statement like -
package examples.SessionBeans;
Then you need to have a directory called examples inside which you need to have a directory called SessionBeans or some Name.
4.Inside the SessionBeans directory put your Home Interface, Remote Interface and Bean classes.
5.Inside the SessionBeans directory create a directory called "META-INF". Note that all the letters should be in capital.
6.In the META-INF directory put your ejb-jar.xml. This you will get along with any sample code.u can search in bea folder also.
7. You need to create another file called weblogic-ejb-jar.xml with the following lines
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN" "http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd">
The ejb name that you specify should be same as the one you specify in the ejb-jar.xml. The jndi-name is the one you should use when looking up the home from the JNDI tree.
8. Create a jar file from one level above the package structure where your class files are.
For eg. if your classes are in a package called examples.SessionBeans, the jar file should be created from one directory above the examples directory.
9.Open the jar file in winzip and make sure the directory structure is OK and the XML files are inside the META-INF directory.
10. You now need to do an ejb compilation. Though this is not mandatory it is very useful as it checks your bean’s validity. If your ejbc goes through successfully you can be sure that your bean will be deployed successfully.
The command for ejbc is as follows
java weblogic.ejbc -g -classpath %CLASSPATH% -compiler javac <src-file> <dest-file>
For ease of use, create a batch file called ejbc.bat and put the following lines in it
set classpath=C:\bea\weblogic700\server\lib\weblogic.jar;
java weblogic.ejbc -g -classpath %CLASSPATH% -compiler javac %SOURCE_JAR% %DEST_JAR%
Make sure the classpath is OK.
The bat file can be used as follows
ejbc <Source-bean-jar> <Source-bean-deployable-jar>
For eg.
ejbc UserBean.jar UserBeanDeployable.jar
11. You now have a Enterprise Java bean that is ready to be deployed !!!
12. In Weblogic 7.0 put the jar file created as a result of the ejbc in the following directory
C:\bea\samples\server\config\examples\applications. For Weblogic 6.0 or 6.1 there should be a similar directory called applications where you place your code.
13. Start the Weblogic server. Note that you can put the file here even after you have started the server, any files that are added to this directory are automatically deployed, any that are removed are undeployed and any file whose time stamp changes will be redeployed.
14. If you have a client that you need to run to call the methods of this bean do so with the following class file.
set classpath=.;c:\bea\weblogic700\server\lib\weblogic.jar;
java -Djava.naming.factory.initial=weblogic.jndi.TengahInitialContextFactory -Djava.naming.provider.url=t3:// <Client-java-class>
You can set the Initial context factory and naming provider url even inside your code if you want but this is a better way. The –D option basically sets a System property.
15.You have now deployed and tested a Session Bean
pls don't do step 10 i mean EJB COmpilation if ur a Beginner.
After ur bean will be Deployed u can check from the Console or the CMD prompt of server where ur Beans name will appear.
That's all..
so please let me know about ur comments....
And also my friend's Muhammad Ashikuzzaman's comment.

Md. Anwar Hossain
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anwar, thanks for your effort and willingness to share knowledge with all of us. You have done a wonderful job to make everybody's life easier. You have done it with JBOSS, and WebLogic, which ones are to be posted subsequently?
Anwar Hossain
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello my friends,
I've done it for my own interest to help the ranchers.
I'll do so both with JBoss and BEA's WebLogics,.

Md. Anwar Hossain
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic