2 Replies Latest reply on Jun 18, 2012 3:48 AM by sergiu_pienar

    Incorrect web-services deployment

    sergiu_pienar

      Hi,

       

      Using JBoss 7.1.1 Final.

       

      I have a class with the following annotations :

       

      @Stateless
      @RemoteBinding(jndiBinding = "java:global/all-dev/all-ejbs/MyBean!com.beans.MyBeanRemote")
      @LocalBinding(jndiBinding = "java:app/all-ejbs/MyBean!com.beans.MyBeanLocal")
      @TransactionAttribute(TransactionAttributeType.REQUIRED)
      @Local({ MyBeanLocal.class })
      @Remote({ MyBeanRemote.class })
      @WebService(name = "MyService", serviceName = "MyService")
      @WebContext(contextRoot = "/service", urlPattern = "/MyService", secureWSDLAccess = false, authMethod = "BASIC", transportGuarantee = "NONE")
      @SecurityDomain(value = "Database")
      @EndpointConfig(configName = "Standard WSSecurity Endpoint")
      public class MyBean
      extends MyOtherBean {
      ...............................
      
      @EjbInterface(type = EjbInterface.Type.BOTH)
                @TransactionAttribute(TransactionAttributeType.REQUIRED)
                @RolesAllowed({ "WEB_ROLE" })
                @WebMethod
                public Long upload(@WebParam(name = "name") final String name,
                          @WebParam(name = "description") final String description, @WebParam(name = "mimeType") final String mimeType,
                          @WebParam(name = "uploadDate") final long uploadDate, @WebParam(name = "data") final byte[] data)
                throws Exception {
      
      ......................
      }
      
      ............................
      }
      

      This is the only method that I'm annotating with @WebMethod, the rest of the method are not meant to be exposed via WebServices.

       

      However, on JBoss startup I get :

       

       

      05:54:05,342 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-14) MSC00001: Failed to start service jboss.deployment.subunit."all.ear"."all-ejbs.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."all.ear"."all-ejbs.jar".INSTALL: Failed to process phase INSTALL of subdeployment "all-ejbs.jar" of deployment "all.ear"
              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_25-ea]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_25-ea]
              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_25-ea]
      Caused by: javax.xml.ws.WebServiceException: java.lang.IllegalArgumentException: An operation with name [{http://count.myBean.com/}counterQuery] already exists in this service
              at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:350)
              at org.jboss.wsf.stack.cxf.deployment.EndpointImpl.doPublish(EndpointImpl.java:88)
              at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:239)
              at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:509)
              at org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder.configure(NonSpringBusHolder.java:117)
              at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.startDeploymentBus(BusDeploymentAspect.java:113)
              at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:66)
              at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:74)
              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
              ... 5 more
      Caused by: java.lang.IllegalArgumentException: An operation with name [{http://count.myBean.com/}counterQuery] already exists in this service
              at org.apache.cxf.service.model.InterfaceInfo.addOperation(InterfaceInfo.java:71)
              at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createOperation(ReflectionServiceFactoryBean.java:917)
              at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.createOperation(JaxWsServiceFactoryBean.java:621)
              at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createInterface(ReflectionServiceFactoryBean.java:909)
              at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:435)
              at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:685)
              at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:507)
              at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:241)
              at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:205)
              at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:101)
              at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:157)
              at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:203)
              at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:433)
              at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:322)
              ... 13 more
      

       

      As far as I see things, JBoss is trying to expose all the methods as web services when it should only expose the method annotated with @WebMethod.

       

      Any help is appreciated.

       

      Thank you.