tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincenzo D'Amore <v.dam...@gmail.com>
Subject How can I configure Apache CXF ignoreNamespaces in TomEE+?
Date Sun, 11 Jan 2015 13:23:45 GMT
Hi All,

I have create a simple RESTful service but when I tried to return json I have this error:

    java.lang.IllegalStateException: Invalid JSON namespace

Looking at TomEE+ 1.7.1 I saw behind jax-rs implementation there is Apache CXF 2.6.4, so I
tried to configure property ignoreNamespaces = true.

Unfortunately, I haven't found any documentation on TomEE, and looking at Apache CXF documentation
if I want set ignoreNamespaces = true I should set it into `beans.xml`

    <property name="ignoreNamespaces" value="true"/>

Writing something like:

    <jaxrs:server>
      <jaxrs:providers>
        <ref bean="jsonProvider"/>
      </jaxrs:providers>
    </jaxrs:server>
    <bean id="jsonProvider" class="org.apache.cxf.jaxrs.provider.json.JSONProvider">
       <property name="ignoreNamespaces" value="true"/>
       <property name="namespaceMap" ref="jsonNamespaceMap"/>
    </bean>

But in this case I got a different error during the TomEE boot:

`Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"http://java.sun.com/xml/ns/javaee",
local:"server"). Expected elements are <{http://java.sun.com/xml/ns/javaee}decorators>,<{http://java.sun.com/xml/ns/javaee}interceptors>,<{http://java.sun.com/xml/ns/javaee}alternatives>`

What do you think, should I continue configure cfx or try to use a different implementation
(Jersey)?
Mime
View raw message