Java 8 XPathFactory & SaxonHE 9.4.0.43

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Java 8 XPathFactory & SaxonHE 9.4.0.43

cmarchand
Hi !

I have a strange problem, migrating from Java7 to Java8.

Below code throws an exception with Java 8, and works correctly with Java 7 (same build).

XPathFactory xpF = XPathFactory.newInstance();

Exception is :
java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: java.util.ServiceConfigurationError: javax.xml.xpath.XPathFactory: jar:file:/home/cmarchand/Documents/Formation/XS-XSL1%20-%20XSLT/3.%20Travaux%20Pratiques/init/TP3/dist/lib/saxon9he.jar!/META-INF/services/javax.xml.xpath.XPathFactory:2: Illegal configuration-file syntax
    at javax.xml.xpath.XPathFactory.newInstance(XPathFactory.java:102)


It seems nothing has changed between Java7 & Java8 in java.xml.xpath.XPathFactory...

Any Idea ?

Best regards,
Christophe
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Java 8 XPathFactory & SaxonHE 9.4.0.43

Michael Kay
There's quite a long history here: you can find some of it in this thread, or in the messages it refers to:


The quick summary is: "the problem originally arose because we wrote the services file to do what JDK 5 implemented, not what the JDK documentation said. It's probably time to move on now and do what the documentation says". And that's what we did, as from Saxon 9.5.1.5. So prior to that Saxon release, it doesn't work with JDK 8; after that Saxon release, it doesn't work with JDK 5. I think (from memory) that JDK 6 and JDK 7 implemented both the "old" and the "new" format.


Michael Kay
Saxonica
+44 (0) 118 946 5893




On 9 Jan 2015, at 17:27, Christophe Marchand <[hidden email]> wrote:

Hi !

I have a strange problem, migrating from Java7 to Java8.

Below code throws an exception with Java 8, and works correctly with Java 7 (same build).

XPathFactory xpF = XPathFactory.newInstance();

Exception is :
java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: java.util.ServiceConfigurationError: javax.xml.xpath.XPathFactory: jar:file:/home/cmarchand/Documents/Formation/XS-XSL1%20-%20XSLT/3.%20Travaux%20Pratiques/init/TP3/dist/lib/saxon9he.jar!/META-INF/services/javax.xml.xpath.XPathFactory:2: Illegal configuration-file syntax
    at javax.xml.xpath.XPathFactory.newInstance(XPathFactory.java:102)


It seems nothing has changed between Java7 & Java8 in java.xml.xpath.XPathFactory...

Any Idea ?

Best regards,
Christophe
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Java 8 XPathFactory & SaxonHE 9.4.0.43

Michael Kay
 I think (from memory) that JDK 6 and JDK 7 implemented both the "old" and the "new" format.



Sorry, that's not quite an accurate summary. A more accurate description, I think, is: JDK 6 and JDK 7 accepted an undocumented composite format discovered by Owen Rees that also worked with JDK 5, and Saxon was for many years issued using this composite format; JDK 8 ceases to accept this format.

Note also that in Saxon 9.6, the XPathFactory is dropped entirely, on the grounds that an application really needs to know whether it wants an XPath 1.0 or XPath 2.0 processor and shouldn't pick up whichever it finds lying around on the classpath.

Michael Kay
Saxonica

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Java 8 XPathFactory & SaxonHE 9.4.0.43

cmarchand
Thanks a lot for this !

And I do agree with you : we should say exactly what we need !

Thanks again, Mike.

Best Regards,
Christophe


Le 09/01/2015 22:43, Michael Kay a écrit :
 I think (from memory) that JDK 6 and JDK 7 implemented both the "old" and the "new" format.



Sorry, that's not quite an accurate summary. A more accurate description, I think, is: JDK 6 and JDK 7 accepted an undocumented composite format discovered by Owen Rees that also worked with JDK 5, and Saxon was for many years issued using this composite format; JDK 8 ceases to accept this format.

Note also that in Saxon 9.6, the XPathFactory is dropped entirely, on the grounds that an application really needs to know whether it wants an XPath 1.0 or XPath 2.0 processor and shouldn't pick up whichever it finds lying around on the classpath.

Michael Kay
Saxonica


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help