By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,353 Members | 1,235 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,353 IT Pros & Developers. It's quick & easy.

Xalan-J cannot run extension function examples

P: n/a
I have tried to run the extension function/element examples provided
with the Xalan-J download. I believe that my classpath is correct,
and that my versions are up-to-date. However, I can't get past the
following error. Any help, please?
================================================== =========================

C:\xalan>test

C:\xalan>REM @echo off

C:\xalan>set XALANPATH=C:\xalan\xalan-j_2_6_0

C:\xalan>set CLASSPATH=C:\xalan\xalan-j_2_6_0\bin\xalan.jar

C:\xalan>set CLASSPATH=C:\xalan\xalan-j_2_6_0\bin\xalan.jar;C:\xalan\xalan-j_2_6
_0\bin\xercesImpl.jar

C:\xalan>rem ~~~~~~ EXTENSIONS ~~~~~

C:\xalan>set ClassPath=C:\xalan\xalan-j_2_6_0\bin\xalan.jar;C:\xalan\xalan-j_2_6
_0\bin\xercesImpl.jar;C:\xalan\xalan-j_2_6_0\bin\xml-apis.jar

C:\xalan>set ClassPath=C:\xalan\xalan-j_2_6_0\bin\xalan.jar;C:\xalan\xalan-j_2_6
_0\bin\xercesImpl.jar;C:\xalan\xalan-j_2_6_0\bin\xml-apis.jar;C:\xalan\xalan-j_2
_6_0\bin\bsf.jar

C:\xalan>set ClassPath=C:\xalan\xalan-j_2_6_0\bin\xalan.jar;C:\xalan\xalan-j_2_6
_0\bin\xercesImpl.jar;C:\xalan\xalan-j_2_6_0\bin\xml-apis.jar;C:\xalan\xalan-j_2
_6_0\bin\bsf.jar;C:\xalan\xalan-j_2_6_0\rhino\js.jar

C:\xalan>echo C:\xalan\xalan-j_2_6_0\bin\xalan.jar;C:\xalan\xalan-j_2_6_0\bin\xe
rcesImpl.jar;C:\xalan\xalan-j_2_6_0\bin\xml-apis.jar;C:\xalan\xalan-j_2_6_0\bin\
bsf.jar;C:\xalan\xalan-j_2_6_0\rhino\js.jar
C:\xalan\xalan-j_2_6_0\bin\xalan.jar;C:\xalan\xalan-j_2_6_0\bin\xercesImpl.jar;C
:\xalan\xalan-j_2_6_0\bin\xml-apis.jar;C:\xalan\xalan-j_2_6_0\bin\bsf.jar;C:\xal
an\xalan-j_2_6_0\rhino\js.jar

C:\xalan>java -version
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)

C:\xalan>set SAMPLES=C:\xalan\xalan-j_2_6_0\samples\extensions

C:\xalan>set tstXML=C:\xalan\xalan-j_2_6_0\samples\extensions\2-basicJscript.xml
C:\xalan>set tstXSL=C:\xalan\xalan-j_2_6_0\samples\extensions\2-basicJscript.xsl
C:\xalan>java org.apache.xalan.xslt.Process -IN
C:\xalan\xalan-j_2_6_0\samples\e
xtensions\2-basicJscript.xml -XSL
C:\xalan\xalan-j_2_6_0\samples\extensions\2-ba
sicJscript.xsl -OUT test_out.txt
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.xalan.extensions.ExtensionHandlerGenera l.<init>(ExtensionH
andlerGeneral.java:293)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native
Method)

