You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by ETTAIB Mohammed <m....@netfective.ma> on 2010/05/06 17:52:59 UTC

cxf Marshalling error

Hi, I have developed a web service application using Apache CXF 2.2.7
and Spring 3, deployed onto Tomcat,

but I'm getting the following error message:

 

6 mai 2010 16:33:03 org.apache.cxf.phase.PhaseInterceptorChain
doDefaultLogging

ATTENTION: Interceptor for
{http://cxfServer.services.lecarnet.Test.netfective.com/}WSDeleteService
Service#{http://cxfServer.services.lecarnet.Test.netfective.com/}collabo
rateurDelete has thrown exception, unwinding now

org.apache.cxf.interceptor.Fault: Marshalling Error:
com.netfective.bluage.core.business.IBusinessObject is not known to this
context

      at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshallException(JAXBEncoderDe
coder.java:437)

      at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.jav
a:488)

      at
org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:113)

      at
org.apache.cxf.interceptor.ClientFaultConverter.processFaultDetail(Clien
tFaultConverter.java:131)

 

My cxf config files look like :

 

Bean.xml

                        <jaxws:endpoint

            id="serviceDelete"

 
implementor="com.netfective.Test.lecarnet.services.cxfServer.WSDeleteSer
viceImpl"

            address="/WSDeleteService" />

 

cxf-client.xml

                        <jaxws:client id="clientDelete" 

 
serviceClass="com.netfective.Test.lecarnet.services.cxfServer.WSDeleteSe
rvice" 

 
address="http://localhost:8080/WS_cxf-web/services/WSDeleteService?wsdl"
/>

 

It's clear that it's an error of JAXB data-binding with the
IBusinessObject interface implemented by my object that web service is
called for, but I found no way to solve this issue yet.

Here is the code of the IBusinessObject interface:

            public interface IBusinessObject extends Serializable {

            public void setObjMode(String mode);

            public String getObjMode();

            public static final String DAO_MODE = "dao";

            public static final String HELPER_MODE = "helper";}

 

I tried to add annotations @xmlRootElement to IBusinessObject but
without success.

Is there a problem in cxf with interfaces?

Can any one tell me what I'm doing wrong, or what I need to add please?

 

Regards,

 

m.ettaib


Re: cxf Marshalling error

Posted by Daniel Kulp <dk...@apache.org>.

Well,  JAXB doesn't support Interfaces unless there is an XMLJavaTypeAdapter 
thing registered to map the interface to concrete implementations.   That 
said, I'm not sure if they would even apply to root types that would be used 
in exceptions.   

I would highly suggest using a concrete type in this case.

Dan


On Thursday 06 May 2010 11:52:59 am ETTAIB Mohammed wrote:
> Hi, I have developed a web service application using Apache CXF 2.2.7
> and Spring 3, deployed onto Tomcat,
> 
> but I'm getting the following error message:
> 
> 
> 
> 6 mai 2010 16:33:03 org.apache.cxf.phase.PhaseInterceptorChain
> doDefaultLogging
> 
> ATTENTION: Interceptor for
> {http://cxfServer.services.lecarnet.Test.netfective.com/}WSDeleteService
> Service#{http://cxfServer.services.lecarnet.Test.netfective.com/}collabo
> rateurDelete has thrown exception, unwinding now
> 
> org.apache.cxf.interceptor.Fault: Marshalling Error:
> com.netfective.bluage.core.business.IBusinessObject is not known to this
> context
> 
>       at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshallException(JAXBEncoderDe
> coder.java:437)
> 
>       at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.jav
> a:488)
> 
>       at
> org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:113)
> 
>       at
> org.apache.cxf.interceptor.ClientFaultConverter.processFaultDetail(Clien
> tFaultConverter.java:131)
> 
> 
> 
> My cxf config files look like :
> 
> 
> 
> Bean.xml
> 
>                         <jaxws:endpoint
> 
>             id="serviceDelete"
> 
> 
> implementor="com.netfective.Test.lecarnet.services.cxfServer.WSDeleteSer
> viceImpl"
> 
>             address="/WSDeleteService" />
> 
> 
> 
> cxf-client.xml
> 
>                         <jaxws:client id="clientDelete"
> 
> 
> serviceClass="com.netfective.Test.lecarnet.services.cxfServer.WSDeleteSe
> rvice"
> 
> 
> address="http://localhost:8080/WS_cxf-web/services/WSDeleteService?wsdl"
> />
> 
> 
> 
> It's clear that it's an error of JAXB data-binding with the
> IBusinessObject interface implemented by my object that web service is
> called for, but I found no way to solve this issue yet.
> 
> Here is the code of the IBusinessObject interface:
> 
>             public interface IBusinessObject extends Serializable {
> 
>             public void setObjMode(String mode);
> 
>             public String getObjMode();
> 
>             public static final String DAO_MODE = "dao";
> 
>             public static final String HELPER_MODE = "helper";}
> 
> 
> 
> I tried to add annotations @xmlRootElement to IBusinessObject but
> without success.
> 
> Is there a problem in cxf with interfaces?
> 
> Can any one tell me what I'm doing wrong, or what I need to add please?
> 
> 
> 
> Regards,
> 
> 
> 
> m.ettaib

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog