4 Replies Latest reply on Apr 10, 2006 7:35 PM by Jason Greene

    Annotated WebService problem

    Aviran Levy Newbie

      Hi,

      I'm trying to deploy the following simple web service:

      @WebService(name = "EndpointInterface",
      targetNamespace = "http://localhost",
      serviceName = "HelloService")
      @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE,
      style = SOAPBinding.Style.DOCUMENT)
      @Remote({HelloService.class})
      @Stateless
      public class HelloServiceEJB implements HelloService {

      private String hello = "Hello World";

      @WebMethod
      public String sayHello() {
      return hello;
      }

      @WebMethod
      public void setHello(Stringtype hello1) {
      this.hello = hello1.value;
      }
      }

      Stringtype is a simple String wrapper class.

      when I try to deploy this on JBoss 4.0.4RC2 I get a null pointer exception. Any idea why?

      When I change the parameterStyle from BARE to WRAPPED I'm able to deploy it, but then, when I try to generate a client using Visual Studio 2005, it doesn't recognizes the parametes correctly.

      Thanks a lot for any help.

      -- AV

        • 1. Re: Annotated WebService problem
          Heiko Braun Novice

          Can you supply the stacktrace?

          • 2. Re: Annotated WebService problem
            Aviran Levy Newbie

            Sure, here it is:


            16:08:14,975 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=ImportServiceEJB, class=net.mycompany.ImportServiceEJB, type=STATELESS
            16:08:15,005 INFO [Ejb3Deployment] EJB3 deployment time took: 150
            16:08:15,055 ERROR [MainDeployer] Could not create deployment: file:/C:/jboss-4.0.4.RC2/server/default/deploy/ImportService.jar/
            java.lang.NullPointerException
             at org.jboss.ws.metadata.wsdl.xmlschema.WSSchemaUtils.write(WSSchemaUtils.java:429)
             at org.jboss.ws.metadata.wsdl.xmlschema.JBossXSNamespaceItem.toString(JBossXSNamespaceItem.java:377)
             at org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel.serializeNamespaceItems(JBossXSModel.java:535)
             at org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel.serialize(JBossXSModel.java:432)
             at org.jboss.ws.metadata.wsdl.WSDLWriter.appendTypes(WSDLWriter.java:113)
             at org.jboss.ws.metadata.wsdl.WSDL11Writer.write(WSDL11Writer.java:94)
             at org.jboss.ws.metadata.wsdl.WSDLDefinitions.write(WSDLDefinitions.java:304)
             at org.jboss.ws.tools.JavaToWSDL.generate(JavaToWSDL.java:320)
             at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.processOrGenerateWSDL(AnnotationsMetaDataBuilder.java:223)
             at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.setupEndpointFromAnnotations(AnnotationsMetaDataBuilder.java:171)
             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:101)
             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 $Proxy29.create(Unknown Source)
             at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
             at sun.reflect.GeneratedMethodAccessor54.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 $Proxy8.deploy(Unknown Source)
             at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:334)
             at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:522)
             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)
            


            Thanks,

            -- AV

            • 4. Re: Annotated WebService problem
              Jason Greene Master

              It is illegal for a bare service to have a void return value and the method not be tagged with @Oneway. However, it should be throwing a propper exception telling you this.

              -Jason