cxf-users mailing list archives

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

Hello,

I’m running into an issue using CXF with a legacy Corba application and am
looking for some advice.  

Currently I have a CXF 2.2.9  client up and communicating with a pure corba
server using java 1.6 with sun’s orbd and idlj.  In this setup, the wsdl
<corba:address> location is specified using a corbaname address and in the
client I’m instantiating the corba service and port objects directly.  This
is based directly upon the corba/hello_world example in the CXF samples
directory.  So far so good.

The change I’m trying to make is to remove the corba address from the wsdl
because I don’t want host and port values hard-coded there.  My intended
approach is to use a ClientProxyFactoryBean in the client (rather than
instantiating the corba service object directly) and specify the corbaname
address at runtime.  

So based upon the original hello_world example, my updated service looks
like:

  	<wsdl:service name="HelloWorldCORBAService">
    	  <wsdl:port name="HelloWorldCORBAPort"
binding="tns:HelloWorldCORBABinding">
      	    <corba:address location="IOR:" />
    	  </wsdl:port>
  	</wsdl:service> 

And my updated client looks like:

ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.getOutInterceptors().add(new LoggingOutInterceptor());
factory.setServiceClass(HelloWorld.class);
factory.setAddress("corbaname::localhost:1050#HelloWorld");
      
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(CorbaBindingFactory.java:110)
        at
org.apache.cxf.binding.corba.CorbaBindingFactory.getConduit(CorbaBindingFactory.java:105)
        at
org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:78)
        at
org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:61)
        at
org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:743)
        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


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


Mime
View raw message