cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: JAX-WS Endpoint.publish throws NPE
Date Fri, 28 Mar 2008 17:40:57 GMT

Well, while not "expected" or "ideal", I'm not completely surprised 
either.  This isn't exactly a "normal" or well tested usecase.   There 
are a lot of things in the spec that force us to use the package name to 
map to various things like namespaces and such.   Thus, if the package 
name isn't there, I'm not really sure what it's supposed to do.  NPE is 
definitely not correct, but I'm not sure what is.  I'll need to research 
more.

Dan



On Friday 28 March 2008, Philipp Leitner wrote:
> Hi list,
>
>
> I have tried to create simple CXF test service using JAX-WS
> annotations, and start it using Endpoint.publish:
>
> import javax.jws.WebMethod;
> import javax.jws.WebService;
> import javax.xml.ws.Endpoint;
>
> @WebService
> public class TestService {
>
> 	@WebMethod
> 	public String helloWorld() {
> 		return "Hello World!";
> 	}
>
> 	public static void main(String[] args) {
> 		Endpoint.publish("http://localhost/test",
> 			new TestService());
> 	}
> }
>
> However, if this test class resides in the default package (i.e., no
> explicit package declaration) then Endpoint.publish throws a NPE.
> Everything works as expected if I move TestService to e.g.,
> test.TestService.
>
> Is this a known bug (didn't find a bug entry for it) or even the
> expected behavior, or should I file a bug with JIRA?
>
> Here's the exception trace I get:
>
> <snip>
> INFO: Bean 'org.apache.cxf.bus.spring.BusExtensionPostProcessor' is
> not eligible for getting processed by all BeanPostProcessors (for
> example: not eligible for auto-proxying) 28.03.2008 09:58:26
> org.springframework.beans.factory.support.DefaultListableBeanFactory
> preInstantiateSingletons INFO: Pre-instantiating singletons in
> org.springframework.beans.factory.support.DefaultListableBeanFactory@2
>c03ff: defining beans
> [cxf,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.
>bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceMa
>nager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.Bi
>ndingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,
>org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WS
>DLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.Wo
>rkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apac
>he.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleM
>anager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.tr
>ansports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointReso
>lverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalo
>g.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRe
>gistry,or
> g.apache.cxf.jaxws.context.WebServiceContextResourceResolver,org.apach
>e.cxf.jaxws.context.WebServiceContextImpl,org.apache.cxf.binding.xml.XM
>LBindingFactory,org.apache.cxf.transport.http.policy.HTTPClientAssertio
>nBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilde
>r,org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,org.apac
>he.cxf.ws.addressing.policy.AddressingAssertionBuilder,org.apache.cxf.w
>s.addressing.policy.AddressingPolicyInterceptorProvider,org.apache.cxf.
>ws.addressing.policy.UsingAddressingAssertionBuilder,org.apache.cxf.bin
>ding.http.HttpBindingFactory,org.apache.cxf.binding.object.ObjectBindin
>gFactory,org.apache.cxf.transport.local.LocalTransportFactory,org.apach
>e.cxf.transport.jms.JMSTransportFactory,org.apache.cxf.binding.soap.Soa
>pBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.ap
>ache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.transport.h
>ttp_jetty.JettyHTTPTransportFactory,org.apache.cxf.ws.rm.RMManager,
> org.apache.cxf.ws.rm.policy.RMPolicyInterceptorProvider,org.apache.cxf
>.ws.rm.RMAssertionBuilder,org.apache.cxf.management.jmx.Instrumentation
>ManagerImpl,org.apache.cxf.ws.policy.AssertionBuilderRegistry,org.apach
>e.cxf.ws.policy.PolicyConstants,org.apache.cxf.ws.policy.PolicyIntercep
>torProviderRegistry,org.apache.cxf.ws.policy.attachment.external.Domain
>ExpressionBuilderRegistry,org.apache.cxf.ws.policy.attachment.external.
>EndpointReferenceDomainExpressionBuilder,org.apache.cxf.ws.policy.Polic
>yBuilder,org.apache.cxf.ws.policy.PolicyEngine,org.apache.cxf.ws.policy
>.attachment.wsdl11.Wsdl11AttachmentPolicyProvider,org.apache.cxf.ws.pol
>icy.attachment.ServiceModelPolicyProvider,org.apache.cxf.ws.policy.mtom
>.MTOMAssertionBuilder,org.apache.cxf.ws.policy.mtom.MTOMPolicyIntercept
>orProvider]; root of factory hierarchy Exception in thread "main"
> java.lang.NullPointerException
> 	at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initConfiguration
>(JaxWsServiceFactoryBean.java:317) at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.setJaxWsImplement
>orInfo(JaxWsServiceFactoryBean.java:301) at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.setServiceClass(J
>axWsServiceFactoryBean.java:107) at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.initializeSer
>viceFactory(AbstractWSDLBasedEndpointFactory.java:142) at
> org.apache.cxf.frontend.ServerFactoryBean.initializeServiceFactory(Ser
>verFactoryBean.java:144) at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoin
>t(AbstractWSDLBasedEndpointFactory.java:73) at
> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.jav
>a:108) at
> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryB
>ean.java:147) at
> org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:299) at
> org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:230) at
> org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:181) at
> org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(Provide
>rImpl.java:74) at javax.xml.ws.Endpoint.publish(Endpoint.java:156)
> 	at TestService.main(TestService.java:15)
> </snip>
>
> regards, philipp



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Mime
View raw message