cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabien Campagne <>
Subject Re: cocoon and JServ repositories : severe flexibility problem
Date Sat, 04 Mar 2000 00:17:33 GMT
Stefano Mazzocchi wrote:

> > Fabien Campagne wrote:

> > I am looking at the feasability of mixing Java servlets with Cocoon/XSP.
> > We have a web service built with the servlet API that we would need
> > to extend with XSP pages. During development, we need the ability to
> > compile and execute XPS pages which use code defined in (a) package(s) stored
> > in the JServ repository. The package is there because several developers

> I don't think this is that easy. It's also a classloading issue. I
> wonder if this can be JServ abstracted... if not.. we are in serious
> trouble since this requires a Servlet API change!!!

I quickly realized that this solution was not enough. The solution 
requires to obtain the classes from exactly the same class-loader 
as JServ does. If not, the static variables defined in the servlet
environment will not be available to XSP.
I experimented an ugly hack: patch JServ to obtain the classloader,
and patch cocoon to install JServ's classloader instead of the 
one used normally. Then you add the cocoon repository to the JServ
repository for the zone that serves both servlets and XSP.
I also changed the java.class.path to to make
it distinct from the CLASSPATH of the jserv engine that runs Cocoon.

I did not want to obtain the whole cocoon distribution and compile
it so I just recompiled the XSPJavaProcessor.class file and updated
it in the jar.

The results were mitigated. With cocoon 1.6, I obtained the desired 
behabiour but also some ClassNotFound exceptions the second time 
I was accessing the pages. I guess there is a relationship to the 
caching mechanism that I do not  know. With Cocoon 1.7, I obtained the 
ClassNotFound exceptions immediately.

Of course, because this was just a tentative, I did not consider security
issues at this step and I cannot offer a clean design. I just thought you
might be interested.

Fabien Campagne      -- Dept. of Physiology and Biophysics,   
phone: (212)-241-0860   Box 1218, Mount Sinai School of Medicine,
fax:   (212)-860-3369   One Gustave L. Levy Place,
---------------------   New York, NY 10029-6574 -----------------

View raw message