Hi Atanas,
Could you please provide some more information on your environment,
i.e. what OSGi runtime, what HTTP container, etc. you are running,
including Jersey version information?
We are continuously testing OSGi integration on our Hudson
and the JSON related test (see [1]) passes all right there.
Thanks,
~Jakub
[1]
http://java.net/projects/jersey/sources/svn/content/trunk/jersey/osgi/functional-tests/src/test/java/com/sun/jersey/osgifunctionaltests/JsonTest.java?rev=5460
On 20.10.2011 14:27, ?????? ??????? wrote:
> Hi All,
>
> I am running on OSGI and want to try out Jersey to build a Restful
> service.
>
> *I have a simple POJO annotated with JAXB annotations*
> @XmlRootElement
> public class MyBean {
> private String name;
> private String description;
> public MyBean() {
> // TODO Auto-generated constructor stub
> }
> public MyBean(String name, String description) {
> super();
> this.name <http://this.name> = name;
> this.description = description;
> }
> public String getName() {
> return name;
> }
> public String getDescription() {
> return description;
> }
>
> }
>
> *and a simple resource*
>
> @Singleton
> @Path("/test")
> public class TestResource {
> @GET
> @Produces("application/json")
> public MyBean getTest(){
> return new MyBean("dfas", "dfa");
> }
>
> }
>
> *Questions: *
> 1. getTest() is invoked but have the following
> Exception:java.lang.LinkageError: loader constraint violation: loader
> (instance of <bootloader>) previously initiated loading for a
> different type with name "javax/xml/stream/XMLStreamWriter"
>
> I am using jdk 6 where javax/xml/stream/XMLStreamWriter is part of and
> jdk jars are loaded first by default in OSGI.It seems Jersey uses some
> other impl of XmlStreamWriter.Right?
> Jersey dependencies i use:
>
> * jersey-core.jar
> * jersey-server.jar
> * jersey-json.jar
>
> i tried to use jersey-bundle.jar but it has pretty much other
> dependencies which are not resolved.
>
>
> /note:text/xml mime type works as excpected but i want to try out json
> out of the box transformation/
>
> *
> *
>