Null Point Exception for Java Frist approach without @WebParam annotation when 
try to start server
--------------------------------------------------------------------------------------------------

                 Key: CXF-656
                 URL: https://issues.apache.org/jira/browse/CXF-656
             Project: CXF
          Issue Type: Bug
            Reporter: Johnson Ma


Kit: cxf-distribution-2.0-incubator-20070514.151813-7.tar.gz
--------------------------------------------Java Class 
---------------------------------------------------
package com.iona;

import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;


@SOAPBinding(style=SOAPBinding.Style.RPC, use=SOAPBinding.Use.LITERAL)
@WebService(name="Hello", targetNamespace="http://iona.com/";)

public interface Hello {
        @WebMethod(operationName="sayHi", exclude=false)
        public String sayHi(String value);
}
--------------------------------------------- wsdl 
---------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="HelloService" targetNamespace="http://iona.com/"; 
xmlns:ns1="http://iona.com/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
  <wsdl:message name="sayHi">
    <wsdl:part name="arg0" type="xsd:string">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="sayHiResponse">
    <wsdl:part name="return" type="xsd:string">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="Hello">
    <wsdl:operation name="sayHi">
      <wsdl:input name="sayHi" message="ns1:sayHi">
    </wsdl:input>
      <wsdl:output name="sayHiResponse" message="ns1:sayHiResponse">
    </wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="HelloServiceSoapBinding" type="ns1:Hello">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="sayHi">
      <soap:operation soapAction="" style="rpc"/>
      <wsdl:input name="sayHi">
        <soap:body use="literal" namespace="http://iona.com/"/>
      </wsdl:input>
      <wsdl:output name="sayHiResponse">
        <soap:body use="literal" namespace="http://iona.com/"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="HelloService">
    <wsdl:port name="HelloPort" binding="ns1:HelloServiceSoapBinding">
      <soap:address location="http://localhost:9090/hello"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

----------------------------------------------------Error stack 
-----------------------------------
Exception in thread "main" java.lang.NullPointerException
        at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeParameter(ReflectionServiceFactoryBean.java:771)
        at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeParameter(JaxWsServiceFactoryBean.java:370)
        at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeClassInfo(JaxWsServiceFactoryBean.java:349)
        at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation(JaxWsServiceFactoryBean.java:180)
        at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:303)
        at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:189)
        at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:195)
        at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:246)
        at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:136)
        at 
org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:82)
        at 
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:84)

-------------------------------- The Reason 
-------------------------------------------
JaxWsServiceConfiguation.java line 242:
private String getDefaultLocalName(OperationInfo op, Method method, int 
paramNumber, 
                                       int curSize, String prefix) {
        String paramName = null;        
        if (paramNumber != -1) {
            paramName = prefix + curSize;
        } else {
            paramName = prefix;
        }
        return paramName;
    }

should be changed from "paramName = prefix + curSize;" to 
"paramName = prefix + paramNumber;"?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to