Quantcast
Viewing all articles
Browse latest Browse all 5648

Invalid JSON Namespace

Hi I have a JAXB annotated (wsimport) jaxws service that i'm writing
an adapter for using jaxrs and jettison with 2.7.5.

When service the rest endpoint with XML using the jaxws objects, it
works just fine. However when serving JSON encoding data in response,
I get this.

Caused by: java.lang.IllegalStateException: Invalid JSON namespace:
urn:uddi-org:api_v3
at org.codehaus.jettison.mapped.MappedNamespaceConvention.getJSONNamespace(MappedNamespaceConvention.java:252)
at org.codehaus.jettison.mapped.MappedNamespaceConvention.createKey(MappedNamespaceConvention.java:260)
at org.codehaus.jettison.mapped.MappedXMLStreamWriter.writeStartElement(MappedXMLStreamWriter.java:220)
at com.sun.xml.bind.v2.runtime.output.XMLStreamWriterOutput.beginStartTag(XMLStreamWriterOutput.java:118)

Beans.xml config file

<jaxrs:server id="inquiryRestService" address="/inquiryRest">
<jaxrs:serviceBeans>
<ref bean="inquiryRest" />
</jaxrs:serviceBeans>
</jaxrs:server>
<bean id="inquiryRest"
class="org.apache.juddi.api.impl.rest.UDDIInquiryJAXRS" >
</bean>
<bean id="jaxbProvider" class="org.apache.cxf.jaxrs.provider.json.JSONProvider">
<property name="ignoreNamespaces" value="true"/>
</bean>

this part works
@GET
@Path("/XML/businessDetail/{id}")
@Produces("application/xml")
@org.apache.cxf.jaxrs.model.wadl.Description("Returns the details
of a business entity in XML")
public org.uddi.api_v3.BusinessEntity
getBusinessDetailXML(@PathParam("id") String id) throws
WebApplicationException {
return getBusinessDetail(id);

this part does not
@GET
@Path("/JSON/businessDetail/{id}")
@Produces("application/json")
@org.apache.cxf.jaxrs.model.wadl.Description("Returns the details
of a business entity in JSON")
public org.uddi.api_v3.BusinessEntity
getBusinessDetailJSON(@PathParam("id") String id) throws
WebApplicationException {
return getBusinessDetail(id);

The complete code is over here:
http://svn.apache.org/repos/asf/juddi/trunk/juddi-rest-cxf/

From googling, I've seen that adding the ignoreNamespaces=true should
fix this, but I'm not sure if I have it in the write place. The docs
don't have a clear example of this

Viewing all articles
Browse latest Browse all 5648

Trending Articles