Hi,
With cxf 2.4.2 and 2.4.3, I catch the following exception :
2011-10-28 13:06:34,830 INFO [ReflectionServiceFactoryBean] Creating
Service {http://www.onvif.org/ver10/device/wsdl}DeviceService from WSDL:
jar:file:/home/terelle/onvif/onvif-srv-0.1-jar-with-dependencies.jar!/META-INF/wsdl/devicemgmt.wsdl
Exception in thread "main" javax.xml.ws.WebServiceException:
java.lang.NullPointerException
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:350)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:239)
at eu.acic.onvif.NVTServer.<init>(NVTServer.java:81)
at eu.acic.onvif.NVTServer.main(NVTServer.java:127)
Caused by: java.lang.NullPointerException
at
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:92)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:369)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:505)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:241)
at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:202)
at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:101)
at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:157)
at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:202)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:433)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:322)
I'm catching this exception when I do the following instruction:
DevicePortTypeImpl deviceImplementor = new DevicePortTypeImpl();
String serviceAddress = "http://0.0.0.0:8080/onvif/device_service";
EndpointImpl epDevice = (EndpointImpl) Endpoint.create(serviceAddress,
deviceImplementor);
epDevice.publish(serviceAddress);
OR with
DevicePortTypeImpl deviceImplementor = new DevicePortTypeImpl();
String serviceAddress = "http://0.0.0.0:8080/onvif/device_service";
EndpointImpl epDevice = (EndpointImpl) Endpoint.publish(serviceAddress,
deviceImplementor);
The Java code was generated from a WSDL with cxf-codegen-plugin
(wsdl2java) and I just changed the wsdlLocation annotation in the
"DevicePortTypeImpl" class.
My big problem is that it was always working under Eclipse, and now that
I have to deploy a standalone JAR (built with mvn assembly:single
instruction), it doesn't work...
Even worst, I can put what I want as path in the wsdlLocation
annotation, it's always working under Eclipse... And I can't deploy
Eclipse on my customer system :)
For information, I use Jetty, nothing with JBoss, Glassfish and so on.
It's a standalone application (the server was also generated with
wsdl2java).
Help!!!
Regards,
Hugo Terelle