1 Reply Latest reply on May 22, 2006 11:22 AM by Philipp Taprogge

    Dublicate operation with name?

    Philipp Taprogge Newbie

      Hi!

      Sorry to bother you, this just _has_ to be some stupid mistake I am not seenig...

      I am trying to get the hang on that Calculator webservice example.
      I am trying to deploy the service in jboss-4.0.4-CR2 like this:

      package my.package;
      
      import javax.jws.WebService;
      import javax.jws.WebMethod;
      import java.rmi.Remote;
      import java.rmi.RemoteException;
      import javax.jws.soap.SOAPBinding;
      import javax.jws.soap.SOAPBinding.Style;
      
      @WebService
      @SOAPBinding(style=Style.RPC)
      public interface Calculator extends Remote
      {
       @WebMethod int add(int x, int y);
      
       @WebMethod int subtract(int x, int y);
      }
      


      and

      package my.package;
      
      import javax.ejb.Stateless;
      import javax.jws.WebService;
      import javax.jws.soap.SOAPBinding;
      import javax.jws.soap.SOAPBinding.Style;
      
      @Stateless
      @WebService(endpointInterface="my.package.Calculator")
      public class CalculatorBean
      {
       public int add(int x, int y)
       {
       return x + y;
       }
      
       public int subtract(int x, int y)
       {
       return x - y;
       }
      }
      


      When I try to deploy it, JBoss complains:

      17:01:10,410 ERROR [MainDeployer] Could not create deployment: file:/usr/local/jboss-4.0.4.CR2/server/default/tmp/deploy/tmp12090maxchoice-online-proto.ear-contents/maxchoice-online-proto.jar
      java.lang.IllegalArgumentException: Duplicate operation with name=add, found in portType '{http://proto.maxchoice.mwx.de/jaws}ScheckWebserviceBinding'.
       at com.ibm.wsdl.BindingImpl.getBindingOperation(BindingImpl.java:224)
       at org.jboss.ws.metadata.wsdl.WSDL11Reader.messagePartToElementName(WSDL11Reader.java:652)
       at org.jboss.ws.metadata.wsdl.WSDL11Reader.processOperationInput(WSDL11Reader.java:487)
       at org.jboss.ws.metadata.wsdl.WSDL11Reader.processPortTypeOperations(WSDL11Reader.java:460)
       at org.jboss.ws.metadata.wsdl.WSDL11Reader.processPortType(WSDL11Reader.java:446)
       at org.jboss.ws.metadata.wsdl.WSDL11Reader.processBinding(WSDL11Reader.java:725)
       at org.jboss.ws.metadata.wsdl.WSDL11Reader.processPort(WSDL11Reader.java:1067)
       at org.jboss.ws.metadata.wsdl.WSDL11Reader.processPorts(WSDL11Reader.java:1051)
       at org.jboss.ws.metadata.wsdl.WSDL11Reader.processServices(WSDL11Reader.java:1024)
       at org.jboss.ws.metadata.wsdl.WSDL11Reader.processDefinition(WSDL11Reader.java:119)
       at org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:145)
       at org.jboss.ws.metadata.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:253)
       at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.setupEndpointFromAnnotations(AnnotationsMetaDataBuilder.java:176)
       at org.jboss.ws.metadata.AnnotationsMetaDataBuilderEJB3.buildMetaData(AnnotationsMetaDataBuilderEJB3.java:93)
       at org.jboss.ws.server.WebServiceDeployerEJB3.createWebServicesMetaData(WebServiceDeployerEJB3.java:92)
       at org.jboss.ws.server.WebServiceDeployer.create(WebServiceDeployer.java:103)
       at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
       at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
       at $Proxy33.create(Unknown Source)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:943)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
       at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
       at $Proxy6.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:334)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:504)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:207)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:218)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:197)
      
      


      The odd thing is that when I completely remove the "add" method from both the Interface as well as the Bean, the error stays the same...?!

      Any insights would be highly appreciated.

      Phil