From what I understand of the JAR File specification, those lines are not
covered by the same spec. What is it then ? And how can I make it work ?
Of course, I can always instantiate
The format of the file was chosen to circumvent a JDK5 bug - see http://markm
ail.org/message/obgfqbnrkuhzl6wl for some of the history. What Java implementation are you using? If there
are implementations where this workaround doesn't work, then I've got a bit of
a problem; I would normally go for conforming to the spec even when it means a
failure to interoperate with products that don't conform to the spec, but in
this case, changing it to be conformant would inconvenience a lot of my users.
Actually, I wouldn't recommend using the JAXP search mechanism anyway. It's
very slow, and it delivers an XPath engine that won't necessarily work with
your application. You have no way of knowing whether you get an XPath 1.0 or
2.0 implementation back, and the API is so weakly defined that there's very
little chance your application will work with a particular provider unless you
have tested it with that provider first. So even without this bug, I would
steer clear of it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2011-10-27
Thanks for your answer.
I am on OS X Lion 10.7.2 with java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-383, mixed mode)
I was using the service API mainly to understand it and I think that your
remarks make sense and that it is better to choose explicitly the
implementation. Even if I like the idea of switching implementation while
keeping the same API.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
When I try to use the service provider mechanism of Java 6 to locate an
implementation of
, I get a syntax error (not in my code). Java goes inside the jar saxon9he.jar
into the
file and then it finds:
- on the first line, what it is looking for:
on the remaining lines, unexpected lines with a syntax it does not understand. This is what I think. We have
http\://java.sun.com/jaxp/xpath/dom: net.sf.saxon.xpath.XPathFactoryImpl
and
.
From what I understand of the JAR File specification, those lines are not
covered by the same spec. What is it then ? And how can I make it work ?
Of course, I can always instantiate
manually or tell the
method of
to use that specific class.
TEST
PROGRAM CODE
TIA,
Ludovic Kuty
Sorry for the wrong use of code tags with inline code in my message.
The format of the file was chosen to circumvent a JDK5 bug - see http://markm
ail.org/message/obgfqbnrkuhzl6wl for some of the history. What Java implementation are you using? If there
are implementations where this workaround doesn't work, then I've got a bit of
a problem; I would normally go for conforming to the spec even when it means a
failure to interoperate with products that don't conform to the spec, but in
this case, changing it to be conformant would inconvenience a lot of my users.
Actually, I wouldn't recommend using the JAXP search mechanism anyway. It's
very slow, and it delivers an XPath engine that won't necessarily work with
your application. You have no way of knowing whether you get an XPath 1.0 or
2.0 implementation back, and the API is so weakly defined that there's very
little chance your application will work with a particular provider unless you
have tested it with that provider first. So even without this bug, I would
steer clear of it.
Thanks for your answer.
I am on OS X Lion 10.7.2 with java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-383, mixed mode)
I was using the service API mainly to understand it and I think that your
remarks make sense and that it is better to choose explicitly the
implementation. Even if I like the idea of switching implementation while
keeping the same API.