0 Replies Latest reply on Aug 14, 2015 5:14 AM by Macle Zhou

    JBoss Deployment issue for CXF+Spring WebService

    Macle Zhou Newbie

      Hi, any one can help me? I encounter a issue to publish a WS(CXF+Spring), env as below:

       

      Part A, environment information

           1. Eclipse Luna R2 - v4.4.2

           2. Jdk1.6.0.20(with jbossws-native-jaxrpc.jar/jbossws-native-jaxws.jar/jbossws-native-jaxws-ext.jar and jbossws-native-saaj.jar under lib/endoresed for both jdk1.6.0.20 and jre1.6)

           3. jboss-6.1.0.Final

       

      Part B, Application information

       

      1. Service interface Underwriting

      package com.aia.nuwc.services;

      import javax.jws.WebService;

      import java.util.List;

      import org.json.JSONObject;

      @WebService

      public interface Underwriting {

        String underwriting(String policynumber, List<JSONObject> objJSONList) throws Exception;

      }

       

      2. Service implementor

      package com.aia.nuwc.services.impl;

      import java.util.List;

      import javax.jws.WebService;

      import org.json.JSONArray;

      import org.json.JSONObject;

      import org.springframework.stereotype.Component;

      import com.aia.nuwc.services.Underwriting;

       

      @WebService

      @Component

      public class UnderwritingImpl {

        public String underwriting(String policynumber, List<JSONObject> objJSONList) throws Exception

        {

        ...

        }

      }

       

      3. with below jars under WEB-INF/lib folder

          1) cxf-rt-frontend-jaxws-3.0.0.jar

          2) cxf-rt-transports-http-3.0.0.jar

          3) geronimo-jaxws_2.2_spec-1.2.jar

          4) spring-context-4.0.5.RELEASE.jar

          5) spring-web-4.0.5.RELEASE.jar

       

      4. Configuration xml files under WEB-INF

          1) web.xml

      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">

        <display-name>UWC_WEB</display-name>

        <welcome-file-list>

          <welcome-file>index.html</welcome-file>

        </welcome-file-list>

       

        <!-- Spring framework configuration -->

        <context-param>

          <param-name>contextConfigLocation</param-name>

          <param-value>WEB-INF/spring.xml</param-value>

        </context-param>

        <listener>

          <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

        </listener>

       

        <!-- Apache CXF WS configuration -->

        <servlet>

          <servlet-name>cxf</servlet-name>

          <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>

          <load-on-startup>1</load-on-startup>

        </servlet>

        <servlet-mapping>

          <servlet-name>cxf</servlet-name>

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

        </servlet-mapping>

      </web-app>

       

      2) spring.xml

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

      <beans xmlns="http://www.springframework.org/schema/beans"

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

             xmlns:context="http://www.springframework.org/schema/context"

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

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

             http://www.springframework.org/schema/context

             http://www.springframework.org/schema/context/spring-context-4.0.xsd">

        <context:component-scan base-package="com.aia.nuwc.services"/>

        <import resource="WEB-INF/spring-cxf.xml"/>

      </beans>

       

      3) spring-cxf.xml

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

      <beans xmlns="http://www.springframework.org/schema/beans"

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

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

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

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

             http://cxf.apache.org/jaxws

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

        <jaxws:endpoint id="underwriting" implementor="com.aia.nuwc.services.impl.UnderwritingImpl" address="/underwriting"/>

      </beans>

       

      4) jboss-web.xml

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

      <jboss-web>

          <context-root>UWC</context-root>

      </jboss-web>

       

      Part C, exception when start JBoss server in Eclipse

       

      17:10:59,407 INFO  [service] Removing bootstrap log handlers

      17:10:59,489 INFO  [org.apache.coyote.http11.Http11Protocol] Starting Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080

      17:10:59,492 INFO  [org.apache.coyote.ajp.AjpProtocol] Starting Coyote AJP/1.3 on ajp-localhost%2F127.0.0.1-8009

      17:10:59,493 INFO  [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.1.0.Final "Neo"] Started in 24s:336ms

      17:11:06,961 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Real: name=vfs:///R:/PerLifeUWC_Workspace/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_AS_6.x1439534520455/deploy/UWC_EAR.ear state=PreReal mode=Manual requiredState=Real: org.jboss.deployers.spi.DeploymentException: Error during deploy: vfs:///R:/PerLifeUWC_Workspace/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_AS_6.x1439534520455/deploy/UWC_EAR.ear/UWC_WEB.war/

        at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) [:2.2.2.GA]

        at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:185) [:2.2.2.GA]

        at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.2.GA]

        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.2.GA]

        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1603) [:2.2.2.GA]

        at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.2.GA]

        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.2.GA]

        at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.2.GA]

        at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.2.GA]

        at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.1.0.Final]

        at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]

        at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:151) [:0.2.2]

        at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2]

        at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.SP2]

        at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.SP2]

        at org.jboss.profileservice.dependency.ProfileActivationWrapper$BasicProfileActivation.start(ProfileActivationWrapper.java:190) [:0.2.2]

        at org.jboss.profileservice.dependency.ProfileActivationWrapper.start(ProfileActivationWrapper.java:87) [:0.2.2]

        at org.jboss.profileservice.dependency.ProfileActivationService.activateProfile(ProfileActivationService.java:215) [:0.2.2]

        at org.jboss.profileservice.dependency.ProfileActivationService.activate(ProfileActivationService.java:159) [:0.2.2]

        at org.jboss.profileservice.AbstractProfileService.activateProfile(AbstractProfileService.java:154) [:0.2.2]

        at org.jboss.system.tools.ProfileServiceToolsFacade.addURI(ProfileServiceToolsFacade.java:233) [:6.1.0.Final]

        at org.jboss.system.tools.LegacyDeploymentScannerAdapter.addURL(LegacyDeploymentScannerAdapter.java:140) [:6.1.0.Final]

        at org.jboss.system.tools.DeploymentScanner.addURL(DeploymentScanner.java:91) [:6.1.0.Final]

        at org.jboss.system.tools.DeploymentScanner.addURL(DeploymentScanner.java:83) [:6.1.0.Final]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_20]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_20]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_20]

        at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_20]

        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) [:6.0.0.GA]

        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) [:6.0.0.GA]

        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) [:6.0.0.GA]

        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271) [:6.0.0.GA]

        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670) [:6.0.0.GA]

        at org.jboss.system.server.jmx.MBeanServerWrapper.invoke(MBeanServerWrapper.java:138) [:6.1.0.Final]

        at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427) [:1.6.0_20]

        at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72) [:1.6.0_20]

        at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265) [:1.6.0_20]

        at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360) [:1.6.0_20]

        at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788) [:1.6.0_20]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_20]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_20]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_20]

        at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_20]

        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305) [:1.6.0_20]

        at sun.rmi.transport.Transport$1.run(Transport.java:159) [:1.6.0_20]

        at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_20]

        at sun.rmi.transport.Transport.serviceCall(Transport.java:155) [:1.6.0_20]

        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535) [:1.6.0_20]

        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790) [:1.6.0_20]

        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649) [:1.6.0_20]

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_20]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_20]

        at java.lang.Thread.run(Thread.java:619) [:1.6.0_20]

      Caused by: java.lang.RuntimeException: Neither any mapped-name/lookup/jndi-name specified nor any ResourceProvider could process resource-env-ref named env/org.apache.cxf.jaxws.context.WebServiceContextResourceResolver/bus of type org.apache.cxf.Bus

        at org.jboss.switchboard.mc.resource.provider.ResourceEnvRefProvider.provide(ResourceEnvRefProvider.java:119) [:1.0.0-alpha-15]

        at org.jboss.switchboard.mc.resource.provider.ResourceEnvRefProvider.provide(ResourceEnvRefProvider.java:43) [:1.0.0-alpha-15]

        at org.jboss.switchboard.mc.JndiEnvironmentProcessor.process(JndiEnvironmentProcessor.java:68) [:1.0.0-alpha-15]

        at org.jboss.switchboard.mc.deployer.AbstractSwitchBoardDeployer.process(AbstractSwitchBoardDeployer.java:119) [:1.0.0-alpha-15]

        at org.jboss.switchboard.mc.deployer.WebEnvironmentSwitchBoardDeployer.internalDeploy(WebEnvironmentSwitchBoardDeployer.java:66) [:1.0.0-alpha-15]

        at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.2.GA]

        at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.2.GA]

        ... 70 more