2

Error in configure-ear Macro when Building Example

In certain situations, the xslt task within some of the TIBant macros will use the Xalan xslt processor instead of Saxon, which results in the following error

[tibant:configure-ear] : Error! The first argument to the non-static Java function 'determineSetting' is not a valid object reference.
...snip...
[tibant:configure-ear] : Error! The first argument to the non-static Java function 'ifAbsent' is not a valid object reference.
[tibant:configure-ear] : Error! The first argument to the non-static Java function 'determineSetting' is not a valid object reference.
[tibant:configure-ear] : Error! The first argument to the non-static Java function 'determineSetting' is not a valid object reference.
[tibant:configure-ear] : Error! Error checking type of the expression 'funcall(tokenize, [FilterParentPath(filter-expr(variable-ref(deploy/node-set), [pred(=(st
ep("attribute", 18), funcall(concat, [cast(parameter-ref(prefix/reference), string), literal-expr(bindings)])))]), step("attribute", 19)), literal-expr(,)])'.
[tibant:configure-ear] : Fatal Error! Could not compile stylesheet
[tibant:configure-ear] Failed to process C:\ant\TIBant-1.3.0\example\build\example-a.b.c.xml

This can be fixed by explicitly telling the JVM which XSLT processor to use.

If you are running ant from the command line, then set ANT_OPTS environment variable to -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl. e.g.,

set ANT_OPTS=-Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl

and set the ANT_ARGS environment variable to -lib path\to\saxon9he.jar. e.g., if TIBant is installed in C:\Developer\TIBant

set ANT_ARGS=-lib C:\Developer\TIBant\lib\saxon9e.jar

If you are running ant from Eclipse (or Business Studio), then open the External Tools Configuration from the menu run > External Tools > External Tools Configuration...

 

Select the Ant Build configuration for your project and in the JRE tab in the VM arguments field add

-Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl

Setting_javax.xml.transform.TransformerFactory.png

-lib 

0 comments

Please sign in to leave a comment.