xml-xalan-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthias Schölch (JIRA) <xalan-...@xml.apache.org>
Subject [jira] Commented: (XALANJ-2372) Exception using javascript extensions
Date Thu, 08 Mar 2007 08:47:24 GMT

    [ https://issues.apache.org/jira/browse/XALANJ-2372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12479266
] 

Matthias Schölch commented on XALANJ-2372:
------------------------------------------

Hi Christine,
thx for your fast answer. Okay Im not very familar with java and Ive copied the files into
the %JAVA_HOME/lib/endorsed and cutted it out from my xalan.bat file. the result would be
the same (but the exception is smaller ;))

D:\fop>xalan.bat -in d:\fopt\data.xml -xsl d:\fopt\test.xsl -out d:\fopt\out.htm
l
javax.xml.transform.TransformerException: java.lang.reflect.InvocationTargetExce
ption
        at org.apache.xalan.extensions.ExtensionNamespaceSupport.launch(Extensio
nNamespaceSupport.java:99)
        at org.apache.xalan.extensions.ExtensionsTable.<init>(ExtensionsTable.ja
va:64)
        at org.apache.xalan.transformer.TransformerImpl.setExtensionsTable(Trans
formerImpl.java:441)
        at org.apache.xalan.transformer.TransformerImpl.transformNode(Transforme
rImpl.java:1323)
        at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp
l.java:709)
        at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp
l.java:1284)
        at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp
l.java:1262)
        at org.apache.xalan.xslt.Process.main(Process.java:1046)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        at org.apache.xalan.extensions.ExtensionNamespaceSupport.launch(Extensio
nNamespaceSupport.java:93)
        ... 7 more
Caused by: java.lang.ExceptionInInitializerError
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        at java.lang.Class.newInstance0(Class.java:308)
        at java.lang.Class.newInstance(Class.java:261)
        at org.apache.xalan.extensions.ObjectFactory.newInstance(ObjectFactory.j
ava:457)
        at org.apache.xalan.extensions.ExtensionHandlerGeneral.<init>(ExtensionH
andlerGeneral.java:204)
        ... 12 more
Caused by: java.lang.NullPointerException
        at org.apache.bsf.BSFManager.<clinit>(BSFManager.java:112)
        ... 20 more

file:///d:/fopt/test.xsl; Zeilennummer18; Spaltennummer53; XSLT-Fehler (javax.xm
l.transform.TransformerException): java.lang.NullPointerException
Exception in thread "main" java.lang.RuntimeException: java.lang.NullPointerExce
ption
        at org.apache.xalan.xslt.Process.doExit(Process.java:1153)
        at org.apache.xalan.xslt.Process.main(Process.java:1126)

my new xalan.bat:

@ECHO OFF

set LIBDIR=lib
set LOCALCLASSPATH=build/fop.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\js.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\bsf.jar

%JAVA_HOME%\bin\java -cp %LOCALCLASSPATH% org.apache.xalan.xslt.Process %1 %2 %3 %4 %5 %6
%7 %8

and my xalan:checkEnvironment()

