jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting ...@yukatan.fi>
Subject Re: BadXSLT in maven.xml
Date Sat, 12 Feb 2005 23:28:10 GMT
Hi Manoj,

You wrote:
> I'm eager to try this out, but I'm getting the
> following build error:
> [...]
> I figure it's related to the BadXSLT comment in
> maven.xml, but not sure how to fix it.

Are you using JDK 1.5?

I believe you are experiencing the exact same problem that we had about
a month ago. It's a known issue with no good solution. A workaround is
to download the Xalan binaries and place xalan.jar in
$MAVEN_HOME/lib/endorsed. For more details, please check the longer
message included below.

PS. Should we place this issue in Jira or in an FAQ?

Best regards,

Jukka Zitting

----

Hi all,

<summary>
Place xalan.jar in $MAVEN_HOME/lib/endorsed to build the latest (since 
2004-12-22) Jackrabbit sources with JDK 1.5.
</summary>

Below is a description of the details of the problem. I hope someone
finds this useful.

I ran into the same problem as Oliver Kiessler after updating my source
tree. I'd like to keep using JDK 1.5, so I first traced the problem to
the following lines in maven.xml (line breaks added for clarity):

<!-- The following is a hack to get xslt work with maven
      (See: http://maven.apache.org/faq.html#BadXSLT ) -->
${systemScope.setProperty(
      'javax.xml.transform.TransformerFactory',
      'org.apache.xalan.processor.TransformerFactoryImpl')}

The JavaCC grammar in src/grammar/xpath makes heavy use of XSLT, and the
following ant:xslt entries in maven.xml handle the transformations:

       <ant:xslt style="src/grammar/xpath/strip.xsl"
              in="src/grammar/xpath/xpath-grammar.xml"
              out="src/grammar/xpath/stripped-xpath-grammar.xml"
              force="yes">
       </ant:xslt>
       <ant:xslt style="src/grammar/xpath/jjtree-jackrabbit.xsl"
              in="src/grammar/xpath/stripped-xpath-grammar.xml"
              out="src/grammar/xpath/XPath.jjt"
              force="yes">
       </ant:xslt>

The systemScope.setProperty() hack is needed to make the ant:xslt task
work properly with Maven (see [1]). However, as mentioned in the
comments of the associated bug entry [2], this hack doesn't work with
JDK 1.5 that uses the new Xalan XSLTC compiler at
com.sum.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.

Unfortunately the problem could not be solved by simply changing the
systemScope.setProperty() line because the XSLTC version bundled with
JDK 1.5 has problems with named templates (probably bug [3]). Instead of
the "provider not found" errors from ant:xslt, I now received
NoSuchMethodError exceptions from XSLTC.

As an alternative solution, I then downloaded the normal Xalan binaries
and placed xalan.jar in $MAVEN_HOME/lib/endorsed. I was then able to run
maven jar without problems. Note that the library needs to be placed in
lib/endorsed instead of just lib to make the Xalan classes visible for
the ant:xslt task.

Although this solution is a bit of a hack, I don't think a better one is
possible until either the Maven problem gets solved or the JDK XSLTC
gets fixed.

BR,

Jukka Zitting

[1] http://maven.apache.org/faq.html#BadXSLT
[2] http://jira.codehaus.org/secure/ViewIssue.jspa?key=MAVEN-156
[3] http://issues.apache.org/jira/browse/XALANJ-1994



Mime
View raw message