You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Jason Chaffee <ja...@zilliontv.tv> on 2009/01/19 02:00:40 UTC

is it possible to use jaxb extension classes in jaxb cxf-su

I like to keep my code as OO as possible.  Therefore, I often add behaviors to my jaxb generated classes by extending the generated classes and creating a custom jaxb ObjectFactory that is passed into the JAXBContext to be used during unmarshalling.  This will give me back my custom class instead of the generated class.  This way I can add behaviors directly on the object itself instead of writing procedural code to operate on the object.  Here is the JAXB documentation on the subject:  https://jaxb.dev.java.net/guide/Adding_behaviors.html

Is there a way to support this in a cxf-su?  If I try to use my custom class, I get an error because of a type mismatch.  Therefore, I would need a way to tell cxf to use my custom ObjectFactory, but I haven't found a way to it.

RE: is it possible to use jaxb extension classes in jaxb cxf-su

Posted by Jason Chaffee <ja...@zilliontv.tv>.
FYI, here is the error I get:

                                        <loc-message>org.codehaus.xfire.jaxb2.JaxbType cannot be cast to org.codehaus.xfire.aegis.type.basic.BeanType</loc-message>
                                        <stack-trace><![CDATA[java.lang.ClassCastException: org.codehaus.xfire.jaxb2.JaxbType cannot be cast to org.codehaus.xfire.aegis.type.basic.BeanType
...

-----Original Message-----
From: Freeman Fang [mailto:freeman.fang@gmail.com]
Sent: Sunday, January 18, 2009 5:02 PM
To: users@servicemix.apache.org
Subject: Re: is it possible to use jaxb extension classes in jaxb cxf-su

Hi,

What kind of error you see?
And this is more cxf specific question IMO, would you please post this
question to cxf mailling list also?
Freeman

Jason Chaffee wrote:
> I like to keep my code as OO as possible.  Therefore, I often add behaviors to my jaxb generated classes by extending the generated classes and creating a custom jaxb ObjectFactory that is passed into the JAXBContext to be used during unmarshalling.  This will give me back my custom class instead of the generated class.  This way I can add behaviors directly on the object itself instead of writing procedural code to operate on the object.  Here is the JAXB documentation on the subject:  https://jaxb.dev.java.net/guide/Adding_behaviors.html
>
> Is there a way to support this in a cxf-su?  If I try to use my custom class, I get an error because of a type mismatch.  Therefore, I would need a way to tell cxf to use my custom ObjectFactory, but I haven't found a way to it.
>


RE: is it possible to use jaxb extension classes in jaxb cxf-su

Posted by Jason Chaffee <ja...@zilliontv.tv>.
Is there a more appropriate configuration I should be using for cxf instead othe jsr181 xfire mapping?  If so, what is the name?  Then, I will look up the info in the documentation.

-----Original Message-----
From: Freeman Fang [mailto:freeman.fang@gmail.com]
Sent: Monday, January 19, 2009 2:26 AM
To: users@servicemix.apache.org
Subject: Re: is it possible to use jaxb extension classes in jaxb cxf-su

The jsr181 compoent is based on xfire but not cxf,  and the jsr181
component is different with cxf se  component.
It should be more xfire specific issue. Since cxf is merged from xfire
and they can both delegate marshall/unmarshall to the jaxb, so I hope
the help from cxf mailinglist would inspire  you as well.

Freeman

Jason Chaffee wrote:
> Would this be a cxf issue or a servicemix issue, if I am using jsr181:endpoint configuration?
>
>   <jsr181:endpoint
>         service="cprop:ContentDestinationService"
>                 endpoint="endpoint"
>         annotations="jsr181"
>         style="document"
>         typeMapping="jaxb2">
>
> -----Original Message-----
> From: Freeman Fang [mailto:freeman.fang@gmail.com]
> Sent: Sunday, January 18, 2009 5:02 PM
> To: users@servicemix.apache.org
> Subject: Re: is it possible to use jaxb extension classes in jaxb cxf-su
>
> Hi,
>
> What kind of error you see?
> And this is more cxf specific question IMO, would you please post this
> question to cxf mailling list also?
> Freeman
>
> Jason Chaffee wrote:
>
>> I like to keep my code as OO as possible.  Therefore, I often add behaviors to my jaxb generated classes by extending the generated classes and creating a custom jaxb ObjectFactory that is passed into the JAXBContext to be used during unmarshalling.  This will give me back my custom class instead of the generated class.  This way I can add behaviors directly on the object itself instead of writing procedural code to operate on the object.  Here is the JAXB documentation on the subject:  https://jaxb.dev.java.net/guide/Adding_behaviors.html
>>
>> Is there a way to support this in a cxf-su?  If I try to use my custom class, I get an error because of a type mismatch.  Therefore, I would need a way to tell cxf to use my custom ObjectFactory, but I haven't found a way to it.
>>
>>
>
>


Re: is it possible to use jaxb extension classes in jaxb cxf-su

Posted by Freeman Fang <fr...@gmail.com>.
The jsr181 compoent is based on xfire but not cxf,  and the jsr181 
component is different with cxf se  component.
It should be more xfire specific issue. Since cxf is merged from xfire 
and they can both delegate marshall/unmarshall to the jaxb, so I hope  
the help from cxf mailinglist would inspire  you as well.

Freeman

Jason Chaffee wrote:
> Would this be a cxf issue or a servicemix issue, if I am using jsr181:endpoint configuration?
>
>   <jsr181:endpoint
>         service="cprop:ContentDestinationService"
>                 endpoint="endpoint"
>         annotations="jsr181"
>         style="document"
>         typeMapping="jaxb2">
>
> -----Original Message-----
> From: Freeman Fang [mailto:freeman.fang@gmail.com]
> Sent: Sunday, January 18, 2009 5:02 PM
> To: users@servicemix.apache.org
> Subject: Re: is it possible to use jaxb extension classes in jaxb cxf-su
>
> Hi,
>
> What kind of error you see?
> And this is more cxf specific question IMO, would you please post this
> question to cxf mailling list also?
> Freeman
>
> Jason Chaffee wrote:
>   
>> I like to keep my code as OO as possible.  Therefore, I often add behaviors to my jaxb generated classes by extending the generated classes and creating a custom jaxb ObjectFactory that is passed into the JAXBContext to be used during unmarshalling.  This will give me back my custom class instead of the generated class.  This way I can add behaviors directly on the object itself instead of writing procedural code to operate on the object.  Here is the JAXB documentation on the subject:  https://jaxb.dev.java.net/guide/Adding_behaviors.html
>>
>> Is there a way to support this in a cxf-su?  If I try to use my custom class, I get an error because of a type mismatch.  Therefore, I would need a way to tell cxf to use my custom ObjectFactory, but I haven't found a way to it.
>>
>>     
>
>   


RE: is it possible to use jaxb extension classes in jaxb cxf-su

Posted by Jason Chaffee <ja...@zilliontv.tv>.
Would this be a cxf issue or a servicemix issue, if I am using jsr181:endpoint configuration?

  <jsr181:endpoint
        service="cprop:ContentDestinationService"
                endpoint="endpoint"
        annotations="jsr181"
        style="document"
        typeMapping="jaxb2">

-----Original Message-----
From: Freeman Fang [mailto:freeman.fang@gmail.com]
Sent: Sunday, January 18, 2009 5:02 PM
To: users@servicemix.apache.org
Subject: Re: is it possible to use jaxb extension classes in jaxb cxf-su

Hi,

What kind of error you see?
And this is more cxf specific question IMO, would you please post this
question to cxf mailling list also?
Freeman

Jason Chaffee wrote:
> I like to keep my code as OO as possible.  Therefore, I often add behaviors to my jaxb generated classes by extending the generated classes and creating a custom jaxb ObjectFactory that is passed into the JAXBContext to be used during unmarshalling.  This will give me back my custom class instead of the generated class.  This way I can add behaviors directly on the object itself instead of writing procedural code to operate on the object.  Here is the JAXB documentation on the subject:  https://jaxb.dev.java.net/guide/Adding_behaviors.html
>
> Is there a way to support this in a cxf-su?  If I try to use my custom class, I get an error because of a type mismatch.  Therefore, I would need a way to tell cxf to use my custom ObjectFactory, but I haven't found a way to it.
>


Re: is it possible to use jaxb extension classes in jaxb cxf-su

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

What kind of error you see?
And this is more cxf specific question IMO, would you please post this 
question to cxf mailling list also?
Freeman

Jason Chaffee wrote:
> I like to keep my code as OO as possible.  Therefore, I often add behaviors to my jaxb generated classes by extending the generated classes and creating a custom jaxb ObjectFactory that is passed into the JAXBContext to be used during unmarshalling.  This will give me back my custom class instead of the generated class.  This way I can add behaviors directly on the object itself instead of writing procedural code to operate on the object.  Here is the JAXB documentation on the subject:  https://jaxb.dev.java.net/guide/Adding_behaviors.html
>
> Is there a way to support this in a cxf-su?  If I try to use my custom class, I get an error because of a type mismatch.  Therefore, I would need a way to tell cxf to use my custom ObjectFactory, but I haven't found a way to it.
>