I added that in, but still get the following error:
java.lang.NullPointerException
at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:160)
at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
at
org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:51)
at
org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:97)
at
org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:89)
I will try defining the Bus in my XML.
________________________________
From: Willem Jiang [mailto:[EMAIL PROTECTED]
Sent: Mon 5/5/2008 12:19 PM
To: Urciolo, Kevin
Cc: [email protected]
Subject: Re: Using CXF In Existing Spring Context
I think you missed to set the bus to the factory.
Maybe you need to add the below line just before call the factory's
create method to set the right bus :).
factory.setBus(BusFactory.getDefaultBus());
Willem
Urciolo, Kevin wrote:
> I am using the released version of 2.1. I am currently following this
> approach since it works well with my needs to programmatically decide which
> ports to use at run time. So I do not have any client configuration in XML.
>
> However, I am in the same Spring context as my web services that are defined
> in xml. That xml is in the previous emails that are chained below.
>
> JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
> factory.getInInterceptors().add(new LoggingInInterceptor());
>
> factory.getOutInterceptors().add(new LoggingOutInterceptor());
> factory.setServiceClass(HelloWorld.class);
> factory.setAddress("http://localhost:9000/helloWorld");
> HelloWorld client = (HelloWorld) factory.create();
>
>
> ________________________________
>
> From: Willem Jiang [mailto:[EMAIL PROTECTED]
> Sent: Mon 5/5/2008 6:54 AM
> To: [email protected]
> Subject: Re: Using CXF In Existing Spring Context
>
>
>
> Which CXF version are you using?
> With the trunk code ( CXF 2.1 ) , it looks like the
> DestinationFactoryManager dfm which is got from the bus is null.
>
> protected EndpointInfo createEndpointInfo() throws BusException {
> if (transportId == null
> && getAddress() != null) {
> DestinationFactory df = getDestinationFactory();
> if (df == null) {
> DestinationFactoryManager dfm =
> getBus().getExtension(DestinationFactoryManager.class);
> df = dfm.getDestinationFactoryForUri(getAddress()); <--
> The NPE is thrown from this line
> }
> ...
>
> So I doubt you set the right bus on the client side?
> Can you show me the client spring configuration file ?
>
> Willem
> Urciolo, Kevin wrote:
>
>> Thanks, that seemed to help. The only problem I have now is when attempting
>> to get a client, I get the following error:
>>
>> java.lang.NullPointerException
>> at
>> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBased
>> EndpointFactory.java:160)
>> at
>> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndp
>> ointFactory.java:102)
>> at
>> org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:51)
>> at
>> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:97)
>> at
>> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:89)
>>
>> This works fine when running the CXF client stand alone.
>>
>> I see this nabble entry talking about the need to configure the CXF Bus. Is
>> this what I need to do in my
>> case?
>> http://www.nabble.com/java.lang.NullPointerException-td14201919.html#a14201919
>>
>> ________________________________
>>
>> From: Ian Roberts [mailto:[EMAIL PROTECTED]
>> Sent: Sun 5/4/2008 6:19 PM
>> To: [email protected]
>> Subject: Re: Using CXF In Existing Spring Context
>>
>>
>>
>> Urciolo, Kevin wrote:
>>
>>
>>> <servlet>
>>> <servlet-name>context</servlet-name>
>>> <servlet-class>
>>> org.springframework.web.context.ContextLoaderServlet
>>> </servlet-class>
>>> <load-on-startup>1</load-on-startup>
>>> </servlet>
>>>
>>>
>> [...]
>>
>>
>>> <listener>
>>> <listener-class>
>>> org.springframework.web.context.ContextLoaderListener
>>> </listener-class>
>>> </listener>
>>>
>>>
>> ContextLoaderServlet and ContextLoaderListener do the same job - you
>> only want one or the other, not both, and the Spring docs prefer the
>> listener. I wouldn't be surprised if you get problems when you use
>> both, with the context being initialized twice or something...
>>
>> http://static.springframework.org/spring/docs/2.0.x/reference/beans.html#context-create
>>
>> Also, do you have the required imports in your Spring context file?
>>
>> <import resource="classpath:META-INF/cxf/cxf.xml" />
>> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
>> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>>
>> Ian
>>
>> --
>> Ian Roberts | Department of Computer Science
>> [EMAIL PROTECTED] | University of Sheffield, UK
>>
>>
>>
>>
>>
>
>
>
>
>