cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Lamb <lambd...@yahoo.com>
Subject Re: ClientProxyFactoryBean with corba bindings results in NullPointerException
Date Fri, 25 Jun 2010 20:27:07 GMT

Thanks Dan,

For anyone interested this is what I ended up with in my client (the wsdl
didn't require any further changes):

      QName SERVICE_NAME = new
QName("http://cxf.apache.org/schemas/cxf/idl/HelloWorld",
                                                        
"HelloWorldCORBAService");
 
      JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
      factory.getInInterceptors().add(new LoggingInInterceptor());
      factory.getOutInterceptors().add(new LoggingOutInterceptor());
      factory.setServiceClass( HelloWorld.class );
      factory.setWsdlLocation( "file:resources/HelloWorld-corba.wsdl" );
      factory.setAddress( "corbaname::localhost:1050#HelloWorld" );
      factory.setServiceName( SERVICE_NAME );
      HelloWorld client = (HelloWorld) factory.create(); 

So in addition to the setWsdlLocation(...) suggestion, I also needed to call
setServiceName(...).  And finally I was only able to get this to work using
a JaxWsProxyFactoryBean factory (rather than my earlier choice of
ClientProxyFactoryBean.)




dkulp wrote:
> 
> On Friday 25 June 2010 12:47:01 pm Andrew Lamb wrote:
>> Hello,
>> 
>> I’m running into an issue using CXF with a legacy Corba application and
>> am
>> looking for some advice.
> 
> Way cool.   I was actually wondering if someone outside of IONA/Progress's 
> customers were using the CORBA binding.    :-)
> 
> 
>  
>> ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
>> factory.getInInterceptors().add(new LoggingInInterceptor());
>> factory.getOutInterceptors().add(new LoggingOutInterceptor());
>> factory.setServiceClass(HelloWorld.class);
>> factory.setAddress("corbaname::localhost:1050#HelloWorld");
> 
> 
> I think you need to add the factory.setWsdlLocation(....) call in there to 
> give it the location of the WSDL that would have the type mapping and such
> in 
> it.      That alone may solve it.    Let me know how it works out.
> 
> Dan
> 
> 
>> 
>> HelloWorld client = (HelloWorld) factory.create();
>> String result = client.greetMe("Hello There");
>> 
>> 
>> Running this, I end up with a NullPointerException:
>> 
>> Exception in thread "main" java.lang.NullPointerException
>>         at
>> org.apache.cxf.binding.corba.TypeMapCache.get(TypeMapCache.java:40)
>>         at
>> org.apache.cxf.binding.corba.CorbaConduit.<init>(CorbaConduit.java:84)
>>         at
>> org.apache.cxf.binding.corba.CorbaBindingFactory.getConduit(CorbaBindingFac
>> tory.java:110) at
>> org.apache.cxf.binding.corba.CorbaBindingFactory.getConduit(CorbaBindingFac
>> tory.java:105) at
>> org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(Abstract
>> ConduitSelector.java:78) at
>> org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelect
>> or.java:61) at
>> org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:7
>> 43) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:481) at
>> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) at
>> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) at
>> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
>>         at
>> org.apache.cxf.frontend.ClientProxy.invoke(ClientProxy.java:68)
>>         at $Proxy38.greetMe(Unknown Source)
>>         at cxf.client.Client.main(Client.java:47)
>> 
>> I’m seeing that DescriptionInfo never gets included as part of the
>> ServiceInfo when buildServiceFromClass() is called on
>> ReflectionServiceFactoryBean; whereas DescriptionInfo does eventually get
>> set if instead buildServiceFromWSDL(…) is called.  It’s the null
>> DescriptionInfo that eventually trips things up.
>> 
>> So in summary: Can someone help me get this running?  Or is there a
>> better
>> way to go about pulling host and port values out of my wsdl?  Or is there
>> some documentation out there that I’m missing?
>> 
>> Thanks,
>> Andrew
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
> 
> 

-- 
View this message in context: http://old.nabble.com/ClientProxyFactoryBean-with-corba-bindings-results-in-NullPointerException-tp28994310p28996240.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message