You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Olivier Billard <ol...@laposte.net> on 2005/01/10 18:55:09 UTC

[CLI] Problem with XSP compilation

Hi Cocooners,

First, I wish you a great year and may all your projects (professionnal but also personal) be accomplished !

Then, I would like to explain my pb.
I developped a small app that creates a cli.xconf file with all XSP of a webapp. Then when I launch the Cocoon CLI, it stops 
without an error or a warning, and no XSP is compiled.

Here is a snippet of the xconf file, maybe something will shock you :

<cocoon verbose="true"
         follow-links="false"
         precompile-only="true"
         confirm-extensions="false">

	<context-dir>E:\Dev\Soprano\Soprano\defaultroot</context-dir>
	<config-file>E:\Dev\Soprano\Soprano\defaultroot\WEB-INF\cocoon.xconf</config-file>
	<work-dir>E:\Dev\Soprano\Soprano\defaultroot\work</work-dir>
	<dest-dir>E:\Dev\Soprano\Soprano\defaultroot\dest</dest-dir>


    <broken-links type="xml"
                  file="brokenlinks.xml"
                  generate="false"
                  extension=".error"/>


    <logging log-kit="E:\Dev\Soprano\Soprano\defaultroot\WEB-INF\logkit.xconf" logger="cli" level="DEBUG" />
    <default-filename>index.html</default-filename>
    <accept>*/*</accept>
    <include pattern="**"/>
    <exclude pattern="docs/apidocs/**"/>

   <uri type="replace" src-prefix="" src="xsl/common/GenXML_Country.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_Currency.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedAbstract.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedAccounting.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedAgent.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedApplicant.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedAppm.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedCategory.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedCorresp.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedDrawings.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedFee.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedFtocollect.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedHistory.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedHistory2.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedInventor.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedIpc.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedLicense.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedOwner.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedPaydetail.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedPayment.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedPctref.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedPicture.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedPriority.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedPublication.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedStdclass.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_LinkedUnofficialAgent.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_Location.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_Payer.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_PV.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_SPC-BasicPatent.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_Status.xsp" dest="build/dest/" />
   <uri type="replace" src-prefix="" src="xsl/common/GenXML_User.xsp" dest="build/dest/" />
</cocoon>


Some time ago, a post suggested to put the servlet.jar in the webapp/WEB-INF/lib, but no success with this tip.
I tried with the 20050110111331 snapshot and the 2.1.6 release...
Many many thanks in advance, 'cause I'm turning mad.

--
Olivier Billard


Re: [CLI] Problem with XSP compilation

Posted by Olivier Billard <ol...@laposte.net>.
Sylvain Wallez wrote:
> Olivier Billard wrote:
> 
>> Hi Cocooners,
>>
>> First, I wish you a great year and may all your projects 
>> (professionnal but also personal) be accomplished !
>>
>> Then, I would like to explain my pb.
>> I developped a small app that creates a cli.xconf file with all XSP of 
>> a webapp. Then when I launch the Cocoon CLI, it stops without an error 
>> or a warning, and no XSP is compiled.
>>
>> Here is a snippet of the xconf file, maybe something will shock you :
>>
>> <cocoon verbose="true"
>>         follow-links="false"
>>         precompile-only="true"
>>         confirm-extensions="false">
> 
> 
> 
> <snip/>
> 
>> Some time ago, a post suggested to put the servlet.jar in the 
>> webapp/WEB-INF/lib, but no success with this tip.
>> I tried with the 20050110111331 snapshot and the 2.1.6 release...
>> Many many thanks in advance, 'cause I'm turning mad.
> 
> 
> 
> I had a quick look at the CocoonBean and associated classes, and it 
> turns out that precompile-only has been violently deleted when XSP was 
> moved to its own block.
> 
> Was it on purpose or just because of lazyness ? I can't remember a 
> discussion about this, and the precompile-only is still available but 
> silently ignored...

Thanks for your answer, Sylvain.
I temporarily went back to the precompile-specific code, to re-insert this code on a patched version of the 2.1.6.
My Cocoon-core knowledge is not very good, and my time is more than counted, so I can't help on this "re-integration", maybe 
later, if someone more skilled doesn't have done it :).

Thanks again for the care !

--
Olivier


Re: [CLI] Problem with XSP compilation

Posted by Simon Mieth <si...@gmx.de>.
On Wed, 12 Jan 2005 15:47:34 +0100
Olivier Billard <ol...@laposte.net> wrote:

> Thanks for the answer, Simon.
> Unfortunatly, this doesn't work for me, because I'm using Windows, and
the environment vars max length isn't that long, to store 
> all cocoon needed jars... And your solution requires to use the
CLASSPATH env var...
> 
> But this could have helped me :)
> 
> --
> Olivier

Hi Olivier,

Ant can do the job too. Here is a simple build-file.


<project name="XSPPrecompile" default="precompile" basedir=".">
 <property name="cocoon.home" value="build/webapp"/>
 <property name="cocoon.work" value="work"/>



 <target name="precompile">
    <java classname="org.apache.cocoon.bean.XSPPrecompileWrapper"
          fork="yes">    

       <!-- the commandline switches -->
       <arg line="-c ${cocoon.home} -w ${cocoon.work}"/>

       <!-- add here things you need -->
       <classpath>
       	  <fileset dir="${cocoon.home}/WEB-INF/lib">
	     <include name="**/*.jar" />
	  </fileset>
          <fileset dir="${cocoon.home}/WEB-INF/classes">
	     <include name="**/*.class" />
	  </fileset>
       </classpath>   
    </java>
 </target>
