You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by ja...@neupart.dk on 2002/11/05 15:18:47 UTC

RE: Cocoon and EJB

On the subject of Cocoon and EJB:

I am developing an application based on JBoss 3.0.3 (with Jetty), Cocoon 
2.0.3 and Sun JDK 1.4 - all nicely wrapped up in an InstallAnywhere 
executable and easy to install on any Linux/Windows box. We are using an 
almost stock JBoss where the Jetty container is configured to use Servlet 
2.3 class loading instead of Java 2 class loading. This way Cocoon gets 
the Xalan 2.3.1 (actually we just upgraded to 2.4.0 because of weird 
ArrayIndexOutOfBoundExceptions)  it is shipped with, instead of the Xalan 
2.2.D11 coming from JDK 1.4 - anyone seeing the "No More DTM IDs 
available" exception when running JDK 1.4 should do this, or put 
xalan-2.3.1+xercesImpl.jar+xml-apis.jar into the JDK endorsed lib.

To get Cocoon running with all that, we've set the "init-classloader" to 
"true" in the web.xml deployment descriptor.

I am currently looking in to some redirection problems - but otherwise 
using Jetty as web container is fairly trouble free. We are aiming at 
being very J2EE spec compliant, but unfortunately we have not yet had the 
time to deploy the application in other application servers.

And now to the more tedious part: To get the data from the EJB Layer I've 
created an XSLT that reads an XML definition file of a value object and 
generates a java file. This java class is the value object, and among 
other things it knows how to stream itself to a ContentHandler. This XSLT 
is unfortunately the property of my employer - but the idea is free to use 
;-)

We then have Session Facade Beans (see theserverside.com for EJB design 
patterns) collecting the data we need from Entity Beans (All Container 
Managed with only local interfaces and a lot of Container Managed 
Relations - we have the container do a lot of work here) and building the 
proper domain value objects. We furthermore have Command Session Beans to 
execute Command Objects that are initialized in the web tier (read: 
cocoon) and then passed on to the EJB Container; through "Class.forName" 
we have a Cocoon action that maps 1:1 between Cocoon actions and our 
commands. All that wraps up to a kinda nice MVC pattern; add in a few JMS 
messages here and there and the caches are cleared when needed...

Well that was one messy mail.... I can hopefully do better next time I 
post ;-)

Jakob Dalsgaard
Udvikler
e-mail:   jakob.dalsgaard@neupart.dk
Vesterbrogade 149
1620 København V
Tlf.:   70 25 80 30
Fax.: 70 25 80 31






Piroumian Konstantin <KP...@protek.com>
10/25/02 05:15 PM
Please respond to cocoon-users

 
        To:     "'cocoon-users@xml.apache.org'" <co...@xml.apache.org>
        cc: 
        Subject:        RE: Cocoon and EJB


> From: Gustavo Nalle Fernandes [mailto:gustavonf@terra.com.br] 
> 
>  In J2EE world, cocoon would play the role of the 
> presentation tier, same as struts. In some cases, cocoon 
> would bypass EJBs, to provide read-only data-retrieval 
> (faster than instantiate thousands of bean in memory). What 
> about a ValueObject generator, that by reflection generates 
> sax events containing a bean atributes and values, with the 
> option of specifing the "depth" (number of levels of child 
> beans) wanted ?

Value objects can be easily XML-ized using Castor transformer. Take a look
at it in Cocoon scratchpad.
Somebody suggested already this solution and also the JXPath-based
generation or XSP logicsheet generator.

--
  Konstantin

> 
> 
> Gustavo
> 
> 
> -----Mensagem original-----
> De: Emmanuil Batsis (Manos) [mailto:mbatsis@humanmarkup.org] 
> Enviada em: sexta-feira, 25 de outubro de 2002 11:59
> Para: cocoon-users@xml.apache.org
> Assunto: Re: Cocoon and EJB
> 
> 
> Martin Schimak wrote:
> 
> > Are there any resources available focusing on EJB and Cocoon?
> 
> The million dollar question. I'm trying to push Cocoon in the 
> company I work for and I keep stumbling upon it.
> 
> Manos
> 
> 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
> 
> 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
> 

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>