<?xml version="1.0" encoding="UTF-8"?>
<out>
<checkEnvironmentExtension>
<EnvironmentCheck version="$Revision: 1.29 $">
<environment>
<item key="version.DOM.draftlevel">2.0fd</item>
<item key="java.class.path">build/fop.jar;lib\js.jar;lib\bsf.jar</item>
<item key="version.JAXP">1.1 or higher</item>
<item key="java.ext.dirs">C:\j2sdk1.4.2_05\jre\lib\ext</item>
<foundJar desc="apparent.version" name="serializer.jar">serializer.jar present-unknown-version</foundJar>
<foundJar desc="path" name="serializer.jar">C:\j2sdk1.4.2_05\jre\lib\endorsed\serializer.jar</foundJar>
<foundJar desc="path" name="xalan.jar">C:\j2sdk1.4.2_05\jre\lib\endorsed\xalan.jar</foundJar>
<foundJar desc="apparent.version" name="xercesImpl.jar">xercesImpl.jar from Xerces-J-bin.2.7.1</foundJar>
<foundJar desc="path" name="xercesImpl.jar">C:\j2sdk1.4.2_05\jre\lib\endorsed\xercesImpl.jar</foundJar>
<foundJar desc="apis.jar-apparent.version" name="xml">xml-apis.jar from head branch
of xml-commons, tag: xml-commons-external_1_3_02</foundJar>
<foundJar desc="apis.jar-path" name="xml">C:\j2sdk1.4.2_05\jre\lib\endorsed\xml-apis.jar</foundJar>
<item key="version.xerces2">Xerces-J 2.7.1</item>
<item key="version.xerces1">not-present</item>
<item key="version.xalan2_2">Xalan Java 2.7.0</item>
<item key="version.xalan1">not-present</item>
<item key="version.ant">not-present</item>
<item key="java.version">1.4.2_05</item>
<item key="version.DOM">2.0</item>
<item key="version.crimson">present-unknown-version</item>
<item key="sun.boot.class.path">C:\j2sdk1.4.2_05\jre\lib\endorsed\batik.jar;C:\j2sdk1.4.2_05\jre\lib\endorsed\bsf.jar;C:\j2sdk1.4.2_05\jre\lib\endorsed\js.jar;C:\j2sdk1.4.2_05\jre\lib\endorsed\serializer.jar;C:\j2sdk1.4.2_05\jre\lib\endorsed\xalan.jar;C:\j2sdk1.4.2_05\jre\lib\endorsed\xercesImpl.jar;C:\j2sdk1.4.2_05\jre\lib\endorsed\xml-apis.jar;C:\j2sdk1.4.2_05\jre\lib\rt.jar;C:\j2sdk1.4.2_05\jre\lib\i18n.jar;C:\j2sdk1.4.2_05\jre\lib\sunrsasign.jar;C:\j2sdk1.4.2_05\jre\lib\jsse.jar;C:\j2sdk1.4.2_05\jre\lib\jce.jar;C:\j2sdk1.4.2_05\jre\lib\charsets.jar;C:\j2sdk1.4.2_05\jre\classes</item>
<item key="version.SAX">2.0</item>
<item key="version.xalan2x">Xalan Java 2.7.0</item>
</environment>
<status result="OK"/>
</EnvironmentCheck>
</checkEnvironmentExtension>
</out>


