Hi,

thanks for your prompt reply ... I was using the latest release version.

Just for curiosity - how is the 'fix' in the latest version? Is it just throwing a more senseful exception, or is it deploying successfully?

/philipp

Daniel Kulp schrieb:

On Friday 28 March 2008, Daniel Kulp wrote:
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.

Actually, I just tested this with CXF 2.0.5 and it's fixed.  :-)


Dan


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.cx
f.
bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.Resourc
eMa
nager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding
.Bi
ndingFactoryManager,org.apache.cxf.transport.DestinationFactoryManag
er,
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.a
pac
he.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCyc
leM
anager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf
.tr
ansports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointR
eso
lverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.cat
alo
g.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolve
rRe gistry,or
g.apache.cxf.jaxws.context.WebServiceContextResourceResolver,org.apa
ch
e.cxf.jaxws.context.WebServiceContextImpl,org.apache.cxf.binding.xml
.XM
LBindingFactory,org.apache.cxf.transport.http.policy.HTTPClientAsser
tio
nBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBui
lde
r,org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,org.a
pac
he.cxf.ws.addressing.policy.AddressingAssertionBuilder,org.apache.cx
f.w
s.addressing.policy.AddressingPolicyInterceptorProvider,org.apache.c
xf.
ws.addressing.policy.UsingAddressingAssertionBuilder,org.apache.cxf.
bin
ding.http.HttpBindingFactory,org.apache.cxf.binding.object.ObjectBin
din
gFactory,org.apache.cxf.transport.local.LocalTransportFactory,org.ap
ach
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.transpor
t.h
ttp_jetty.JettyHTTPTransportFactory,org.apache.cxf.ws.rm.RMManager,
org.apache.cxf.ws.rm.policy.RMPolicyInterceptorProvider,org.apache.c
xf
.ws.rm.RMAssertionBuilder,org.apache.cxf.management.jmx.Instrumentat
ion
ManagerImpl,org.apache.cxf.ws.policy.AssertionBuilderRegistry,org.ap
ach
e.cxf.ws.policy.PolicyConstants,org.apache.cxf.ws.policy.PolicyInter
cep
torProviderRegistry,org.apache.cxf.ws.policy.attachment.external.Dom
ain
ExpressionBuilderRegistry,org.apache.cxf.ws.policy.attachment.extern
al.
EndpointReferenceDomainExpressionBuilder,org.apache.cxf.ws.policy.Po
lic
yBuilder,org.apache.cxf.ws.policy.PolicyEngine,org.apache.cxf.ws.pol
icy
.attachment.wsdl11.Wsdl11AttachmentPolicyProvider,org.apache.cxf.ws.
pol
icy.attachment.ServiceModelPolicyProvider,org.apache.cxf.ws.policy.m
tom
.MTOMAssertionBuilder,org.apache.cxf.ws.policy.mtom.MTOMPolicyInterc
ept orProvider]; root of factory hierarchy Exception in thread "main"
java.lang.NullPointerException
        at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initConfigurati
on (JaxWsServiceFactoryBean.java:317) at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.setJaxWsImpleme
nt orInfo(JaxWsServiceFactoryBean.java:301) at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.setServiceClass
(J axWsServiceFactoryBean.java:107) at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.initializeS
er viceFactory(AbstractWSDLBasedEndpointFactory.java:142) at
org.apache.cxf.frontend.ServerFactoryBean.initializeServiceFactory(S
er verFactoryBean.java:144) at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpo
in t(AbstractWSDLBasedEndpointFactory.java:73) at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.j
av a:108) at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactor
yB 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(Provi
de rImpl.java:74) at javax.xml.ws.Endpoint.publish(Endpoint.java:156)
at TestService.main(TestService.java:15)
</snip>

regards, philipp



Reply via email to