tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <>
Subject Re: How can I configure Apache CXF ignoreNamespaces in TomEE+?
Date Sun, 11 Jan 2015 15:42:36 GMT

beans.xml is a CDI config files and you pasted spring config (why the error).

To configure ignoreNamespaces just define an openejb-jar.xml and a
resources.xml as in the johnzon sample explained here
Just adapt it to cxf default json provider.

Romain Manni-Bucau

2015-01-11 14:23 GMT+01:00 Vincenzo D'Amore <>:
> 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:"",
local:"server"). Expected elements are <{}decorators>,<{}interceptors>,<{}alternatives>`
> What do you think, should I continue configure cfx or try to use a different implementation

View raw message