You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Marcus Crafter <cr...@dresdnerbank.de> on 2000/09/21 19:18:00 UTC
[C2] CocoonServlet change (was [C2] Startup Problem)
Hi All,
Ok, unfortunately after playing with the jar files and CLASSPATH
setting the problem from my previous mail was still apparent.
So, after spending an hour wondering through the C2 source, I found the
cause of the problem and fixed it - here goes:
From what I understand, the call to sun.tools.javac.Main (in
Javac.java) is built up dynamically with stored values (which includes
the classpath) by the method fillArguments (AbstractJavaCompiler.java).
The classpath used to be obtained via a call to System.getProperty()
(in JavaLanguage.java), with the parameters "java.class.path". This
was changed recently to an attribute lookup specific to Tomcat (in
CocoonServlet.java), namely org.apache.catalina.jsp_classpath (I
presume this must be a Tomcat 4.0 attribute, as I currently use Tomcat
3.2beta4).
This explains why changing the classpath didn't fix the problem - it
was ignored in the compiler call.
The comment indicates that Javac (.java) must be redesigned for a long
term solution. Short term - I changed line 78 in CocoonServlet.java
from
this.classpath = (String) context.getAttribute(SERVLET_CLASSPATH);
to
this.classpath = System.getProperty("java.class.path");
and the problem I had before went away.
OK, now that I can use Cocoon2, can someone please explain to me in a
bit more detail what the issues were with Javac (.java) ? And what
would need to be done to it for a long term solution ?
Cheers, thanks for your help. :-)
Marcus
--
.....
,,$$$$$$$$$, Marcus Crafter
;$' '$$$$: Computer Systems Engineer
$: $$$$: Open Software Associates GmbH
$ o_)$$$: 82-84 Mainzer Landstrasse
;$, _/\ &&:' 60327 Frankfurt Germany
' /( &&&
\_&&&&' Email : Marcus.Crafter@osa.de
&&&&. Business Hours : +49 69 9757 200
&&&&&&&: After Hours : +49 69 49086750
Re: [c2] cocoonservlet change (was [c2] startup problem).sdm
Posted by Sebastien Sahuc <ss...@imediation.com>.
Marcus Crafter wrote :
> Short term - I changed line 78 in
> CocoonServlet.java
> from
> this.classpath = (String)
> context.getAttribute(SERVLET_CLASSPATH);
> to
> this.classpath = System.getProperty("java.class.path");
> and the problem I had before went away.
> OK, now that I can use Cocoon2, can someone please explain to me
> in a
> bit more detail what the issues were with Javac (.java) ? And
> what
> would need to be done to it for a long term solution ?
What I've understood so far is that there is 'big' classloader issues
when dealing with Javac. Indeed, Javac doesn't take into account the
WebApplciation Classloader define by the Servlet Container for the Web
application -such application would be Cocoon-, meaning that you need to
get the STRING classpath which is the reason on the hack you saw and
changed above.
That's the reason why Stefano is going back to a middle term solution
that takes advantage of Catalina -if presents-, and if not it will work
with the System classapth (the way it works for you).
Sebastien
> Cheers, thanks for your help. :-)
> Marcus
> --
> .....
> ,,$$$$$$$$$, Marcus Crafter
> ;$' '$$$$: Computer Systems Engineer
> $: $$$$: Open Software Associates GmbH
> $ o_)$$$: 82-84 Mainzer Landstrasse
> ;$, _/\ &&:' 60327 Frankfurt Germany
> ' /( &&&
> \_&&&&' Email : Marcus.Crafter@osa.de
> &&&&. Business Hours : +49 69 9757 200
> &&&&&&&: After Hours : +49 69 49086750
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org