users@jersey.java.net

Re: [Jersey] JSONJAXBContext

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 16 Dec 2009 20:48:56 +0100

What is in the logs when the Jersey app is deployed? does it state
that MyJAXBContextResolver is found?

Is there an exception logged when Jersey instantiates
MyJAXBContextResolver?

Paul.

On Dec 16, 2009, at 8:44 PM, Felipe Gaścho wrote:

> in the pom.xml
>
> <dependency>
> <groupId>com.sun.xml.bind</groupId>
> <artifactId>jaxb-impl</artifactId>
> <version>2.1.10</version>
> </dependency>
>
> ---------- JSONJAXBContext doesn't exists in the classpath
>
> the JSON provider:
>
> @Provider
> public class MyJAXBContextResolver implements
> ContextResolver<JAXBContext> {
>
> private JAXBContext context;
> private Class[] types = null;//{ StatusInfoBean.class,
> JobInfoBean.class };
>
> public MyJAXBContextResolver() throws Exception {
> this.context = new
> JSONJAXBContext(JSONConfiguration.natural().build(), types);
> }
>
> public JAXBContext getContext(Class<?> objectType) {
> return (types[0].equals(objectType)) ? context : null;
> }
> }
>
>
> 2009/12/16 Felipe Gaścho <fgaucho_at_gmail.com>:
>> humm.. I celebrated too early.. XML never had that symbol
>> anyway.......
>>
>> so I am forced to ask again.. how to do that ?
>>
>> * I am using JAXB annotated classes, is it possible to remove the @
>> symbol from @XmlAttribute fields ?
>>
>
>
>
> --
> ------------------------------------------
> Felipe Gaścho
> 10+ Java Programmer
> CEJUG Senior Advisor
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>