Subject:Problem with java extensions Author:Michael Nguyen Date:06 Dec 2004 02:32 PM
Hello,
It's been really frustrating, because I've been having trouble with this for a very long time.
I can't seem to get any standard java function call to work from within Stylus Studio. Using the default xslt engine I get the following exception:
------
When I switch to xalan-j as the processor I get the following error:
java.lang.RuntimeException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.lang.IllegalArgumentException
TransformerException:
javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.lang.IllegalArgumentException
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:780)
at com.exln.stylus.CXalanDriver.doProcessing(CXalanDriver.java:111)
at com.exln.stylus.CProcessorDriver.process(CProcessorDriver.java:55)
Caused by: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.lang.IllegalArgumentException
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:922)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:763)
... 2 more
Caused by: javax.xml.transform.TransformerException: java.lang.IllegalArgumentException
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:916)
... 3 more
Caused by: java.lang.IllegalArgumentException
at sun.net.www.ParseUtil.decode(Unknown Source)
at sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
at java.net.URL.openConnection(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:892)
... 3 more
---------
javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.lang.IllegalArgumentException
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:922)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:763)
at com.exln.stylus.CXalanDriver.doProcessing(CXalanDriver.java:111)
at com.exln.stylus.CProcessorDriver.process(CProcessorDriver.java:55)
Caused by: javax.xml.transform.TransformerException: java.lang.IllegalArgumentException
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:916)
... 3 more
Caused by: java.lang.IllegalArgumentException
at sun.net.www.ParseUtil.decode(Unknown Source)
at sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
at java.net.URL.openConnection(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:892)
... 3 more
---------
javax.xml.transform.TransformerException: java.lang.IllegalArgumentException
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:916)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:763)
at com.exln.stylus.CXalanDriver.doProcessing(CXalanDriver.java:111)
at com.exln.stylus.CProcessorDriver.process(CProcessorDriver.java:55)
Caused by: java.lang.IllegalArgumentException
at sun.net.www.ParseUtil.decode(Unknown Source)
at sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
at java.net.URL.openConnection(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:892)
... 3 more
---------
java.lang.IllegalArgumentException
at sun.net.www.ParseUtil.decode(Unknown Source)
at sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
at java.net.URL.openConnection(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:892)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:763)
at com.exln.stylus.CXalanDriver.doProcessing(CXalanDriver.java:111)
at com.exln.stylus.CProcessorDriver.process(CProcessorDriver.java:55)
---------
java.lang.IllegalArgumentException
at sun.net.www.ParseUtil.decode(Unknown Source)
at sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
at java.net.URL.openConnection(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:892)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:763)
at com.exln.stylus.CXalanDriver.doProcessing(CXalanDriver.java:111)
at com.exln.stylus.CProcessorDriver.process(CProcessorDriver.java:55)
---------
javax.xml.transform.TransformerException: java.lang.IllegalArgumentException
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:916)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:763)
at com.exln.stylus.CXalanDriver.doProcessing(CXalanDriver.java:111)
at com.exln.stylus.CProcessorDriver.process(CProcessorDriver.java:55)
Caused by: java.lang.IllegalArgumentException
at sun.net.www.ParseUtil.decode(Unknown Source)
at sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
at java.net.URL.openConnection(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:892)
... 3 more
---------
java.lang.IllegalArgumentException
at sun.net.www.ParseUtil.decode(Unknown Source)
at sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
at java.net.URL.openConnection(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:892)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:763)
at com.exln.stylus.CXalanDriver.doProcessing(CXalanDriver.java:111)
at com.exln.stylus.CProcessorDriver.process(CProcessorDriver.java:55)
---------
java.lang.IllegalArgumentException
at sun.net.www.ParseUtil.decode(Unknown Source)
at sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
at java.net.URL.openConnection(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:892)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:763)
at com.exln.stylus.CXalanDriver.doProcessing(CXalanDriver.java:111)
at com.exln.stylus.CProcessorDriver.process(CProcessorDriver.java:55)
---
What I don't understand is that the same xsl sheets run fine on the command line using xalan. am I missing anything?
Subject:Problem with java extensions Author:Michael Nguyen Date:06 Dec 2004 07:38 PM
Here is the sample you requested. It still doesn't work under Stylus studio.
I thought it might be the classpath, but I've added everything that I use normally from the command line and still no go.
Subject:Problem with java extensions Author:Ivan Pedruzzi Date:06 Dec 2004 09:24 PM
Michael
The test case runs just fine using XalanJ with Stylus Studio 6.0 (212I)
Be carefull because the functions you are calling relys on Sun JVM 1.4
The Stylus Studio built-in XSLT processor doesn't support this
particular syntax.
For more details take a look to "Specifying Extension Functions in Stylesheets"
in the online help
Are you really sure you need to use an extesion function?
You may want to take a look to the translate function
Subject:Problem with java extensions Author:Michael Nguyen Date:13 Dec 2004 12:26 PM Originally Posted: 10 Dec 2004 07:44 PM
Ivan,
I installed the trial. Using the default settings I tried to run the xsl I posted earlier.
Still no go. I get the same errors as before. I should also add that everything works fine
if I don't use java calls. the extension I am trying to use is from the JDK.
replaceAll is a String method for regex replacements.
Any Ideas?
Thanks,
Michael
Subject:Problem with java extensions Author:Ivan Pedruzzi Date:10 Dec 2004 11:17 PM Originally Posted: 10 Dec 2004 11:16 PM
As I explained before the built-in processor will not run your
stylesheet; you need to select XalanJ in scenario properties.
If you are getting the error using XalanJ could you post the XML
document you are using as input?
Hope this helps
Ivan
Subject:Problem with java extensions Author:Michael Nguyen Date:13 Dec 2004 01:15 PM Originally Posted: 13 Dec 2004 12:33 PM
Ivan,<br>
I'm still having issues. I can not post the XML I am trying to perform the xsl on as it is copyrighted material.<br>
I have however created an XML file that still doesn't work with the XSL. <br>
I've tried this with both version 5 and 6. I'll post the sample XML.<br>
<br>
<br>
Thanks,<br>
Michael Nguyen<br>
<br>
I have also posted a screenshot of the error message.
Subject:Problem with java extensions Author:Michael Nguyen Date:17 Dec 2004 02:54 PM
Ivan,
>Which JVM Stylus Studio is
>using (Help -> about)?
>
1.4.2_06-b03 Java HotSpot(TM) Client VM Sun Microsystems Inc.
debug mode port:8000
Sylus Studio version 6 build 212i
>Did you replace the XalanJ
>shipped with JRE using
>Endorsed Standards Override
>Mechanism?
>http://java.sun.com/j2se/1.4.2
>/docs/guide/standards/
Not sure which libraries to replace since I'm only trying to use standard libraries.
Apart from the xalan extension Redirect, the other calls are for standard j2se
methods. (ie java.lang.String.replaceAll() )
The documentation says to update the system parameter to the endorsed jar files
I'm not sure which ones to use and where to get them.
Subject:Problem with java extensions Author:Michael Nguyen Date:17 Dec 2004 05:34 PM
Ivan,
>Which JVM Stylus Studio is
>using (Help -> about)?
>
1.4.2_06-b03 Java HotSpot(TM) Client VM Sun Microsystems Inc.
debug mode port:8000
Sylus Studio version 6 build 212i
>Did you replace the XalanJ
>shipped with JRE using
>Endorsed Standards Override
>Mechanism?
>http://java.sun.com/j2se/1.4.2
>/docs/guide/standards/
Not sure which libraries to replace since I'm only trying to use standard libraries.
Apart from the xalan extension Redirect, the other calls are for standard j2se
methods. (ie java.lang.String.replaceAll() )
The documentation says to update the system parameter to the endorsed jar files
I'm not sure which ones to use and where to get them.
Subject:Problem with java extensions Author:Michael Nguyen Date:14 Jan 2005 06:54 PM
I've followed the instructions for the override and it still doesn't work
I put the jar files into the endorsed directory, added the -Xbootclasspath
switch to all java Parameters in the options menus. anymore ideas?
Subject:Problem with java extensions Author:Michael Nguyen Date:18 Jan 2005 01:34 PM
In a previous mail you said:
>Did you replace the XalanJ
>shipped with JRE using
>Endorsed Standards Override
>Mechanism?
>http://java.sun.com/j2se/1.4.2
>/docs/guide/standards/
yes the xml does point to a dtd symbolicly linked to an NFS server.
I haven't tried to remove the reference to the dtd. This may solve the
problem but if it doesn't, do you have any other ideas?