XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Michael NguyenSubject: 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:

Exception calling Java extension:
java.langClassNotFoundException: http:...xml.apache.org.xalan.java
. . .
(I've attached an image file)

------
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?

Thanks,
Michael Nguyen



screen shot

Postnext
Ivan PedruzziSubject: Problem with java extensions
Author: Ivan Pedruzzi
Date: 06 Dec 2004 06:33 PM
Hi Michael,

My guess is that you didn't setup the Stylus Studio Classpath
properly under:

Tools ->
Options ->
Application Settings ->
Java Virtual Machine

Just to be sure could you post a simple XSLT that uses your
java extension and the java function prototype or the java sources

If you prefer you can send the test case direcly to me
at ipedruzz@progress.com

Hope this helps
Ivan


Postnext
Michael NguyenSubject: 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.

Thanks for the help,
Michael



<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:redirect="org.apache.xalan.lib.Redirect"
xmlns:java="http://xml.apache.org/xalan/java"
extension-element-prefixes="redirect java"
>

<xsl:output method="html" omit-xml-declaration="yes" indent="yes"
encoding="ISO-8859-1"/>

<xsl:template match="/">
<xsl:value-of select="java:replaceAll(name(), '[a-z]','QQQ') " />
</xsl:template>

</xsl:stylesheet>

Postnext
Ivan PedruzziSubject: 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

Hope this helps
Ivan

Postnext
Michael NguyenSubject: Problem with java extensions
Author: Michael Nguyen
Date: 10 Dec 2004 01:23 PM
I"m using Studio 5.3 build 179j. Is that my problem?

Thanks,
Michael

Postnext
Ivan PedruzziSubject: Problem with java extensions
Author: Ivan Pedruzzi
Date: 10 Dec 2004 06:15 PM


Could you please download the latest 6.0 evaluation and try?

http://www.stylusstudio.com/xml_download.html

Thank You
Ivan

Postnext
Michael NguyenSubject: 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

Postnext
Ivan PedruzziSubject: 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

Postnext
Michael NguyenSubject: 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.

screen shot of error message
DocumentUntitled1.xml
Sample XML file

Postnext
Michael NguyenSubject: Problem with java extensions
Author: Michael Nguyen
Date: 17 Dec 2004 01:36 PM
Any update on this?

Thanks Ivan

Postnext
Ivan PedruzziSubject: Problem with java extensions
Author: Ivan Pedruzzi
Date: 17 Dec 2004 02:15 PM
Michael,

Which JVM Stylus Studio is using (Help -> about)?

Did you replace the XalanJ shipped with JRE using Endorsed Standards Override Mechanism?
http://java.sun.com/j2se/1.4.2/docs/guide/standards/

Ivan

Postnext
Michael NguyenSubject: 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.

Thanks,
Michael

Postnext
Michael NguyenSubject: 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.

Thanks,
Michael

Postnext
Michael NguyenSubject: 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?

thanks Ivan

Postnext
Ivan PedruzziSubject: Problem with java extensions
Author: Ivan Pedruzzi
Date: 14 Jan 2005 10:29 PM

Michael,

I never suggest replacing or endorsing the xalanj jars.

To recap:

- You are running Stylus Studio 6.0

- You have configured Stylus Studio to use JRE 1.4.x

- When you try to run the following XSLT using the XalanJ processor you get

javax.xml.transform.TransformerConfigurationException


<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:redirect="org.apache.xalan.lib.Redirect"
xmlns:java="http://xml.apache.org/xalan/java"
extension-element-prefixes="redirect java">
<xsl:output method="html" omit-xml-declaration="yes" indent="yes" encoding="ISO-8859-1"/>
<xsl:template match="/">
<xsl:value-of select="java:replaceAll(name(), '[a-z]','QQQ') " />
</xsl:template>
</xsl:stylesheet>

By any chance the XML document you are using as input points to a DTD or a schema?
If yes how the file location is specified?


Ivan

Postnext
Michael NguyenSubject: 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?

Posttop
Michael NguyenSubject: Problem with java extensions
Author: Michael Nguyen
Date: 26 Jan 2005 01:30 PM
Actually I've tried the conversion again, with a different document that
has no associated DTD. I still get the same problem.

Any ideas?

Thanks,
Mike

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.