You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@coremedia.com on 2003/07/30 21:33:56 UTC

Jasper & Cocoon's Eclipse Compiler Plugin

Hi,

I'm experimenting with embedding Jasper/JSP 2.0 into production servlet
2.3 containers / JSP 1.2. That works surprisingly well, using an
alternative lib directory and an additional classloader. (I want to run
tagfiles in Websphere,Dynamo,... before 2005.)

Anwyay, one of the obstacles is Jasper's requirement for the container's
URLClassLoader for assembling a classpath for the compiler. The cocoon
project has solved this by using an Eclipse Java compiler plugin that
reads classes on demand from the thread context classloader. I.e. no jar
location is needed.

I've patched Jasper to use that compiler plugin instead of ant and it
works very well so far. It's even much faster than javac.

Is there interest to incorporate that compiler and remove the
URLClassLoader requirement ?

Matthias
-- 
Matthias Ernst
Software Engineer

CoreMedia - Smart Content Technology


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Jasper & Cocoon's Eclipse Compiler Plugin

Posted by ma...@coremedia.com.
On Thu, 31 Jul 2003, Remy Maucherat wrote:

> Jasper uses Ant and that was a rather painful switch which needed lots
> of testing to start working fine. You should be able to use EDT through Ant.
> I'm against what you propose (lots of pain, no gain).

You are right. With some afterthought, I was able to build an Ant
CompilerAdapter that does what I described. I can make that public but it
no longer touches Jasper.

Sorry for the stir up
Matthias
-- 
Matthias Ernst
Software Engineer

CoreMedia - Smart Content Technology


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Jasper & Cocoon's Eclipse Compiler Plugin

Posted by Remy Maucherat <re...@apache.org>.
matthias.ernst@coremedia.com wrote:
> Hi,
> 
> I'm experimenting with embedding Jasper/JSP 2.0 into production servlet
> 2.3 containers / JSP 1.2. That works surprisingly well, using an
> alternative lib directory and an additional classloader. (I want to run
> tagfiles in Websphere,Dynamo,... before 2005.)
> 
> Anwyay, one of the obstacles is Jasper's requirement for the container's
> URLClassLoader for assembling a classpath for the compiler. The cocoon
> project has solved this by using an Eclipse Java compiler plugin that
> reads classes on demand from the thread context classloader. I.e. no jar
> location is needed.
> 
> I've patched Jasper to use that compiler plugin instead of ant and it
> works very well so far. It's even much faster than javac.
> 
> Is there interest to incorporate that compiler and remove the
> URLClassLoader requirement ?

Jasper uses Ant and that was a rather painful switch which needed lots 
of testing to start working fine. You should be able to use EDT through Ant.
I'm against what you propose (lots of pain, no gain).

Remy


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Jasper & Cocoon's Eclipse Compiler Plugin

Posted by ma...@coremedia.com.
On Wed, 30 Jul 2003, Glenn Nielsen wrote:

> Plugging in a different javac compiler if it works better may be
> of iterest.  The only way for the tomcat developer community to
> determine this is to submit a patch so that it can be evaluated.

Alright. I'll come up with one. I was only wondering if there were any
objections upfront ...

>
> Could you get more specific about which ClassLoader is conflicting
> with using the Eclipse plugin and why it conflicts?

It's not conflicting; rather Jasper needs to be told where all the jars
are in order to build the -classpath option for the java compiler. It does
so

a) by demanding the context classloader created by the container to be an
URLClassLoader that points to WEB-INF/lib and friends. Jasper will then
extract all 'file:' urls from there (JspRuntimeLibrary)
b) by offering a manual option to set an additional 'classpath' (Options)
c) by using a Tomcat specific 'org.apache.catalina.jsp_classpath' context
attribute (JspRuntimeLibrary)
d) last but not least, by using the system property 'java.class.path'
(Compiler)

This is expected to be the joint classpath of the container-provided
webapp classloader. While this works in Tomcat and Jetty, it doesn't in
Resin. Through the cocoon compiler plugin in conjunction with the eclipse
compiler, there is no need for such reverse engineering, as the
classloader _is_ the classpath.

Stay tuned
Matthias
-- 
Matthias Ernst
Software Engineer

CoreMedia - Smart Content Technology


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Jasper & Cocoon's Eclipse Compiler Plugin

Posted by Glenn Nielsen <gl...@mail.more.net>.
matthias.ernst@coremedia.com wrote:
> Hi,
> 
> I'm experimenting with embedding Jasper/JSP 2.0 into production servlet
> 2.3 containers / JSP 1.2. That works surprisingly well, using an
> alternative lib directory and an additional classloader. (I want to run
> tagfiles in Websphere,Dynamo,... before 2005.)
> 
> Anwyay, one of the obstacles is Jasper's requirement for the container's
> URLClassLoader for assembling a classpath for the compiler. The cocoon
> project has solved this by using an Eclipse Java compiler plugin that
> reads classes on demand from the thread context classloader. I.e. no jar
> location is needed.
> 
> I've patched Jasper to use that compiler plugin instead of ant and it
> works very well so far. It's even much faster than javac.
> 
> Is there interest to incorporate that compiler and remove the
> URLClassLoader requirement ?
> 

Plugging in a different javac compiler if it works better may be
of iterest.  The only way for the tomcat developer community to
determine this is to submit a patch so that it can be evaluated.

Could you get more specific about which ClassLoader is conflicting
with using the Eclipse plugin and why it conflicts?

Glenn


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org