login button

Axis2 and WSF: Mapping qname not fond for the package

Forums :

Hello,

I've got some trouble when I use some JPA detached entity in my Web services. At the runtime, the returned error is:

org.apache.axis2.rpc.receivers.RPCMessageReceiver - java.lang.RuntimeException: org.apache.axis2.AxisFault: Mapping qname not fond for the package:

XXX.entity.jpa

org.apache.axiom.om.OMException: java.lang.RuntimeException: org.apache.axis2.AxisFault: Mapping qname not fond for the package: XXX.entity.jpa
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:247)
    at org.apache.axiom.om.impl.llom.OMNodeImpl.build(OMNodeImpl.java:319)
    at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:650)
    at org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:619)
    at org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:118)
    at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:269)
    at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:198)
    at org.apache.axis2.rpc.receivers.RPCUtil.processResponseAsDocLitWrapped(RPCUtil.java:381)
    at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:134)
    at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
    at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:148)
    at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
    at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:121)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:619)

 Caused by: java.lang.RuntimeException: org.apache.axis2.AxisFault: Mapping qname not fond for the package: com.thomson.smv.contentrecommendation.entity.jpa
    at org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.java:264)
    at org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.processProperties(ADBXMLStreamReaderImpl.java:988)
    at org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.next(ADBXMLStreamReaderImpl.java:835)
    at org.apache.axis2.util.StreamWrapper.next(StreamWrapper.java:71)
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:159)
    ... 27 more
Caused by: org.apache.axis2.AxisFault: Mapping qname not fond for the package: com.thomson.smv.contentrecommendation.entity.jpa
    at org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.java:102)
    ... 31 more

 

This error has occured during the following web service execution:

package XXX.ws.contentservice;

import java.util.List;

import XXX.entity.Content;
import XXX.service.ContentService;

public class ContentServiceWS_1dot1 {
    private ContentService contentService;

    public void setContentService(ContentService contentService) {
        this.contentService = contentService;
    }

    public Content[] getContentList() {
        List<Content> contentList = contentService.getContentList();
        return contentList.toArray(new Content[contentList.size()]);
    }

    public Content[] getContentListPagging(int first, int count, String order,
            boolean isAscending) {
        List<Content> contentList = contentService.getContentList(first, count,
                order, isAscending);
        return contentList.toArray(new Content[contentList.size()]);
    }

    public Content getContent(String id) {
        return contentService.getContent(id);
    }

    public long getContentNumber() {
        return contentService.getContentNumber();
    }

    public boolean isTitleExist(String title) {
        return contentService.isTitleExist(title);
    }

}

 

The ContentService object is a service interface. A ContentService's implementation is injected by Spring. This service implementation calls a Spring injected DAO.

The Content object is also a server interface. The implementation of the Content interface is made by the DAO implementation. The Content interface implementation is XXX.entity.jpa.ContentImplJPA, that is the only class of the XXX.entity.jpa package, that is the package that causes the qname mapping problem.

But:

  • My web service don't call directly the XXX.entity.jpa.ContentImplJPA, but by using Spring injection, this is the implementation that is used for implementing the Content interface.
  • My Content interface implementation is in my classpath (mandatory for injection)

Then I'm suspecting a problem of class loading during qname resolution. Do you have an idea about that?

 

 


 For you information, I'm using the following configuration:

  • WSF/Spring 1.0
  • Spring 2.5.5
  • Axis 2.

 


Here is the list of used jars (with version when it's possible):

activation-1.1.jar
addressing-SNAPSHOT.mar
annogen-0.1.0.jar
aopalliance.jar
asm.jar
asm-attrs.jar
aspectjrt.jar
aspectjweaver.jar
axiom-api-1.2.6.jar
axiom-dom-1.2.6.jar
axiom-impl-1.2.6.jar
axis2-adb-1.35.jar
axis2-kernel-1.35.jar
backport-util-concurrent-2.2.jar
c3p0-0.9.1.2.jar
catalina-5.5.15.jar
cglib-2.1.3.jar
commonj.sdo_2.1.0.jar
commons-codec-1.2.jar
commons-collections-3.2.jar
commons-digester-1.2.jar
commons-fileupload-1.1.1.jar
commons-httpclient-3.0.1.jar
commons-io-1.2.jar
commons-lang-2.1.jar
commons-logging-1.1.jar
commons-modeler-1.1.jar
commons-pool-1.3.jar
dom4j-1.6.1.jar
eclipselink.jar
geronimo-activation_1.1_spec-1.0-M1.jar
geronimo-jms_1.1_spec-1.1.jar
geronimo-jpa_3.0_spec-1.0.jar
geronimo-jta_1.1_spec-1.1.jar
geronimo-stax-api_1.0_spec-1.0.jar
httpcore-4.0-alpha6.jar
httpcore-nio-4.0-alpha6.jar
httpcore-niossl-4.0-alpha6.jar
jaxen-1.1-beta-7.jar
jaxen-1.1-beta-9.jar
jta.jar
junit-3.8.1.jar
log4j-1.2.15.jar
mail-1.4.jar
mx4j-jmx-1.1.jar
mysql-connector-java-5.0.8-bin.jar
neethi-2.0.2.jar
openjpa-1.1.0.jar
persistence.jar
serp-1.13.1.jar
slf4j-api-1.5.0.jar
slf4j-log4j12-1.5.0.jar
spring-aop.jar
spring-beans.jar
spring-context.jar
spring-context-support.jar
spring-core.jar
spring-jdbc.jar
spring-orm.jar
spring-sources.jar
spring-tomcat-weaver.jar
spring-tx.jar
spring-web.jar
stax-api-1.0.1.jar
woden-1.0-incubating-M7b.jar
woden-api-0.95.jar
wsdl4j-1.6.1.jar
wsf-spring-1.0.jar
wstx-asl-3.2.1.jar
xalan-2.7.0.jar
xercesImpl-2.8.1.jar
xml-apis-1.3.03.jar
xmlParserAPIs-2.6.0.jar
XmlSchema-1.3.2.jar


 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Axis2 and WSF: Mapping qname not fond for the package (resolve)

This is an axis issue.

But the direct use of an entity in the web service layer is not recommended. Why? Because the entity may use some types that are not recommended in WS (example: Collection, Hashmap...). Then the solution is to wrap the entity into a WS object that encapsulates data and eventually changes type.

Then, the WS service POJO is always created but I must write 2 new Objects around it:

  • A WS Object that is used in the WS paramters (incoming and outgoing)
  • A Factory object that is used to easily create an entity object since a WS object and vice versa

The produced code is a little bit matter but it is more complete to exploit WS.

 

Thanks for your forum and your excellent WSF/Spring product.

 

Regards

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.