Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-1386

java2wsdl: NullPointerException on @WebService interface throwing custom Exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.3
    • 2.0.5
    • Tooling
    • None
    • Windows XP, jdk1.5.0_11 and jdk1.6.0_01

    Description

      java2wsdl throw an NullPointerException when generating for WSDL for this simple service interface

      – Service.java –
      import javax.jws.WebService;
      @WebService()
      public interface Service
      {
      void operation() throws ServiceException;
      }

      – ServiceException.java –
      import javax.xml.ws.WebFault;
      @WebFault(name="ServiceFault")
      public class ServiceException extends Exception
      {
      private static final long serialVersionUID = 4857896282591349073L;

      public ServiceException(String message)

      { super(message); }

      public ServiceException(String message, Throwable cause)

      { super(message, cause); }

      }

      – command log –
      java2wsdl -verbose Service
      java2wsdl - Apache CXF (incubator) 2.0.3-incubator

      07-janv.-2008 13:57:43 org.apache.cxf.tools.java2wsdl.processor.JavaToProcessor process
      INFO: Classpath before Java2Wsdl: [...]
      07-janv.-2008 13:57:43 org.springframework.context.support.AbstractApplicationContext prepareRefresh
      INFO: Refreshing org.apache.cxf.bus.spring.BusApplicationContext@1542a75: display name [org.apache.cxf.bus.spring.BusApplicationContext@1542a75]; startup date [Mon Jan 07 13:57:43 CET 2008]; root of context hierarchy
      07-janv.-2008 13:57:43 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml]
      07-janv.-2008 13:57:43 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-soap.xml]
      07-janv.-2008 13:57:43 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-management.xml]
      07-janv.-2008 13:57:43 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-rm.xml]
      07-janv.-2008 13:57:44 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-addr.xml]
      07-janv.-2008 13:57:44 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-http-binding.xml]
      07-janv.-2008 13:57:44 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-jms.xml]
      07-janv.-2008 13:57:44 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-jaxws.xml]
      07-janv.-2008 13:57:44 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-local.xml]
      07-janv.-2008 13:57:44 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-http-jetty.xml]
      07-janv.-2008 13:57:44 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-http.xml]
      07-janv.-2008 13:57:44 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-object-binding.xml]
      07-janv.-2008 13:57:44 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-http.xml]
      07-janv.-2008 13:57:44 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition
      INFO: Overriding bean definition for bean 'org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory': replacing [Root bean: class [org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory]; scope=singleton; abstract=false; lazyInit=true; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [META-INF/cxf/cxf-extension-http.xml]] with [Root bean: class [org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory]; scope=singleton; abstract=false; lazyInit=true; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [META-INF/cxf/cxf-extension-http.xml]]
      07-janv.-2008 13:57:44 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-policy.xml]
      07-janv.-2008 13:57:44 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-xml.xml]
      07-janv.-2008 13:57:44 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
      INFO: Bean factory for application context [org.apache.cxf.bus.spring.BusApplicationContext@1542a75]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1fbfd6
      07-janv.-2008 13:57:44 org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization
      INFO: Bean 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
      07-janv.-2008 13:57:44 org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization
      INFO: Bean 'org.apache.cxf.bus.spring.BusExtensionPostProcessor' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
      07-janv.-2008 13:57:44 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
      INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1fbfd6: defining beans cxf,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.management.jmx.InstrumentationManagerImpl,org.apache.cxf.ws.rm.RMManager,org.apache.cxf.ws.rm.policy.RMPolicyInterceptorProvider,org.apache.cxf.ws.rm.RMAssertionBuilder,org.apache.cxf.ws.addressing.policy.AddressingAssertionBuilder,org.apache.cxf.ws.addressing.policy.AddressingPolicyInterceptorProvider,org.apache.cxf.ws.addressing.policy.UsingAddressingAssertionBuilder,org.apache.cxf.binding.http.HttpBindingFactory,org.apache.cxf.transport.jms.JMSTransportFactory,org.apache.cxf.jaxws.context.WebServiceContextResourceResolver,org.apache.cxf.transport.local.LocalTransportFactory,org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder,org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory,org.apache.cxf.binding.object.ObjectBindingFactory,org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder#1,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder#1,org.apache.cxf.ws.policy.AssertionBuilderRegistry,org.apache.cxf.ws.policy.PolicyConstants,org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistry,org.apache.cxf.ws.policy.attachment.external.DomainExpressionBuilderRegistry,org.apache.cxf.ws.policy.attachment.external.EndpointReferenceDomainExpressionBuilder,org.apache.cxf.ws.policy.PolicyBuilder,org.apache.cxf.ws.policy.PolicyEngine,org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11AttachmentPolicyProvider,org.apache.cxf.ws.policy.attachment.ServiceModelPolicyProvider,org.apache.cxf.ws.policy.mtom.MTOMAssertionBuilder,org.apache.cxf.ws.policy.mtom.MTOMPolicyInterceptorProvider,org.apache.cxf.binding.xml.XMLBindingFactory; root of factory hierarchy
      07-janv.-2008 13:57:44 org.apache.cxf.configuration.spring.ConfigurerImpl <init>
      INFO: Could not find the configuration file cxf.xml on the classpath.
      07-janv.-2008 13:57:44 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
      INFO: Creating Service

      {http://unknown.namespace/}

      ServiceService from class Service
      07-janv.-2008 13:57:44 org.apache.cxf.service.factory.ReflectionServiceFactoryBean fillInSchemaCrossreferences
      GRAVE: Schema element

      {http://unknown.namespace/}

      ServiceFault references undefined type

      {http://unknown.namespace/}

      ServiceFault for service

      {http://unknown.namespace/}

      ServiceService.
      07-janv.-2008 13:57:45 org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.Wrapper isWrapperBeanClassNotExist
      INFO: Trying to load wrapper class defaultnamespace.jaxws.Operation
      07-janv.-2008 13:57:45 org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.Wrapper getWrapperClass
      ATTENTION: Can not load wrapper class defaultnamespace.jaxws.Operation, please check the @RequestWrapper or @ResponseWrapper and also check the class is in your classpath
      07-janv.-2008 13:57:45 org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.Wrapper isWrapperBeanClassNotExist
      INFO: Trying to load wrapper class defaultnamespace.jaxws.OperationResponse
      07-janv.-2008 13:57:45 org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.Wrapper getWrapperClass
      ATTENTION: Can not load wrapper class defaultnamespace.jaxws.OperationResponse, please check the @RequestWrapper or @ResponseWrapper and also check the class is in your classpath
      Error: null

      java.lang.NullPointerException
      at org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.FaultBean.transform(FaultBean.java:64)
      at org.apache.cxf.tools.java2wsdl.generator.wsdl11.FaultBeanGenerator.generateBeanClasses(FaultBeanGenerator.java:60)
      at org.apache.cxf.tools.java2wsdl.generator.wsdl11.BeanGenerator.generate(BeanGenerator.java:54)
      at org.apache.cxf.tools.java2wsdl.generator.wsdl11.BeanGenerator.generate(BeanGenerator.java:34)
      at org.apache.cxf.tools.java2wsdl.processor.JavaToProcessor.generate(JavaToProcessor.java:134)
      at org.apache.cxf.tools.java2wsdl.processor.JavaToProcessor.process(JavaToProcessor.java:101)
      at org.apache.cxf.tools.java2wsdl.JavaToWSDLContainer.execute(JavaToWSDLContainer.java:58)
      at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
      at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:52)
      at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:39)
      at org.apache.cxf.tools.java2wsdl.JavaToWSDL.run(JavaToWSDL.java:74)
      at org.apache.cxf.tools.java2wsdl.JavaToWSDL.main(JavaToWSDL.java:42)
      JavaToWSDL Error : null

      org.apache.cxf.tools.common.ToolException
      at org.apache.cxf.tools.java2wsdl.JavaToWSDLContainer.execute(JavaToWSDLContainer.java:75)
      at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
      at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:52)
      at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:39)
      at org.apache.cxf.tools.java2wsdl.JavaToWSDL.run(JavaToWSDL.java:74)
      at org.apache.cxf.tools.java2wsdl.JavaToWSDL.main(JavaToWSDL.java:42)

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            pbuyle Pierre Buyle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: