10 Replies Latest reply: Jan 4, 2013 2:36 PM by Nicholas DiPiazza RSS

    : mapped-name is required for cxf of deployment auto-update-ws.war

    Mr User Newbie

       

      I am not sure where exactly sure where to start, here  but I have a  web service war file built using Apache CXF. This war file runs great in apache tomcat container, so I have some level of confidence.

       

      However, when I try putting in deploy dir and restarting JBoss 5.1 with this war file I get the below exceptions. I am not sure what

       

      “java.lang.RuntimeException: mapped-name is required for cxf of deployment auto-update-ws.war”

       

      means or what I need to do to resolve.  Below also is the jbossws-cxf.xml I am using for this based on “JBossWS - Stack CXF User Guide” and the web.xml

       

       

       

      10:48:03,326 INFO  [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 2m:56s:966ms

      11:32:38,694 INFO  [TomcatDeployment] deploy, ctxPath=/auto-update-ws

      11:32:38,969 ERROR [StandardContext] Context [/auto-update-ws] startup failed due to previous errors

      java.lang.RuntimeException: mapped-name is required for cxf of deployment auto-update-ws.war

              at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXmlResourceEnvRefs(WebResourceHandler.java:287)

              at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXml(WebResourceHandler.java:325)

              at org.jboss.web.tomcat.service.TomcatInjectionContainer.processMetadata(TomcatInjectionContainer.java:550)

              at org.jboss.web.tomcat.service.WebCtxLoader.start(WebCtxLoader.java:158)

              at org.apache.catalina.core.StandardContext.start(StandardContext.java:4272)

              at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)

              at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)

              at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)

              at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)

              at org.jboss.web.deployers.WebModule.start(WebModule.java:97)

       

       

      DEPLOYMENTS IN ERROR:

        Deployment "vfszip:/space/server/default/deploy/auto-update-ws.war/" is in error due to the following reason(s): org.jboss.deployers.spi.DeploymentException: URL file:/space/server/default/tmp/a69515-bvwhsb-g4sr37lt-1-g4sssbdl-1ep/auto-update-ws.war/ deployment failed

       

              at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)

              at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)

              at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)

              at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)

              at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)

              at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)

              at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

       

       

      jbossws-cxf.xml

       

      <beans

        xmlns='http://www.springframework.org/schema/beans'

        xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'

        xmlns:beans='http://www.springframework.org/schema/beans'

        xmlns:jaxws='http://cxf.apache.org/jaxws'

        xsi:schemaLocation='http://www.springframework.org/schema/beans

        http://www.springframework.org/schema/beans/spring-beans.xsd

        http://cxf.apache.org/jaxws

        http://cxf.apache.org/schemas/jaxws.xsd'>

       

        <!-- one or more jaxws:endpoint POJO declarations -->

       

        <jaxws:endpoint

          id='p1'

          address='http://nemo:8080/auto-update-ws/p1' 

          implementor='com.oti.main.webservice.UpdateServiceImpl'>

          <jaxws:invoker>

            <bean class='org.jboss.wsf.stack.cxf.InvokerJSE'/>

          </jaxws:invoker>

        </jaxws:endpoint>

       

      </beans>

       

       

      Web.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

            xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

            xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

            id="WebApp_ID" version="2.5">

       

            <display-name>SimpleService</display-name>

           

           

            <servlet>

                  <servlet-name>s1</servlet-name>

                  <servlet-class>com.oti.main.webservice.SimpleServlet</servlet-class>

            </servlet>

            <servlet-mapping>

                  <servlet-name>s1</servlet-name>

                  <url-pattern>/*</url-pattern>

            </servlet-mapping>

           

      </web-app>

       

       

        • 1. Re: : mapped-name is required for cxf of deployment auto-update-ws.war
          Alessio Soldano Master

          Hi,

          could you please create a jira issue for this attaching the deployment archive (or slimmed down version of it, but still reproducing the problem), so that we can better analyse? Also, the code of the endpoint(s) might help, this is somehow related to some field's injection, looks very similar to something solved in the past (https://jira.jboss.org/jira/browse/JBAS-5359).

          Thanks

          • 2. Re: : mapped-name is required for cxf of deployment auto-update-ws.war
            Philippe Griboval Newbie

            I add the same probleme today trying to use camel and cxf in JBoss 5.1

             

            I finally get in working excluding different artifact-id from my pom configuration

             

            <properties>
                    <cxf.version>2.2.6</cxf.version>
                </properties>

            <dependencies>
                    <dependency>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                        <version>4.4</version>
                        <scope>test</scope>
                    </dependency>
                    <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-beans</artifactId>
                        <version>2.5.6.SEC01</version>
                    </dependency>
                    <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-tx</artifactId>
                        <version>2.5.6.SEC01</version>
                    </dependency>
                    <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-jms</artifactId>
                        <version>2.5.6.SEC01</version>
                    </dependency>
                    <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-aop</artifactId>
                        <version>2.5.6.SEC01</version>
                        <exclusions>
                            <exclusion>
                                <artifactId>aopalliance</artifactId>
                                <groupId>aopalliance</groupId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                    <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-web</artifactId>
                        <version>2.5.6.SEC01</version>
                        <scope>runtime</scope>
                    </dependency>
                   
                    <dependency>
                        <groupId>org.apache.cxf</groupId>
                        <artifactId>cxf-rt-frontend-jaxws</artifactId>
                        <version>${cxf.version}</version>
                        <exclusions>
                            <exclusion>
                                <artifactId>jaxb-impl</artifactId>
                                <groupId>com.sun.xml.bind</groupId>
                            </exclusion>
                            <exclusion>
                                <artifactId>jaxb-api</artifactId>
                                <groupId>javax.xml.bind</groupId>
                            </exclusion>
                           
                           
                        </exclusions>
                       
                    </dependency>
                    <dependency>
                        <groupId>org.apache.cxf</groupId>
                        <artifactId>cxf-rt-frontend-jaxrs</artifactId>
                        <version>${cxf.version}</version>
                        <exclusions>
                            <exclusion>
                                <artifactId>xmlbeans</artifactId>
                                <groupId>org.apache.xmlbeans</groupId>
                            </exclusion>
                            <exclusion>
                                <artifactId>jaxb-api</artifactId>
                                <groupId>javax.xml.bind</groupId>
                            </exclusion>
                            <exclusion>
                                <artifactId>geronimo-stax-api_1.0_spec</artifactId>
                                <groupId>org.apache.geronimo.specs</groupId>
                            </exclusion>
                            <exclusion>
                                <artifactId>geronimo-annotation_1.0_spec</artifactId>
                                <groupId>org.apache.geronimo.specs</groupId>
                            </exclusion>
                            <exclusion>
                                <artifactId>jaxen</artifactId>
                                <groupId>jaxen</groupId>
                            </exclusion>
                            <exclusion>
                                <artifactId>wsdl4j</artifactId>
                                <groupId>wsdl4j</groupId>
                            </exclusion>
                        </exclusions>
                       
                    </dependency>
                    <dependency>
                        <groupId>org.apache.cxf</groupId>
                        <artifactId>cxf-rt-transports-http</artifactId>
                        <version>${cxf.version}</version>
                    </dependency>
                    
                    <dependency>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                        <version>1.1.1</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.camel</groupId>
                        <artifactId>camel-core</artifactId>
                        <version>2.1.0</version>
                        <exclusions>
                            <exclusion>
                                <artifactId>commons-logging-api</artifactId>
                                <groupId>commons-logging</groupId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.camel</groupId>
                        <artifactId>camel-spring</artifactId>
                        <version>2.1.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.camel</groupId>
                        <artifactId>camel-jms</artifactId>
                        <version>2.1.0</version>
                        <exclusions>
                            <exclusion>
                                <artifactId>geronimo-jms_1.1_spec</artifactId>
                                <groupId>org.apache.geronimo.specs</groupId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.camel</groupId>
                        <artifactId>camel-cxf</artifactId>
                        <version>2.1.0</version>
                        <exclusions>
                            <exclusion>
                                <artifactId>cxf-rt-transports-http-jetty</artifactId>
                                <groupId>org.apache.cxf</groupId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                </dependencies>

            There were pb with jetty, geronimo , jaxb hope this help

            • 3. Re: : mapped-name is required for cxf of deployment auto-update-ws.war
              Carlyle Davis Newbie
              I have ran into a similar issue today and with pretty much the exact stack trace.  Was there any head way on this issue?  Thanks alot guys.
              • 4. Re: : mapped-name is required for cxf of deployment auto-update-ws.war
                Not available Not available Newbie

                I had similar problem trying to deploy war-in-ear with webservices & (some of) apache CXF jars included in.

                Similar exception appeared. When I included annotations-api.jar in the war file and turned on classloading isolation, the exception dissapeared and everything worked perfectly.

                 

                I suspect (not sure) that CXF has it's own mechanism of resource injection which uses @javax.annotation.Resource annotation, and all  properties annotated with @Resource aren't supposed to be injected by JBoss in deploytime, but exactly that happens.

                 

                If annotations-api.jar is present, and classloading isolation is on - then jboss will not detect @Resource annotations in cxf and will not try to inject them (because Resource.class from annotations-api.jar will overwrite Resource.class from jboss in CXF's classloader, and for JVM point of view, CXF's @Resource annotation will be different than jboss'es @Resource annotations).

                • 5. Re: : mapped-name is required for cxf of deployment auto-update-ws.war
                  Pierre Demyan Newbie

                  I get the same error with CXF 2.2.9 and JBoss 6.0.0.M4.

                   

                  The problem occurred with the following directory structure:

                  test.war

                       WEB-INF

                            lib

                                 cxf-2.2.9.jar

                   

                  So just adding the CXF library to an empty war is enough to reproduce the problem.

                   

                  I am afraid that class isolation solution may affect any other annotations that we may need JBoss to recognize in the war directory.  I think this is a bug that should be fixed in JBoss.

                  • 6. Re: : mapped-name is required for cxf of deployment auto-update-ws.war
                    Alessio Soldano Master

                    JBossAS 6.0.0.M4 comes with JBossWS-CXF stack installed. That means CXF libraries are already available and used on the server.

                    Generally speaking you don't need (and shouldn't) embedd cxf libraries anymore in your applications.

                    • 7. Re: : mapped-name is required for cxf of deployment auto-update-ws.war
                      Philippe Griboval Newbie

                      I tried today to upgrade my web service project from cxf 2.2.6 to 2.3.2 and I come up with the mapped-name is required for cxf....

                      I finally got it work adding geronimo-annotation_1.0_spec:

                      Here is my pom's dependencies for sharing :

                       

                      <dependency>

                             <groupId>org.apache.cxf</groupId>

                             <artifactId>cxf-rt-frontend-jaxws</artifactId>

                              <version>2.3.2</version>

                           </dependency>

                           <dependency>

                             <groupId>org.apache.cxf</groupId>

                             <artifactId>cxf-rt-transports-http</artifactId>

                             <version>2.3.2</version>

                           </dependency>

                          <dependency>

                             <groupId>org.apache.geronimo.specs</groupId>

                              <artifactId>geronimo-annotation_1.0_spec</artifactId>

                            <version>1.1.1</version>

                          </dependency>

                      • 8. Re: : mapped-name is required for cxf of deployment auto-update-ws.war
                        Martin Greber Newbie

                        Had the exact same issue as Mr User. Philippe's solution solved it for me. Cheers!

                        • 9. Re: : mapped-name is required for cxf of deployment auto-update-ws.war
                          Nicholas DiPiazza Novice

                          I'm experiencing this same issue, on JBoss 5.1.0.EAP

                           

                          Adding geronimo-annotation_1.0_spec doesn't seem like a very safe solution. i'd prefer to get the *real* solution.

                           

                          Anyone know what the true cause of this is? I know AS 5.1.0.EAP doesn't have CXF libraries pre-bundled. Any ideas?

                          • 10. Re: : mapped-name is required for cxf of deployment auto-update-ws.war
                            Nicholas DiPiazza Novice

                            Confirmed with Redhat this is a JBoss 5 bug. There is a fix available on a later EAP version.