cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: JAX-RS service w/ interface result type, @XmlJavaTypeAdapter
Date Fri, 23 Jul 2010 17:45:32 GMT
Hi Elias

There's a test on the trunk (systests/jaxrs) (JAXRSClientServerBook &
BookServer) showing that adapters attached to interfaces work (as well as to
JAXRS methods).

Explicit collection of interfaces with adapters involved - I'm not surprised
it does not work.
I think the collectionsMap just plainly checks for the equality, so as a
workaround use the impl class name.

You said returning just an interface works. So there's some bug in the way
explicit collection of interfaces is handled. I wish I could look into it
but unless you can help with some debugging, I can't prioritize at the
moment on the issues for which workarounds exist

thanks, Sergey

On Fri, Jul 23, 2010 at 5:10 PM, ermedeiros <eliasrdm@yahoo.com.br> wrote:

>
> Hi Sergey,
>
> Thanks for your help.
> Introduce a simple public BaseballCardCollection bean isn't a relly option
> for me. I tried with a collectionWrapperMap property, but I got some
> problems. First of all, must I use the interface or the implemation name in
> <key><value>...</value></key>?
>
> when I try:
>
> <bean id="jaxbProvider"
> class="org.apache.cxf.jaxrs.provider.JAXBElementProvider">
>        <property name="collectionWrapperMap">
>                <map>
>                    <entry>
>                      <key><value>mypackage.MyInterface</value></key>
>                      <value>MyObjects</value>
>                    </entry>
>                 </map>
>         </property>
>  </bean>
>
> I get:
> "Unexpected EOF; was expecting a close tag for element <MyObjects>"
>
> and when I try:
>
>   <bean id="jaxbProvider"
> class="org.apache.cxf.jaxrs.provider.JAXBElementProvider">
>        <property name="collectionWrapperMap">
>                <map>
>                    <entry>
>                      <key><value>mypackage.MyImplementation</value></key>
>                      <value>MyObjects</value>
>                    </entry>
>                 </map>
>         </property>
>  </bean>
>
> I get:
> "WARNING: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts
> of Il
> legalAnnotationExceptions
> mypackage.MyInterface is an interface, and JAXB can't handle inter
> faces.
>        this problem is related to the following location:
>                at mypackage.MyInterface
> demo.jaxrs.server.CustomerInterface does not have a no-arg default
> constructor.
>        this problem is related to the following location:
>                at mypackage.MyInterface
> "
>
> Last remark: I'm getting the fixed version from
> https://repository.apache.org/content/groups/snapshots-group
>        <dependency>
>            <groupId>org.apache.cxf</groupId>
>            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
>            <version>2.2.10-SNAPSHOT</version>
>        </dependency>
>
> Is that right?
> Thanks again,
> Elias
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/JAX-RS-service-w-interface-result-type-XmlJavaTypeAdapter-tp564352p1843475.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message