at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Construc tor.java:274)
at org.apache.xalan.extensions.ExtensionNamespaceSupp ort.launch(Extensio
nNamespaceSupport.java:74)
at org.apache.xalan.extensions.ExtensionsTable.<init> (ExtensionsTable.ja
va:118)
at org.apache.xalan.transformer.TransformerImpl.setEx tensionsTable(Trans
formerImpl.java:437)
at org.apache.xalan.transformer.TransformerImpl.trans formNode(Transforme
rImpl.java:1169)
at org.apache.xalan.transformer.TransformerImpl.trans form(TransformerImp
l.java:668)
at org.apache.xalan.transformer.TransformerImpl.trans form(TransformerImp
l.java:1129)
at org.apache.xalan.transformer.TransformerImpl.trans form(TransformerImp
l.java:1107)
at org.apache.xalan.xslt.Process.main(Process.java:10 41)
Caused by: com.ibm.bsf.BSFException: JavaScript Error: Internal Error:
java.lang
..IllegalArgumentException: Line number can not be negative:-1
at com.ibm.bsf.engines.javascript.JavaScriptEngine.ha ndleError(JavaScrip
tEngine.java:182)
at com.ibm.bsf.engines.javascript.JavaScriptEngine.ev al(JavaScriptEngine
..java:87)
at com.ibm.bsf.util.BSFEngineImpl.exec(BSFEngineImpl. java:106)
... 17 more
javax.xml.transform.TransformerException:
java.lang.reflect.InvocationTargetExce
ption
at org.apache.xalan.extensions.ExtensionNamespaceSupp ort.launch(Extensio
nNamespaceSupport.java:80)
at org.apache.xalan.extensions.ExtensionsTable.<init> (ExtensionsTable.ja
va:118)
at org.apache.xalan.transformer.TransformerImpl.setEx tensionsTable(Trans
formerImpl.java:437)
at org.apache.xalan.transformer.TransformerImpl.trans formNode(Transforme
rImpl.java:1169)
at org.apache.xalan.transformer.TransformerImpl.trans form(TransformerImp
l.java:668)
at org.apache.xalan.transformer.TransformerImpl.trans form(TransformerImp
l.java:1129)
at org.apache.xalan.transformer.TransformerImpl.trans form(TransformerImp
l.java:1107)
at org.apache.xalan.xslt.Process.main(Process.java:10 41)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native
Method)

at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Construc tor.java:274)
at org.apache.xalan.extensions.ExtensionNamespaceSupp ort.launch(Extensio
nNamespaceSupport.java:74)
... 7 more
Caused by: javax.xml.transform.TransformerException: Could not compile
extension

at org.apache.xalan.extensions.ExtensionHandlerGenera l.<init>(ExtensionH
andlerGeneral.java:300)
... 12 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.xalan.extensions.ExtensionHandlerGenera l.<init>(ExtensionH
andlerGeneral.java:293)
... 12 more
Caused by: com.ibm.bsf.BSFException: JavaScript Error: Internal Error:
java.lang
..IllegalArgumentException: Line number can not be negative:-1
at com.ibm.bsf.engines.javascript.JavaScriptEngine.ha ndleError(JavaScrip
tEngine.java:182)
at com.ibm.bsf.engines.javascript.JavaScriptEngine.ev al(JavaScriptEngine
..java:87)
at com.ibm.bsf.util.BSFEngineImpl.exec(BSFEngineImpl. java:106)
... 17 more
---------
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native
Method)

at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Construc tor.java:274)
at org.apache.xalan.extensions.ExtensionNamespaceSupp ort.launch(Extensio
nNamespaceSupport.java:74)
at org.apache.xalan.extensions.ExtensionsTable.<init> (ExtensionsTable.ja
va:118)
at org.apache.xalan.transformer.TransformerImpl.setEx tensionsTable(Trans
formerImpl.java:437)
at org.apache.xalan.transformer.TransformerImpl.trans formNode(Transforme
rImpl.java:1169)
at org.apache.xalan.transformer.TransformerImpl.trans form(TransformerImp
l.java:668)
at org.apache.xalan.transformer.TransformerImpl.trans form(TransformerImp
l.java:1129)
at org.apache.xalan.transformer.TransformerImpl.trans form(TransformerImp
l.java:1107)
at org.apache.xalan.xslt.Process.main(Process.java:10 41)
Caused by: javax.xml.transform.TransformerException: Could not compile
extension

at org.apache.xalan.extensions.ExtensionHandlerGenera l.<init>(ExtensionH
andlerGeneral.java:300)
... 12 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.xalan.extensions.ExtensionHandlerGenera l.<init>(ExtensionH
andlerGeneral.java:293)
... 12 more
Caused by: com.ibm.bsf.BSFException: JavaScript Error: Internal Error:
java.lang
..IllegalArgumentException: Line number can not be negative:-1
at com.ibm.bsf.engines.javascript.JavaScriptEngine.ha ndleError(JavaScrip
tEngine.java:182)
at com.ibm.bsf.engines.javascript.JavaScriptEngine.ev al(JavaScriptEngine
..java:87)
at com.ibm.bsf.util.BSFEngineImpl.exec(BSFEngineImpl. java:106)
... 17 more

file:///C:/xalan/xalan-j_2_6_0/samples/extensions/2-basicJscript.xsl;
Line #33;
Column #42; XSLT Error (javax.xml.transform.TransformerException):
java.lang.Nul
lPointerException

C:\xalan>
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Make sure you're using 1.4.2
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.