> Exception using javascript extensions
> -------------------------------------
>
>                 Key: XALANJ-2372
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2372
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: Xalan-extensions
>    Affects Versions: 2.7
>         Environment: XP SP2, Java 1.6.0-b105/ 1.4.2_05, Xalan 2.7 , xerces-2_9_0, bsf.jar
2.4, js.jar (testet with 1.6R5, 1.5R5)
>            Reporter: Matthias Schölch
>
> Hi,
> this call wouldn't work. 
> D:\fop>xalan.bat -in D:\fopt\data.xml -xsl D:\fopt\test.xsl -out D:\fopt\foo.html
> javax.xml.transform.TransformerException: java.lang.reflect.InvocationTargetExce
> ption
>         at org.apache.xalan.extensions.ExtensionNamespaceSupport.launch(Extensio
> nNamespaceSupport.java:99)
>         at org.apache.xalan.extensions.ExtensionsTable.<init>(ExtensionsTable.ja
> va:64)
>         at org.apache.xalan.transformer.TransformerImpl.setExtensionsTable(Trans
> formerImpl.java:441)
>         at org.apache.xalan.transformer.TransformerImpl.transformNode(Transforme
> rImpl.java:1323)
>         at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp
> l.java:709)
>         at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp
> l.java:1284)
>         at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp
> l.java:1262)
>         at org.apache.xalan.xslt.Process.main(Process.java:1046)
> Caused by: java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
> rce)
>         at java.lang.reflect.Constructor.newInstance(Unknown Source)
>         at org.apache.xalan.extensions.ExtensionNamespaceSupport.launch(Extensio
> nNamespaceSupport.java:93)
>         ... 7 more
> Caused by: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
>         at org.apache.bsf.BSFManager.<init>(BSFManager.java:102)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
> rce)
>         at java.lang.reflect.Constructor.newInstance(Unknown Source)
>         at java.lang.Class.newInstance0(Unknown Source)
>         at java.lang.Class.newInstance(Unknown Source)
>         at org.apache.xalan.extensions.ObjectFactory.newInstance(ObjectFactory.j
> ava:457)
>         at org.apache.xalan.extensions.ExtensionHandlerGeneral.<init>(ExtensionH
> andlerGeneral.java:204)
>         ... 12 more
> ---------
> java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
> rce)
>         at java.lang.reflect.Constructor.newInstance(Unknown Source)
>         at org.apache.xalan.extensions.ExtensionNamespaceSupport.launch(Extensio
> nNamespaceSupport.java:93)
>         at org.apache.xalan.extensions.ExtensionsTable.<init>(ExtensionsTable.ja
> va:64)
>         at org.apache.xalan.transformer.TransformerImpl.setExtensionsTable(Trans
> formerImpl.java:441)
>         at org.apache.xalan.transformer.TransformerImpl.transformNode(Transforme
> rImpl.java:1323)
>         at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp
> l.java:709)
>         at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp
> l.java:1284)
>         at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp
> l.java:1262)
>         at org.apache.xalan.xslt.Process.main(Process.java:1046)
> Caused by: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactor
>         at org.apache.bsf.BSFManager.<init>(BSFManager.java:102)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown So
> rce)
>         at java.lang.reflect.Constructor.newInstance(Unknown Source)
>         at java.lang.Class.newInstance0(Unknown Source)
>         at java.lang.Class.newInstance(Unknown Source)
>         at org.apache.xalan.extensions.ObjectFactory.newInstance(ObjectFactory.
> ava:457)
>         at org.apache.xalan.extensions.ExtensionHandlerGeneral.<init>(Extension
> andlerGeneral.java:204)
>         ... 12 more
> file:///D:/fopt/test.xsl; Zeilennummer18; Spaltennummer95; XSLT-Fehler (javax.x
> l.transform.TransformerException): java.lang.NullPointerException
> Exception in thread "main" java.lang.RuntimeException: java.lang.NullPointerExc
> ption
>         at org.apache.xalan.xslt.Process.doExit(Process.java:1153)
>         at org.apache.xalan.xslt.Process.main(Process.java:1126)
> Here my xalan.bat:
> @ECHO OFF
> set LIBDIR=lib
> set LOCALCLASSPATH=build/fop.jar
> set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xml-apis.jar
> set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xercesImpl.jar
> set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan.jar
> set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\serializer.jar
> set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\js.jar
> set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\bsf.jar
> java -cp %LOCALCLASSPATH% org.apache.xalan.xslt.Process %1 %2 %3 %4 %5 %6 %7 %8
> my Styleesheet (after many tries Ive copied the example from xalan.apache.org)
> <?xml version="1.0"?>
> <!--Namespaces are global if you set them in the stylesheet element-->
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
> version="1.0" xmlns:xalan="http://xml.apache.org/xalan"
> xmlns:my-ext="ext1" extension-element-prefixes="my-ext">
> 	<!--The component and its script are in the lxslt namespace and define the
> implementation of the extension.-->
> 	<xalan:component prefix="my-ext" functions="getdate">
> 		<xalan:script lang="javascript">function getdate()
> {
> var d = new Date();
> return "Foo";
> </xalan:script>
> 	</xalan:component>
> 	<xsl:template match="/">
> 		<p>Test :<xsl:value-of select="my-ext:getdate()"/>.</p>
> 	</xsl:template>
> </xsl:stylesheet>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


Mime
View raw message