To wrap this one up...  Dan got me going on IRC.

It looks like I needed to add several CXF imports plus a <property
name="bus" ref="cxf" /> to the JaxWsProxyFactoryBean bean definition.
I'm not clear on why this only became necessary when I added the
handler to the proxy factory, but there you go.

Alternatively, if I switch the whole thing to use a <jaxws:client ...>
instead, it was not necessary to have the CXF imports or the explicit
bus assignment, even when I used the nested <jaxws:handler> elements.
So that seemed a little cleaner.

Thanks,
      Aaron

On Thu, Nov 20, 2008 at 8:13 AM, Aaron Mulder
<[EMAIL PROTECTED]> wrote:
> OK, I have a Spring client set up like this:
>
>    <bean id="clientHandler" class="sample.client.soap.ClientHandler" />
>
>    <bean id="clientFactory" 
> class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
>        <property name="serviceClass" value="sample.api.CustomerService"/>
>        <property name="address"
> value="http://localhost:8080/spring-sample-web/soap/CustomerService"/>
>        <property name="handlers" ref="clientHandler"/>
>    </bean>
>
>    <bean id="client" class="sample.api.CustomerService"
>          factory-bean="clientFactory" factory-method="create"/>
>
> The problem is, when I start this up with the handlers property
> present, I get this:
>
> Exception in thread "main" java.lang.NullPointerException
>        at 
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.buildHandlerChain(JaxWsProxyFactoryBean.java:156)
>        at 
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.clientClientProxy(JaxWsProxyFactoryBean.java:98)
>        at 
> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:116)
>        at 
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:115)
>        ...
>
> The NPE in JaxWsProxyFactoryBean is:
>
>        if (!chain.isEmpty()) { // next line is NPE
>            ResourceManager resourceManager =
> getBus().getExtension(ResourceManager.class);
>
> In other words, it appears that getBus() returns null?  Any ideas?
>
> Thanks,
>      Aaron
>

Reply via email to