backoffbelief / odata4j

Automatically exported from code.google.com/p/odata4j
0 stars 0 forks source link

Invalid XML generated on Weblogic #222

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The metadata dump as well as the services dump is generating badly formatted 
XML when running in Weblogic.
The following writers:

- org.odata4j.format.xml.EdmxFormatWriter
- org.odata4j.format.xml.AtomServiceDocumentFormatWriter

are not closing correctly their XML elements. This seems being tolerated by the 
default Stax implementation that closes all unclosed elements on end document 
event.

This behavior does not work in Weblogic which seems to have a less tolerant 
Stax XML framework.

By the way, I think it is a good solution to close explicitely our XML element 
and to rely on underlying framework for that.

Please find below the patch fixing the bug.
The patch is for a 0.8.0-SNAPSHOT version.

Original issue reported on code.google.com by samuel.v...@gmail.com on 22 Oct 2012 at 11:38

Attachments:

GoogleCodeExporter commented 9 years ago
I missed the following information:

What steps will reproduce the problem?
Deploy OData4j in Weblogic and dump the $metadata or the root of services.

What is the expected output? What do you see instead?
A well formatted XML document.
The document is not valid the end elements are missing.

What version of the product are you using? On what operating system?
0.7.0, 0.8.0 on Windows

Original comment by samuel.v...@gmail.com on 22 Oct 2012 at 11:50

GoogleCodeExporter commented 9 years ago
Thanks, good catch.  Is there a way to test without Weblogic?  Is their Stax 
stack available separately?

Original comment by john.spurlock on 22 Oct 2012 at 11:58

GoogleCodeExporter commented 9 years ago
That's exactly what I tried but it seems not so evident. The easiest way would 
be to mock the XMLOutputFactory. I found no public Weblogic Stax.
I will try to add a testcase if possible.

Original comment by samuel.v...@gmail.com on 22 Oct 2012 at 12:10

GoogleCodeExporter commented 9 years ago
Seems that we can use the Stax from BEA. (stax:stax:1.2.0)
I've added 2 test cases and 1 dependency in scope test.

Original comment by samuel.v...@gmail.com on 22 Oct 2012 at 2:54

Attachments:

GoogleCodeExporter commented 9 years ago
I've got the same issue running on Weblogic 12.1.1 or Glassfish 3.1.2
Patch seem to work for me, thanks samuel.v

Original comment by superpit...@gmail.com on 6 Dec 2012 at 2:35