takcy / openid4java

Automatically exported from code.google.com/p/openid4java
Apache License 2.0
0 stars 0 forks source link

Error Parsing XML document on discovery #122

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. `ant jar` to build from source (r640)
2. Use a google profile URL as the identifier (ex: 
http://www.google.com/profiles/<profile name>)
3. Discovery throws parsing exception

What is the expected output? What do you see instead?

Expected to properly discover the openID provider for the google profile. 
Instead it throws a parsing error that is not there in older versions.

What version of the product are you using? On what operating system?

r640 on Ubuntu 10.04

Please provide any additional information below.

0x70d: Error parsing XML document
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source):-1
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source):-1
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121):121
    at org.openid4java.discovery.xrds.XrdsParserImpl.parseXmlInput(XrdsParserImpl.java:188):188
    at org.openid4java.discovery.xrds.XrdsParserImpl.parseXrds(XrdsParserImpl.java:50):50
    at org.openid4java.discovery.yadis.YadisResolver.retrieveXrdsDocument(YadisResolver.java:282):282
    at org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:237):237
    at org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:221):221
    at org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:179):179
    at org.openid4java.discovery.Discovery.discover(Discovery.java:134):134
    at org.openid4java.discovery.Discovery.discover(Discovery.java:114):114
    at org.openid4java.consumer.ConsumerManager.discover(ConsumerManager.java:527):527

Original issue reported on code.google.com by Zoram...@gmail.com on 17 Jul 2010 at 4:44

GoogleCodeExporter commented 8 years ago
I'm having the same error (using the trunk), it seems to be due to XRI 
resolution error.

Could be due to incomplete XML catalog or XML parser version ?

Original comment by nicolas....@gmail.com on 26 Jul 2010 at 4:27

GoogleCodeExporter commented 8 years ago
After further investigations, disabling the validation and schema declarations 
works.

So I checked the XML parser used, and for some reason I was using an old 
version of xerces.

Using xerces 2.6+ solves the problem.

PS: In my environment it's quite easy to upgrade xerces, though I guess it may 
be impossible for some people for whatever reason, it would be nice to disable 
XML validation.

Original comment by nicolas....@gmail.com on 26 Jul 2010 at 5:08

GoogleCodeExporter commented 8 years ago
I am still having this problem, even though I am using xerces 2.8.1

I am using Caucho Resin with Xerces set as the DocumentBuilder/SaxParser 
factories.

My stacktrace is like such:

[16:31:46,105] ERROR - "Error constructing AuthRequest for OpenId Auth" - http--
8081-7 com.mnp.mc.openid.sso.OpenIdConsumerManager.authRequest:?
org.openid4java.discovery.DiscoveryException: 0x70d: Error parsing XML document
        at org.openid4java.discovery.xrds.XrdsParserImpl.parseXmlInput(XrdsParse
rImpl.java:197)
        at org.openid4java.discovery.xrds.XrdsParserImpl.parseXrds(XrdsParserImp
l.java:50)
        at org.openid4java.discovery.yadis.YadisResolver.retrieveXrdsLocation(Ya
disResolver.java:409)
        at org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.
java:233)
        at org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.
java:221)
        at org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.
java:179)
        at org.openid4java.discovery.Discovery.discover(Discovery.java:134)
        at org.openid4java.discovery.Discovery.discover(Discovery.java:114)
        at org.openid4java.consumer.ConsumerManager.discover(ConsumerManager.jav
a:527)
        at com.mnp.mc.openid.sso.OpenIdConsumerManager.authRequest(Unknown Sourc
e)

and also this...

Caused by: org.xml.sax.SAXParseException: s4s-att-invalid-value: Invalid attribu
te value for 'targetNamespace' in element 'schema'. Recorded reason: cvc-datatyp
e-valid.1.2.1: 'xri://$xrd*($v*2.0)' is not a valid value for 'anyURI'.

Any help with this would be greatly appreciated.

Original comment by sull...@gmail.com on 16 Nov 2011 at 12:50

GoogleCodeExporter commented 8 years ago
I had the exact same error. It appeared that I had multiple versions of xcerces 
in the .war file. Removing the old one fixed the problem. 

Original comment by erikskog...@gmail.com on 29 Nov 2011 at 3:08

GoogleCodeExporter commented 8 years ago
I have problem similar to that sull...@gmail.com
I am using Xerces 2.11.0 on Linux and neither I have any other Xerces files.
Any help would be greatly appreciated.

Original comment by rpriyank...@gmail.com on 28 May 2012 at 9:47

GoogleCodeExporter commented 8 years ago
I'm running my application from localhost and currently it doesn't have a 
domain name. Could that be a reason for failure in discovery process?

Original comment by rpriyank...@gmail.com on 17 Aug 2012 at 2:19

GoogleCodeExporter commented 8 years ago

Original comment by Johnny.B...@gmail.com on 31 Oct 2012 at 11:56

GoogleCodeExporter commented 8 years ago
I fixed the issue by updating the version of xmlParserAPIs and xercesImpl from 
2.5 to 2.6.x.

Original comment by enricogi...@gmail.com on 20 May 2013 at 2:00