You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by semecxf <di...@gmail.com> on 2012/11/26 18:02:24 UTC

Jaxb and Third party classes

I am getting " nor any of its super class is known to this context" error
because my third party class can't be annotated.
Any work around for third class that I can't annotate?
My third party class is an inner class so the class is A$B.

How I can add that third party in context?



--
View this message in context: http://cxf.547215.n5.nabble.com/Jaxb-and-Third-party-classes-tp5719127.html
Sent from the cxf-user mailing list archive at Nabble.com.

Fwd: Re: Jaxb and Third party classes

Posted by Glen Mazza <gm...@talend.com>.
I suspect you're using SOAP, not REST, but the moxy-oxm-mapping sample 
here: http://www.jroller.com/gmazza/entry/jersey_samples_on_cxf shows 
(3) below with CXF REST (at least).

HTH,
Glen


-------- Original Message --------
Subject: 	Re: Jaxb and Third party classes
Date: 	Mon, 26 Nov 2012 19:28:16 +0100
From: 	Ladislav Lenčucha <la...@gmail.com>
Reply-To: 	<us...@cxf.apache.org>
To: 	<us...@cxf.apache.org>



There are 3 options.

1. If your type is a primitive type (stored as string, without any nested
elements), you might want to use globalbindings:
http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/1.5/tutorial/doc/JAXBUsing4.html#wp148613
http://jaxb.java.net/guide/Using_different_datatypes.html

2. If the external class is nested in your own class, you might want to
create custom XmlAdapter for the external class and define how to serialize
the class inside your class using simple annotation:
http://docs.oracle.com/javase/6/docs/api/javax/xml/bind/annotation/adapters/XmlAdapter.html

3. Check this external annotations article about how to use EclipseLink
JAXB (MOXy):
http://blog.bdoughan.com/2010/12/extending-jaxb-representing-annotations.html


-- 
S pozdravom
Ladislav Lenčucha
ladislav.lencucha@gmail.com



On Mon, Nov 26, 2012 at 6:02 PM, semecxf <di...@gmail.com> wrote:

> I am getting " nor any of its super class is known to this context" error
> because my third party class can't be annotated.
> Any work around for third class that I can't annotate?
> My third party class is an inner class so the class is A$B.
>
> How I can add that third party in context?
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Jaxb-and-Third-party-classes-tp5719127.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>





Re: Jaxb and Third party classes

Posted by Ladislav Lenčucha <la...@gmail.com>.
There are 3 options.

1. If your type is a primitive type (stored as string, without any nested
elements), you might want to use globalbindings:
http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/1.5/tutorial/doc/JAXBUsing4.html#wp148613
http://jaxb.java.net/guide/Using_different_datatypes.html

2. If the external class is nested in your own class, you might want to
create custom XmlAdapter for the external class and define how to serialize
the class inside your class using simple annotation:
http://docs.oracle.com/javase/6/docs/api/javax/xml/bind/annotation/adapters/XmlAdapter.html

3. Check this external annotations article about how to use EclipseLink
JAXB (MOXy):
http://blog.bdoughan.com/2010/12/extending-jaxb-representing-annotations.html


-- 
S pozdravom
Ladislav Lenčucha
ladislav.lencucha@gmail.com



On Mon, Nov 26, 2012 at 6:02 PM, semecxf <di...@gmail.com> wrote:

> I am getting " nor any of its super class is known to this context" error
> because my third party class can't be annotated.
> Any work around for third class that I can't annotate?
> My third party class is an inner class so the class is A$B.
>
> How I can add that third party in context?
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Jaxb-and-Third-party-classes-tp5719127.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>