AlexKovic / openid4java

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

Stuck with Xerces #68

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add another parser than Xerces to the classpath
2. Use Yadis protocol for discovery
3. During discovery phase, when trying to parse XRDS, you will get an empty
document

What is the expected output? What do you see instead?
Expected:
<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS
  xmlns:xrds="xri://$xrds"
  xmlns:openid="http://openid.net/xmlns/1.0"
  xmlns="xri://$xrd*($v*2.0)">
  <XRD>
    <Service priority="0">
      <Type>http://specs.openid.net/auth/2.0/signon</Type>
      <URI>THE_ENDPOINT_URI</URI>
    </Service>
  </XRD>
</xrds:XRDS>

and I get:
<?xml version="1.0" encoding="UTF-8"?>
<XRDS xmlns="xri://$xrds">
 <XRD xmlns="xri://$xrd*($v*2.0)">
  <Service priority="0">
   <Type/>
   <ProviderID/>
   <URI/>
  </Service>
 </XRD>
</XRDS>

What version of the product are you using? On what operating system?
0.9.4 on :Windows for development and Linux for production

Please provide any additional information below.
After a search, it appears that in the org.openxri.util.DOMUtils class,
this method: public static String getText(Node root) check if node is an
instance of TextImpl (which is the xerces implementation of Text
interface). I think the test should be:

if(!(node instanceof Text))

instead of:

if(!(node instanceof TextImpl))

In development I'm using xerces but on production, it is the oracle 10g xml
parser that is used and its implementation is oracle.xml.parser.v2.XMLText
class so it does not match and I get an empty document like said earlier.
This leads me to an error ("URI is not absolute") because the URI is not
found in the document

If you need something else, please let me know.

Hope this helps.

Regards,
David

Original issue reported on code.google.com by ddgar...@gmail.com on 25 Aug 2008 at 8:02

GoogleCodeExporter commented 8 years ago
This seems like an OpenXRI issue, not directly openid4java's.

OpenXRI does requires that three endorsed libraries are installed (dom-
xercesImpl.jar is one of them). Does this create a conflict with the oracle one 
you 
have in production?

Johnny

Original comment by Johnny.B...@gmail.com on 25 Aug 2008 at 8:25

GoogleCodeExporter commented 8 years ago
Wow, what a quick answer ! Indeed, I came back to precise that it was not in
openid4java but in openxri and that this issue could be closed here (sorry for 
that).

I will submit this on openxri sourceforge website.
There is no conflict but as the oracle parser is taken instead of xerces, as 
openxri
is hard-coded with xerces, I cannot use my application without this trick: I 
have to
explicitly precise in OAS that I want xerces and not the oracle parser. Not a 
big
deal but I think openxri could be fixed, we should not be forced to use xerces, 
don't
you think so ?

Anyway, thanks for the quick answer and, I did not tell you sooner but you did a
great work with this library !

David

Original comment by ddgar...@gmail.com on 25 Aug 2008 at 8:34

GoogleCodeExporter commented 8 years ago
Hi David,

I thought that installing the endorsed libraries overrides other DOM 
implementations 
found in the classpath. Not sure why openxri requires this, but yes - I don't 
particularly like the extra installation requirement they impose.

Thanks!
Johnny

Original comment by Johnny.B...@gmail.com on 25 Aug 2008 at 8:46

GoogleCodeExporter commented 8 years ago
Hi again,

Yes, that's what I wanted to say with "I have to explicitly precise in OAS that 
I
want xerces and not the oracle parser". I have to define a shared library 
containing
Xerces and specify in deploy classpath that this shared library must be used 
instead
of oracle (by default).

I'm not expert in deployment and OAS so perhaps you're right and this can be 
done
with endorsed libraries but I think it is something they do not want to maintain
where I work.

They're OK to do it for now (otherwise it does not work) but they prefer the
application to work without making tips or tricks (which I totally understand).

David

Original comment by ddgar...@gmail.com on 25 Aug 2008 at 8:58

GoogleCodeExporter commented 8 years ago
OpenXRI has been updated to the latest release (which no longer has endorsed 
depencies).

Original comment by Johnny.B...@gmail.com on 7 May 2009 at 2:12

GoogleCodeExporter commented 8 years ago
thank you every body

Original comment by zhch...@gmail.com on 19 May 2009 at 2:38