I have this code working in my development environment, but when I employ to
our test environment I'm getting a null pointer.  I'm not sure why this is
happening.  Can someone give me any pointers?  I'm really desperate to find
a solution.

java.lang.NullPointerException
        at
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:81)
        at
org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:112)
        at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:104)
        at
org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:55)
        at javax.xml.ws.Service.<init>(Service.java:57)
        at com.mysite.services.news.NewsService.<init>(NewsService.java:41)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

>From code:

@WebServiceClient(name = "NewsService", targetNamespace =
"http://services.mysite.com/News";, wsdlLocation =
"http://mysite.com/services/NewsService.svc?wsdl";)
public class NewsService extends Service {

    private final static URL WSDL_LOCATION;
    private final static QName SERVICE = new
QName("http://services.mysite.com/News";, "NewsService");
    private final static QName BasicHttpBinding = new
QName("http://services.mysite.com/News";, "basicHttpBinding");
    static {
        URL url = null;
        try {
            url = new
URL("http://mysite.com/services/NewsService.svc?wsdl";);
        } catch (MalformedURLException e) {
            System.err.println("Can not initialize the default wsdl from
http://mysite.com/services/NewsService.svc?wsdl";);
            // e.printStackTrace();
        }
        WSDL_LOCATION = url;
    }

    public NewsService(URL wsdlLocation, QName serviceName) {
        super(wsdlLocation, serviceName);
    }

    public NewsService() {
        super(WSDL_LOCATION, SERVICE);
    }

    /**
     * 
     * @return
     *     returns BasicHttpBinding
     */
    @WebEndpoint(name = "basicHttpBinding")
    public NewsServiceContract getBasicHttpBinding() {
        return (NewsServiceContract)super.getPort(BasicHttpBinding,
NewsServiceContract.class);
    }


-- 
View this message in context: 
http://www.nabble.com/Null-Pointer-in-WSDLServiceFactory-tf4357565.html#a12418426
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to