Meaningless Drivel is fun!
The moose likes EJB and other Java EE Technologies and the fly likes Compiling EJBs 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 "Compiling EJBs" Watch "Compiling EJBs" New topic

Compiling EJBs

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 595
I am new to EJBs, I have created EJB files, but I have no idea how to compile them. Do I need a special EJB complier.
I have down Loaded the BEA WebLogic server for EJB Deployment.
Thank you for any Help TE
Siva Jagadeesan
Ranch Hand

Joined: Oct 31, 2000
Posts: 160
No you don't need any special compiler, you can use "javac". But make sure you have j2ee.jar is in your classpath.
There is veru good documentation to run a "HelloWorld" kind of program in BEA website.
I will advice to go over that.

Rgds<p>--Siva Jagadeesan<br /><a href="" target="_blank" rel="nofollow"></a><br />Sun Certified Java2 Programmer<br />Sun Certified Web Component Developer<br />BEA Certified Weblogic Server 7 Enterprise Developer
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

You don't need a special compiler, but producing an EJB specifically for WebLogic does require that it generate some additional support classes. The java application weblogic.ejbc will do that for you - its use for WLS 6.1 is documented here:

An IDE is no substitute for an Intelligent Developer.
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
I recommend jakarta ant... very powerful.

I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Erik Hatcher
Ranch Hand

Joined: Jun 11, 2002
Posts: 111
Ant's <ejbjar> task is capable of invoking Weblogic'c ejbc utility. See

Co-author of Lucene in Action
Dave Landers
Ranch Hand

Joined: Jul 24, 2002
Posts: 401
Since WebLogic 6, you don't have to run ejbc if you don't want to.
If you deploy just the javac-compiled ejb .class files in your ejb jar (or "exploded" directory), the server will "run ejbc" for you when the ejbs are deployed.
Running ejbc manually does have the advantage that it will point out errors you might have in your beans or deployment descriptors. Finding out these things during "the build" is good. It also makes a jar that the server can consume more efficiently.
But skipping it and just tossing the jar at the server is sometimes convenient and occassionally more fun (if you're into that sort of thing).
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 595
Thank you everyone I will go over each reply, it will give me good experience.
I agree. Here's the link:
subject: Compiling EJBs
It's not a secret anymore!