</project>


Put this ('precompile.xml') to the cocoon-root folder of your
cocoon-distribution and you can use the bundled ant from cocoon by:

java -cp tools/lib/ant.jar;tools/lib/ant-launcher.jar
       org.apache.tools.ant.Main -f precompile.xml

will generate all to the work-directory (cocoon.work-property). 


Best Regards,

Simon






Re: [CLI] Problem with XSP compilation

Posted by Olivier Billard <ol...@laposte.net>.
Many thanks Simon,

Good to see there's a workaround !
I'll note this solution for the future, but as I wrote sooner, I got it by patching the CocoonBean with XSP-specific code remove 
from 2.1.4 to 2.1.5. But your solution is cleaner.

Thanks again !

--
Olivier


Simon Mieth wrote:
> On Wed, 12 Jan 2005 15:47:34 +0100
> Olivier Billard <ol...@laposte.net> wrote:
> 
> 
>>Thanks for the answer, Simon.
>>Unfortunatly, this doesn't work for me, because I'm using Windows, and
> 
> the environment vars max length isn't that long, to store 
> 
>>all cocoon needed jars... And your solution requires to use the
> 
> CLASSPATH env var...
> 
>>But this could have helped me :)
>>
>>--
>>Olivier
> 
> 
> Hi Olivier,
> 
> Ant can do the job too. Here is a simple build-file.
> 
> 
> <project name="XSPPrecompile" default="precompile" basedir=".">
>  <property name="cocoon.home" value="build/webapp"/>
>  <property name="cocoon.work" value="work"/>
> 
> 
> 
>  <target name="precompile">
>     <java classname="org.apache.cocoon.bean.XSPPrecompileWrapper"
>           fork="yes">    
> 
>        <!-- the commandline switches -->
>        <arg line="-c ${cocoon.home} -w ${cocoon.work}"/>
> 
>        <!-- add here things you need -->
>        <classpath>
>        	  <fileset dir="${cocoon.home}/WEB-INF/lib">
> 	     <include name="**/*.jar" />
> 	  </fileset>
>           <fileset dir="${cocoon.home}/WEB-INF/classes">
> 	     <include name="**/*.class" />
> 	  </fileset>
>        </classpath>   
>     </java>
>  </target>
> </project>
> 
> 
> Put this ('precompile.xml') to the cocoon-root folder of your
> cocoon-distribution and you can use the bundled ant from cocoon by:
> 
> java -cp tools/lib/ant.jar;tools/lib/ant-launcher.jar
>        org.apache.tools.ant.Main -f precompile.xml
> 
> will generate all to the work-directory (cocoon.work-property). 
> 
> 
> Best Regards,
> 
> Simon


Re: [CLI] Problem with XSP compilation

Posted by Simon Mieth <si...@t-online.de>.
On Wed, 12 Jan 2005 15:47:34 +0100
Olivier Billard <ol...@laposte.net> wrote:

> Thanks for the answer, Simon.
> Unfortunatly, this doesn't work for me, because I'm using Windows, and
the environment vars max length isn't that long, to store 
> all cocoon needed jars... And your solution requires to use the
CLASSPATH env var...
> 
> But this could have helped me :)
> 
> --
> Olivier

Hi Olivier,

Ant can do the job too. Here is a simple build-file.


<project name="XSPPrecompile" default="precompile" basedir=".">
 <property name="cocoon.home" value="build/webapp"/>
 <property name="cocoon.work" value="work"/>



 <target name="precompile">
    <java classname="org.apache.cocoon.bean.XSPPrecompileWrapper"
          fork="yes">    

       <!-- the commandline switches -->
       <arg line="-c ${cocoon.home} -w ${cocoon.work}"/>

       <!-- add here things you need -->
       <classpath>
       	  <fileset dir="${cocoon.home}/WEB-INF/lib">
	     <include name="**/*.jar" />
	  </fileset>
          <fileset dir="${cocoon.home}/WEB-INF/classes">
	     <include name="**/*.class" />
	  </fileset>
       </classpath>   
    </java>
 </target>
