Project

Profile

Help

security/key/certificate error

Added by Anonymous about 14 years ago

Legacy ID: #8332761 Legacy Poster: Matt Wallis (mattwallis)

I'm getting an error which does not seem to be due to bad input (i.e. no line is being reported as in error). I was using Saxon-HE successfully earlier today, and it still runs on very small test examples. Any assistance would be greatly appreciated. See below for errors. Matt. Saxon-HE 9.2.0.6J from Saxonica Java version 1.5.0_22 Stylesheet compilation time: 430 milliseconds Processing file:/Volumes/Scritch/matt/dev/taskjuggler.old/bugs_all.xml Using parser com.sun.org.apache.xerces.internal.parsers.SAXParser Building tree for file:/Volumes/Scritch/matt/dev/taskjuggler.old/bugs_all.xml using class net.sf.saxon.tinytree.TinyBuilder Error javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Transformation failed: Run-time errors were reported


Replies (8)

Please register to reply

RE: security/key/certificate error - Added by Anonymous about 14 years ago

Legacy ID: #8332778 Legacy Poster: Michael Kay (mhkay)

Never seen anything like this, I'm afraid. Sorry about the poor diagnostics: it's not at all clear where this exception might be coming from without a stack trace. My guess is that it's failing during the parsing of the source document. It may well be worth trying it with the Apache Xerces parser rather than the JDK internal parser - it might work, or it might give better diagnostics (or it might fail the same way, in which case we've eliminated a set of possible causes of the failure).

RE: security/key/certificate error - Added by Anonymous about 14 years ago

Legacy ID: #8336963 Legacy Poster: Matt Wallis (mattwallis)

Thanks for the suggestion. Apache Xerces seems happy with the input XML: $ ~/Downloads/xerces-c-3.1.0-x86-macosx-gcc-4.0/bin/DOMCount bugs_all.xml bugs_all.xml: 224 ms (84075 elems). $ Did you mean me to try it standalone (as above), or is there some way to switch Saxon-HE to use Xerces? Matt

RE: security/key/certificate error - Added by Anonymous about 14 years ago

Legacy ID: #8336979 Legacy Poster: Michael Kay (mhkay)

The XML parser built into JDK 1.6 is very buggy, and I would recommend always using Apache Xerces instead. This seems to be yet another example. You can nominate this parser to Saxon either using explicit Saxon options (the -x option on the command line, or configuration.setSourceParser()), or configure it as the default JAXP parser by placing it in the lib/endorsed directory of your Java installation.

RE: security/key/certificate error - Added by Anonymous about 14 years ago

Legacy ID: #8336988 Legacy Poster: Michael Kay (mhkay)

Sorry: I've jumped a step here. The fact that Apache Xerces parses this document doesn't prove that the original failure was in the JDK 1.6 parser. Try running it through Saxon with the Apache Xerces parser, and see if that makes the problem go away.

RE: security/key/certificate error - Added by Anonymous about 14 years ago

Legacy ID: #8337437 Legacy Poster: Matt Wallis (mattwallis)

Two items of news: 1. By deleting the reference to the DTD, the original command line now works. The deleted line is: and https access to that file would have failed - which may or may not be significant. 2. I am really struggling to work out how to change to the Apache Xerces parser (I am new to java, saxon and xerces). I have downloaded the Xerces-J-bin.2.9.1 binary package. There are several .jar files therein, and I'm guessing that it is one of those (xercesImpl.jar, maybe?) that I need to nominate using the -x option. But whichever I try I get the same error: Transformation failed: net.sf.saxon.trans.XPathException: Failed to load xercesImpl.jar I'm hoping that my mistake is obvious to someone with java expertise. Regards, Matt

RE: security/key/certificate error - Added by Anonymous about 14 years ago

Legacy ID: #8337463 Legacy Poster: Michael Kay (mhkay)

Yes, the failure is almost certainly related to the (unusual) use of https: to reference the DTD file. Sorry I was rather brief in terms of the instructions for invoking the Apache Xerces parser. The -x option needs to be the name of the XMLReader class, not the name of the JAR file containing the class. But I think the preferred approach is to make Apache Xerces your default XML parser for everything, which you can do by creating a folder named "endorsed" as a child of c:/Program Files/Java/jdk1.6.0_18/lib/ (or whatever) and copying xercesImpl.jar and xml-apis.jar into this "endorsed" folder.

RE: security/key/certificate error - Added by Anonymous about 14 years ago

Legacy ID: #8337535 Legacy Poster: Matt Wallis (mattwallis)

OK. I've copied those two .jar files to my $JAVA_HOME/lib/endorsed directory. Now, on running saxon I see: [code]Using parser org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser[/code] Hopefully, to the trained eye :-), that means that I'm now running the Apache Xerces parser. If I reinstate in my XML the problematic https URI of the DTD, I still get the same error from saxon: [code] Error javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target [/code] but by running the DOMCount app that I downlaoded with xerces-c-3.1.0-x86-macosx-gcc-4.0 I can get to a useful error message: [code] $ ./DOMCount ~/dev/taskjuggler/bugs_all.xml Fatal Error at file /Users/matt/dev/taskjuggler/bugs_all.xml, line 2, char 82 Message: unsupported protocol in URL [/code] Thank you for your help. Matt.

RE: security/key/certificate error - Added by Anonymous about 14 years ago

Legacy ID: #8337570 Legacy Poster: Michael Kay (mhkay)

OK, thanks! I found this web page explaining what the error means: http://www.java-samples.com/showtutorial.php?tutorialid=210 That leaves the question of why Saxon is giving a poor error report. I've improved this slightly for the next release (though I can only work with what the XML parser returns, and in this case the exception doesn't actually say that the problem is with the DTD reference in the DOCTYPE).

    (1-8/8)

    Please register to reply