You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by mcnamara <ti...@gmail.com> on 2008/11/07 21:41:24 UTC

JAXB unmarshal

using .unmarshal(new JaxbDataFormat("com.foo.bar") is returning a JAXBElement
instead of the desired object that was generated by xjc.

I've looked at UnmarshalTest, and cannot account for the discrepancy.

Any insight would be appreciated.

Tim...
-- 
View this message in context: http://www.nabble.com/JAXB-unmarshal-tp20388524s22882p20388524.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: JAXB unmarshal

Posted by Willem Jiang <wi...@gmail.com>.
Hi Tim,

I just added some comment on the JIRA CAMLE-1074, please check them out.

Willem
mcnamara wrote:
> Added  https://issues.apache.org/activemq/browse/CAMEL-1074 CAMEL-1074 
> 
> Thanks
> Tim...
> 
> 
> 
> willem.jiang wrote:
>> Hi,
>>
>> Can you fill a JIRA[1] and submit your test case ? so we can dig the
>> real reason.
>>
>> [1] https://issues.apache.org/activemq/browse/CAMEL
>>
>> Willem
>>
>> mcnamara wrote:
>>> Perusing the JAXB RI documentation, it appears the either ObjectFactory
>>> or
>>> jaxb.index is required.  In my case, xjc did generate ObjectFactory but
>>> not
>>> jaxb.index.  Apparently, jaxb.index is generated when going from
>>> java->xsd
>>> but not xsd->java
>>>
>>> Placing jaxb.index in com/foo/bar yielded the same result - I checked
>>> that
>>> jaxb.index file is indeed being read by putting a non-existent class name
>>> in
>>> the file, and there was an error.
>>>
>>> When rolling my own unmarshal code, a call to JAXBElement.getValue() was
>>> required.
>>>
>>> Note this is java 1.5 and using the jaxb jars packaged with camel.
>>>
>>>
>>> Claus Ibsen wrote:
>>>> Hi
>>>>
>>>> Maybe the jaxb.index stuff is something we should document on the camel
>>>> wiki for the JAXB dataformat as a kind of reminder.
>>>>
>>>> Is jaxb.index always needed? 
>>>>
>>>>
>>>> Med venlig hilsen
>>>>  
>>>> Claus Ibsen
>>>> ......................................
>>>> Silverbullet
>>>> Skovsgårdsvænget 21
>>>> 8362 Hørning
>>>> Tlf. +45 2962 7576
>>>> Web: www.silverbullet.dk
>>>>
>>>> -----Original Message-----
>>>> From: Willem Jiang [mailto:willem.jiang@gmail.com] 
>>>> Sent: 10. november 2008 04:57
>>>> To: camel-user@activemq.apache.org
>>>> Subject: Re: JAXB unmarshal
>>>>
>>>> Hi,
>>>>
>>>> Did you put the jaxb.index file into the "com.foo.bar" directory?
>>>>
>>>> Willem
>>>>
>>>> mcnamara wrote:
>>>>> using .unmarshal(new JaxbDataFormat("com.foo.bar") is returning a
>>>>> JAXBElement
>>>>> instead of the desired object that was generated by xjc.
>>>>>
>>>>> I've looked at UnmarshalTest, and cannot account for the discrepancy.
>>>>>
>>>>> Any insight would be appreciated.
>>>>>
>>>>> Tim...
>>>>
>>
>>
> 


Re: JAXB unmarshal

Posted by mcnamara <ti...@gmail.com>.
Added  https://issues.apache.org/activemq/browse/CAMEL-1074 CAMEL-1074 

Thanks
Tim...



willem.jiang wrote:
> 
> Hi,
> 
> Can you fill a JIRA[1] and submit your test case ? so we can dig the
> real reason.
> 
> [1] https://issues.apache.org/activemq/browse/CAMEL
> 
> Willem
> 
> mcnamara wrote:
>> Perusing the JAXB RI documentation, it appears the either ObjectFactory
>> or
>> jaxb.index is required.  In my case, xjc did generate ObjectFactory but
>> not
>> jaxb.index.  Apparently, jaxb.index is generated when going from
>> java->xsd
>> but not xsd->java
>> 
>> Placing jaxb.index in com/foo/bar yielded the same result - I checked
>> that
>> jaxb.index file is indeed being read by putting a non-existent class name
>> in
>> the file, and there was an error.
>> 
>> When rolling my own unmarshal code, a call to JAXBElement.getValue() was
>> required.
>> 
>> Note this is java 1.5 and using the jaxb jars packaged with camel.
>> 
>> 
>> Claus Ibsen wrote:
>>> Hi
>>>
>>> Maybe the jaxb.index stuff is something we should document on the camel
>>> wiki for the JAXB dataformat as a kind of reminder.
>>>
>>> Is jaxb.index always needed? 
>>>
>>>
>>> Med venlig hilsen
>>>  
>>> Claus Ibsen
>>> ......................................
>>> Silverbullet
>>> Skovsgårdsvænget 21
>>> 8362 Hørning
>>> Tlf. +45 2962 7576
>>> Web: www.silverbullet.dk
>>>
>>> -----Original Message-----
>>> From: Willem Jiang [mailto:willem.jiang@gmail.com] 
>>> Sent: 10. november 2008 04:57
>>> To: camel-user@activemq.apache.org
>>> Subject: Re: JAXB unmarshal
>>>
>>> Hi,
>>>
>>> Did you put the jaxb.index file into the "com.foo.bar" directory?
>>>
>>> Willem
>>>
>>> mcnamara wrote:
>>>> using .unmarshal(new JaxbDataFormat("com.foo.bar") is returning a
>>>> JAXBElement
>>>> instead of the desired object that was generated by xjc.
>>>>
>>>> I've looked at UnmarshalTest, and cannot account for the discrepancy.
>>>>
>>>> Any insight would be appreciated.
>>>>
>>>> Tim...
>>>
>>>
>> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/JAXB-unmarshal-tp20388524s22882p20431079.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: JAXB unmarshal

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

Can you fill a JIRA[1] and submit your test case ? so we can dig the
real reason.

[1] https://issues.apache.org/activemq/browse/CAMEL

Willem

mcnamara wrote:
> Perusing the JAXB RI documentation, it appears the either ObjectFactory or
> jaxb.index is required.  In my case, xjc did generate ObjectFactory but not
> jaxb.index.  Apparently, jaxb.index is generated when going from java->xsd
> but not xsd->java
> 
> Placing jaxb.index in com/foo/bar yielded the same result - I checked that
> jaxb.index file is indeed being read by putting a non-existent class name in
> the file, and there was an error.
> 
> When rolling my own unmarshal code, a call to JAXBElement.getValue() was
> required.
> 
> Note this is java 1.5 and using the jaxb jars packaged with camel.
> 
> 
> Claus Ibsen wrote:
>> Hi
>>
>> Maybe the jaxb.index stuff is something we should document on the camel
>> wiki for the JAXB dataformat as a kind of reminder.
>>
>> Is jaxb.index always needed? 
>>
>>
>> Med venlig hilsen
>>  
>> Claus Ibsen
>> ......................................
>> Silverbullet
>> Skovsgårdsvænget 21
>> 8362 Hørning
>> Tlf. +45 2962 7576
>> Web: www.silverbullet.dk
>>
>> -----Original Message-----
>> From: Willem Jiang [mailto:willem.jiang@gmail.com] 
>> Sent: 10. november 2008 04:57
>> To: camel-user@activemq.apache.org
>> Subject: Re: JAXB unmarshal
>>
>> Hi,
>>
>> Did you put the jaxb.index file into the "com.foo.bar" directory?
>>
>> Willem
>>
>> mcnamara wrote:
>>> using .unmarshal(new JaxbDataFormat("com.foo.bar") is returning a
>>> JAXBElement
>>> instead of the desired object that was generated by xjc.
>>>
>>> I've looked at UnmarshalTest, and cannot account for the discrepancy.
>>>
>>> Any insight would be appreciated.
>>>
>>> Tim...
>>
>>
> 


RE: JAXB unmarshal

Posted by mcnamara <ti...@gmail.com>.
Perusing the JAXB RI documentation, it appears the either ObjectFactory or
jaxb.index is required.  In my case, xjc did generate ObjectFactory but not
jaxb.index.  Apparently, jaxb.index is generated when going from java->xsd
but not xsd->java

Placing jaxb.index in com/foo/bar yielded the same result - I checked that
jaxb.index file is indeed being read by putting a non-existent class name in
the file, and there was an error.

When rolling my own unmarshal code, a call to JAXBElement.getValue() was
required.

Note this is java 1.5 and using the jaxb jars packaged with camel.


Claus Ibsen wrote:
> 
> Hi
> 
> Maybe the jaxb.index stuff is something we should document on the camel
> wiki for the JAXB dataformat as a kind of reminder.
> 
> Is jaxb.index always needed? 
> 
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> 
> -----Original Message-----
> From: Willem Jiang [mailto:willem.jiang@gmail.com] 
> Sent: 10. november 2008 04:57
> To: camel-user@activemq.apache.org
> Subject: Re: JAXB unmarshal
> 
> Hi,
> 
> Did you put the jaxb.index file into the "com.foo.bar" directory?
> 
> Willem
> 
> mcnamara wrote:
>> using .unmarshal(new JaxbDataFormat("com.foo.bar") is returning a
>> JAXBElement
>> instead of the desired object that was generated by xjc.
>> 
>> I've looked at UnmarshalTest, and cannot account for the discrepancy.
>> 
>> Any insight would be appreciated.
>> 
>> Tim...
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/JAXB-unmarshal-tp20388524s22882p20418181.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: JAXB unmarshal

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

Maybe the jaxb.index stuff is something we should document on the camel wiki for the JAXB dataformat as a kind of reminder.

Is jaxb.index always needed? 


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: Willem Jiang [mailto:willem.jiang@gmail.com] 
Sent: 10. november 2008 04:57
To: camel-user@activemq.apache.org
Subject: Re: JAXB unmarshal

Hi,

Did you put the jaxb.index file into the "com.foo.bar" directory?

Willem

mcnamara wrote:
> using .unmarshal(new JaxbDataFormat("com.foo.bar") is returning a JAXBElement
> instead of the desired object that was generated by xjc.
> 
> I've looked at UnmarshalTest, and cannot account for the discrepancy.
> 
> Any insight would be appreciated.
> 
> Tim...


Re: JAXB unmarshal

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

Did you put the jaxb.index file into the "com.foo.bar" directory?

Willem

mcnamara wrote:
> using .unmarshal(new JaxbDataFormat("com.foo.bar") is returning a JAXBElement
> instead of the desired object that was generated by xjc.
> 
> I've looked at UnmarshalTest, and cannot account for the discrepancy.
> 
> Any insight would be appreciated.
> 
> Tim...