cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Gianni <>
Subject Re: How to work with EJB's
Date Fri, 10 Feb 2006 04:18:56 GMT
Hi Ankur,
yeah, Gunter is right, you can use plain java. I worked with cocoon, 
flow, cforms and EJB and these are a few tips :

- If you are going to develop flow based web-aplications, !!use javaflow 
if you can!!, under BEA weblogic and some other containers the Rhino 
classloader is not very well accepted, containers do neat stuff with 
classloaders when dealing with EJB.

- Both in javaflow and in components (actions, transformers etc..) you 
are going to develop, you can lookup the beans in the normal way:
            Context ctx = new InitialContext();
            IBeanHome beanhome = (IBeanHome) ctx.lookup(JNDI_NAME);
            result = (Bean) beanhome.create();
or whatever else you are used to, it's plain java.

- For a faster developement process, i managed to configure the EJB ear 
on BEA Weblogic, and access it trhu IIOP from the cocoon embedded jetty. 
Since BEA takes a lot of time to restart, expecially when there are many 
EJBs involved, and does not allow an easy way to replace files while 
running (and in cocoon it's so handy to do that), this can really save a 
lot of time (haven't tested other container, but i don't think they can 
do miracles, jetty will always load many times faster, and allows 
runtime file substitution). To do this i had to :
... Enable IIOP in BEA (or any other container).
... In BEA i also had to specify the listen address for IIOP 
connections, makes no sense since it was a single ip machine, but that is.
... In jetty (or cocoon jetty, under cocoon/build/webapp) create a file 
named WEB-INF/classes/ and put this inside :


... YMMV, but i also had to add ejb-2_1-api.jar and wlclient.jar (BEA 
web logic stuff) in WEB-INF/lib/ , and obviously a .jar with all the EJB 
... For you developement process only, add an easy java policy. Create a 
java.policy file where you prefer (WEB-INF is a good place) and put this 
in it :

grant {

... The before running ./ servlet (or cocoon.bat servlet if in 
windows) set this environment variable :

export JAVA_OPTIONS=""

or under windows


(Yes, under windows without quotes)

... Once a cocoon war is deployed inside the same EJB container where 
the beans are, there is no security policy problem.


Simone Gianni

Gunter D'Hondt wrote:

>just use plain old java code to connect to your ejb's; cfr to 
>documentation or samples from your ejb container (websphere, weblogic, 
>...); they will give you all the necessary sample code to connect to the 
>ejb container
>Gunter D'Hondt
>Ankur Gupta <> 
>09/02/2006 15:02
>Please respond to
>Cocoon site <>
>How to work with EJB's
>How can i work with the EJB's, i need to call EJB's through cocoon, how 
>can i achieve that, i cannot find a source which can explain me to do 
>pllzzzzzzzzz help me with the problem
>Relax. Yahoo! Mail virus scanning helps detect nasty viruses!
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message