</project>


Put this ('precompile.xml') to the cocoon-root folder of your
cocoon-distribution and you can use the bundled ant from cocoon by:

java -cp tools/lib/ant.jar;tools/lib/ant-launcher.jar
       org.apache.tools.ant.Main -f precompile.xml

will generate all to the work-directory (cocoon.work-property). 


Best Regards,

Simon






Re: [CLI] Problem with XSP compilation

Posted by Olivier Billard <ol...@laposte.net>.
Simon Mieth wrote:
> Hi,
> 
> some weeks ago I collect all the removed stuff into a single
> XSPPrecompileWrapper. The wrapper is located in the XSP-block and 
> it is only available by including the block.
> 
> Maybe a poor solution, but leaves the CocoonBean independent from
> blocks.
> 
> The patch is in Bugzilla:
> http://issues.apache.org/bugzilla/show_bug.cgi?id=29360

Thanks for the answer, Simon.
Unfortunatly, this doesn't work for me, because I'm using Windows, and the environment vars max length isn't that long, to store 
all cocoon needed jars... And your solution requires to use the CLASSPATH env var...

But this could have helped me :)

--
Olivier


Re: [CLI] Problem with XSP compilation

Posted by Sylvain Wallez <sy...@apache.org>.
Simon Mieth wrote:

>On Tue, 11 Jan 2005 15:47:30 +0100
>Sylvain Wallez <sy...@apache.org> wrote:
>
>
>  
>
>>I had a quick look at the CocoonBean and associated classes, and it 
>>turns out that precompile-only has been violently deleted when XSP was moved to its own block.
>>
>>Was it on purpose or just because of lazyness ? I can't remember a 
>>discussion about this, and the precompile-only is still available but 
>>silently ignored...
>>
>>Sylvain
>>    
>>
>
>
>Hi,
>
>some weeks ago I collect all the removed stuff into a single
>XSPPrecompileWrapper. The wrapper is located in the XSP-block and 
>it is only available by including the block.
>
>Maybe a poor solution, but leaves the CocoonBean independent from
>blocks.
>
>The patch is in Bugzilla:
>http://issues.apache.org/bugzilla/show_bug.cgi?id=29360
>  
>

Thanks, I will take a look at it.

Sylvain

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


Re: [CLI] Problem with XSP compilation

Posted by Simon Mieth <si...@t-online.de>.
On Tue, 11 Jan 2005 15:47:30 +0100
Sylvain Wallez <sy...@apache.org> wrote:


> I had a quick look at the CocoonBean and associated classes, and it 
> turns out that precompile-only has been violently deleted when XSP was

> moved to its own block.
> 
> Was it on purpose or just because of lazyness ? I can't remember a 
> discussion about this, and the precompile-only is still available but 
> silently ignored...
> 
> Sylvain


Hi,

some weeks ago I collect all the removed stuff into a single
XSPPrecompileWrapper. The wrapper is located in the XSP-block and 
it is only available by including the block.

Maybe a poor solution, but leaves the CocoonBean independent from
blocks.

The patch is in Bugzilla:
http://issues.apache.org/bugzilla/show_bug.cgi?id=29360

Best Regards,

Simon

Re: [CLI] Problem with XSP compilation

Posted by Sylvain Wallez <sy...@apache.org>.
Olivier Billard wrote:

> Hi Cocooners,
>
> First, I wish you a great year and may all your projects 
> (professionnal but also personal) be accomplished !
>
> Then, I would like to explain my pb.
> I developped a small app that creates a cli.xconf file with all XSP of 
> a webapp. Then when I launch the Cocoon CLI, it stops without an error 
> or a warning, and no XSP is compiled.
>
> Here is a snippet of the xconf file, maybe something will shock you :
>
> <cocoon verbose="true"
>         follow-links="false"
>         precompile-only="true"
>         confirm-extensions="false">


<snip/>

> Some time ago, a post suggested to put the servlet.jar in the 
> webapp/WEB-INF/lib, but no success with this tip.
> I tried with the 20050110111331 snapshot and the 2.1.6 release...
> Many many thanks in advance, 'cause I'm turning mad.


I had a quick look at the CocoonBean and associated classes, and it 
turns out that precompile-only has been violently deleted when XSP was 
moved to its own block.

Was it on purpose or just because of lazyness ? I can't remember a 
discussion about this, and the precompile-only is still available but 
silently ignored...

Sylvain

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