Hi all,
hi Upayavira,

XSP precompilation works great with Cocoon 2.1.3. Finally, I'm able to do 
refactorings across many XSP files. Three points left which prevent me 
from including it into the build process:

1.) Build does not fail if precompilation fails

2.) in order to see build errors on the console, I have to set following 
log entry to DEBUG:

        <category log-level="DEBUG" name="core.program-generator">
                <log-target id-ref="system-out"/> 
        </category>

Thus, output is very verbose, this is an example of what is printed for 
each file (error is there on purpose):

   [cocoon] Loading serverpage 
systemId=[file:/C:/portal/dist/webapp/MyModule/documents/IntroPage.xsp] 
markupLanguageName=[xsp] programmingLanguageName=[java] -> 
normalizedName=[org\apache\cocoon\www\MyModule\documents\IntroPage_xsp]
   [cocoon] The serverpage 
[file:/C:/portal/dist/webapp/MyModule/documents/IntroPage.xsp] is not in 
the cache yet
   [cocoon] The serverpage 
[file:/C:/portal/dist/webapp/MyModule/documents/IntroPage.xsp] could not 
be preloaded, will be re-created 
(org.apache.cocoon.components.language.LanguageException: Unable to 
preload program org\apache\cocoon\www\MyModule\documents\IntroPage_xsp: 
org.apache.cocoon.components.language.LanguageException: Could not load 
class for program 'org\apache\cocoon\www\MyModule\documents\IntroPage_xsp' 
due to a java.lang.ClassNotFoundException: 
org.apache.cocoon.www.MyModule.documents.IntroPage_xsp)
   [cocoon] Creating new serverpage for 
[file:/C:/portal/dist/webapp/MyModule/documents/IntroPage.xsp]
   [cocoon] Creating sourcecode for 
[file:/C:/portal/dist/webapp/MyModule/documents/IntroPage.xsp]
   [cocoon] Successfully created sourcecode for 
[file:/C:/portal/dist/webapp/MyModule/documents/IntroPage.xsp]
   [cocoon] Loading program 
[org\apache\cocoon\www\MyModule\documents\IntroPage_xsp]
   [cocoon] Got Language Exception
   [cocoon] org.apache.cocoon.components.language.LanguageException: Error 
compiling IntroPage_xsp:
   [cocoon] ERROR 1 
(org\apache\cocoon\www\MyModule\documents\IntroPage_xsp.java):
   [cocoon] ...
   [cocoon]
   [cocoon]       import org.apache.cocoon.environment.Session;
   [cocoon]
   [cocoon] // start error (lines 73-73) "Only a type can be imported. 
org.apache.naming.resources.ProxyDirContext resolves to a package"

If I run this on many files, I have to scroll through 1000s of lines and 
look for XSP compilation errors. They should rather be logged on ERROR 
level instead of DEBUG, right?

3. How to compile a subset of files? I tried

        <include pattern="xyz/**"/>

but without success.

This is how my target looks like:

<target name="precompile-xsp-files" description="Compiles previously 
distributed XSP files">

    <property name="cocoon.context" value="${basedir}/lib/cocoon"/>
    <path id="cp">
      <fileset refid="fileset.dist.libs"/>
      <fileset refid="fileset.tomcat.common.libs"/>
      <path location="${dist.dir}/webapp/WEB-INF/classes"/>
    </path>

    <taskdef name="cocoon" classname="org.apache.cocoon.CocoonTask" 
classpathref="cp"/>

                 <cocoon verbose="true"
                         classpathref="cp"
                         follow-links="false"
                         precompile-only="true"
                         confirm-extensions="false"
                         md5-compare="false"
                         context-dir="${dist.dir}/webapp"
                         config-file="{dist.dir}/webapp/WEB-INF/cocoon.xconf"
                         work-dir="${dist.dir}/xsp-build"
                         dest-dir="${dist.dir}/xsp-build"
                         checksums-uri="${dist.dir}/xsp-build/checksums"
                         default-filename="index.html"
                         accept="*/*">

                    <broken-links type="xml"
                                  file="${dist.dir}/xsp-build/brokenlinks.xml"
                                  generate="true"
                                  extension=".error"/>
                    <logging
                        log-kit="${basedir}/src/webapp/WEB-INF/logkit-cli.xconf"
                        logger="cli"
                        level="DEBUG" />

                    <include pattern="xyz/**"/>
                 </cocoon>


Regards,
Jonas


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to