You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Hunsberger, Peter" <Pe...@STJUDE.ORG> on 2004/07/09 16:28:03 UTC

Need hot deployed blocks in 2.1

We've got a new requirement that basically works out to running two
independent applications on a single instance of Cocoon.  We currently
run with JBoss, with everything packaged up into a single EAR that can
be hot deployed into JBoss.  With the new requirements we need to be
able to deploy new versions of both apps without redeploying the other
app at the same time.  

Basically the components we have to worry about are:

- Cocoon (currently a WAR within an EAR);

- Our EJBs which would now likely be deployed independently (still as a
EAR?);

- Our two apps (one of which is currently deployed as a JAR within the
EAR).

I suspect that this means we have to run expanded within JBoss and loose
the convenience of just being able to drop a EAR in and out of JBoss to
redeploy Cocoon?  I'm not sure that we could hot deploy the JAR files
inside of the expanded Cocoon instance?  If we've got to shut down and
restart Cocoon each time we redeploy a JAR we could probably live with
it.

The alternative that I suspect might be possible but take some
development would be to leverage some of the JBoss hot deploy
capabilities.  Essentially, you'd need to somehow update the Cocoon
class loader class path info with the location of the JARs as they were
deployed by JBoss.  If I understand correctly this would be a case of
adding a Mbean to Cocoon that would subscribe to the correct JBoss
deployment messages and use the information in them to update the
running instance of Cocoon.

Once you've got this working you might also want to do the same thing
for the sitemap; run independent sub-sitemaps from within each JAR;
you'd have to update the Cocoon path information so that it can find the
directory locations that JBoss creates when it dynamically deploys the
JARs.  We could likely survive with separating the libraries from the
web files and leaving the web files directly inside Cocoon, but
packaging everything inside a single JAR sure would be nice...

I know this is essentially recreating what people want to do with Cocoon
2.2, but we need this capability now.  I don't expect that many people
here have enough knowledge of the JBoss internals to comment on that
side of things, but how about the Cocoon side?  Basically I need two
things:

1) someway to update the Cocoon class loader class path info
dynamically;

2) someway to reconfigure the Cocoon sitemap to move the location of a
sub-sitemap dynamically.

Anyone know if these both or either would be possible?

Peter Hunsberger


Re: Need hot deployed blocks in 2.1

Posted by Sylvain Wallez <sy...@apache.org>.
Hunsberger, Peter wrote:

<snip/>

>1) someway to update the Cocoon class loader class path info
>dynamically;
>  
>

You should have a look at the ParanoidCocoonServlet : builds a shielded 
classloader with jars and classes that can be located anywhere and 
lauches the CocoonServlet inside that classloader.

>2) someway to reconfigure the Cocoon sitemap to move the location of a
>sub-sitemap dynamically.
>  
>

Can you write an input module that gets the deployment information from 
jboss, i.e.
   <map:mount src="{jboss-deployment:myapp}/" uri-prefix="my-app"/>

Just throwing in some random thoughts...

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }