Jettison

Class cast exception while converting Atom Feed

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-RC2
  • Fix Version/s: 1.0
  • Component/s: None
  • Labels:
    None
  • Environment:
    SuSE 10 - Java 1.6 u3
  • Number of attachments :
    1

Description

Please see the XML from this URL
http://api.hi5.com/rest/feed/journal/1000

Enunciate publishes this as a JSON endopoint here:

http://api.hi5.com/json/feed/journal/1000

That url throws an error:
>
> java.lang.ClassCastException: org.codehaus.jettison.json.JSONArray
> cannot be cast to org.codehaus.jettison.json.JSONObject
>
org.codehaus.jettison.mapped.MappedXMLStreamWriter.writeAttribute(MappedXMLStreamWriter.java:93)
>
org.codehaus.jettison.mapped.MappedXMLStreamWriter.writeAttribute(MappedXMLStreamWriter.java:130)
>
org.codehaus.jettison.mapped.MappedXMLStreamWriter.writeAttribute(MappedXMLStreamWriter.java:134)

The badgerfish implementation doesn't have this problem. The value one does.

Activity

Hide
Dejan Bosanac added a comment -

Can you try your code with the latests snapshot and see if it works ... http://snapshots.repository.codehaus.org/org/codehaus/jettison/jettison/1.0-RC3-SNAPSHOT/

If the problem still exists, can you produce valid test case or at least provide us with the info what do you use to create a feed (Rome?)

Show
Dejan Bosanac added a comment - Can you try your code with the latests snapshot and see if it works ... http://snapshots.repository.codehaus.org/org/codehaus/jettison/jettison/1.0-RC3-SNAPSHOT/ If the problem still exists, can you produce valid test case or at least provide us with the info what do you use to create a feed (Rome?)
Hide
Paul Lindner added a comment -

Still occurs with latest snapshot...

I'll attach some sample XML that dies...

Show
Paul Lindner added a comment - Still occurs with latest snapshot... I'll attach some sample XML that dies...
Hide
Paul Lindner added a comment -

Here's an xml file that causes the error.

Show
Paul Lindner added a comment - Here's an xml file that causes the error.
Hide
Dejan Bosanac added a comment -

The problem was related to writing attributes to array members. It's fixed now. I've tested it (additionally) by transforming the xml you provided to json with XStream copier. We'll make a release soon (today?) so I haven't made any snapshots.

Show
Dejan Bosanac added a comment - The problem was related to writing attributes to array members. It's fixed now. I've tested it (additionally) by transforming the xml you provided to json with XStream copier. We'll make a release soon (today?) so I haven't made any snapshots.
Hide
Vincent Vanderheeren added a comment -

What is the status of the new release? Thanx.

Show
Vincent Vanderheeren added a comment - What is the status of the new release? Thanx.
Hide
Dejan Bosanac added a comment -

Hi Vincent, I think it will be released today. Dan has some minor issue yesterday, so stay tuned

Show
Dejan Bosanac added a comment - Hi Vincent, I think it will be released today. Dan has some minor issue yesterday, so stay tuned
Hide
Vincent Vanderheeren added a comment -

Hey Dejan, thanks for your quick response. However it would make it somewhat easier if I know when you will release a new version. It is just that I need to tell a customer when I will make a new release myself. Thanx .

Show
Vincent Vanderheeren added a comment - Hey Dejan, thanks for your quick response. However it would make it somewhat easier if I know when you will release a new version. It is just that I need to tell a customer when I will make a new release myself. Thanx .
Hide
Dejan Bosanac added a comment -

Hi,

you can find a 1.0 final release at the following URL http://repository.codehaus.org/org/codehaus/jettison/jettison/1.0/

Show
Dejan Bosanac added a comment - Hi, you can find a 1.0 final release at the following URL http://repository.codehaus.org/org/codehaus/jettison/jettison/1.0/

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: