Hi Maurizio, I was just trying this out, and got it working by following these steps: * Start the Greeter Service Implementation bundle (plus its dependencies) on machine S * Modify the <property name="org.apache.cxf.ws.address"> http://localhost:9090/greeter</property> in OSGI-INF/remote-service/remote-services.xml in the Greeter Client bundle to point to the correct host name. * Start the client on machine C * Invoke on the remote service from the pop-up dialog. Works for me...
If this doesn't work you may want to check that the server machine and port are reachable from the client machine. An easy way to do this is to obtain the service WSDL from a browser, just go to http://machine_name_or_IP:9090/greeter?wsdl On your question regarding Discovery. When using discovery you don't need the remote-service.xml file. The intent-map.xml file is only needed if you use specific intents, so if you're just getting stuff up & running you probably don't need that either. If you can't get the Greeter Demo working with discovery, have a look at the discovery demo: https://svn.apache.org/repos/asf/cxf/dosgi/trunk/samples/discovery BTW don't forget to configure the zookeeper service through ConfigAdmin which can be done by putting in the org.apache.cxf.dosgi.discovery.zookeeper.cfg file. See here: http://cxf.apache.org/dosgi-discovery.html Oh, and make sure to use 1.1-SNAPSHOT. There should be a 1.1 release soon, but until then you're best off using 1.1-SNAPSHOT (see here how to get it: http://cxf.apache.org/dosgi-releases.html). Hope this helps, David 2009/10/6 MaurizioLilli <[email protected]> > > Hi David, > First of all, thanks for the fast response. > > I already made the change in the "remote-services.xml", but unfortunally > this didn't provide the hoped result. > > BTW, I will try using discovery. > Please, can you confirm if using the discovery I still need the OSGI-INF > files (intent-map.xml & remote-service.xml) that I am using for the > original > Greeter example? > > Thanks in advance. > Kind regards. > Maurizio > > > David Bosschaert wrote: > > > > Yes, make sure the the configuration in your > > OSGI-INF/remote-service/remote-services.xml file contains the right host > > name (by default it contains localhost). Assuming you're not using > > discovery > > this file must contain the correct URL of the remote service. > > > > If you run the system using discovery, you don't have to provide this > > static > > URL as it will be published & discovered dynamically. See here for the > > discovery demo: http://cxf.apache.org/dosgi-discovery-demo-page.html > > > > Hope this helps, > > > > David > > > > 2009/10/5 Daniel Kulp <[email protected]> > > > >> > >> The key one is java.net.ConnectException: Connection refused: connect > >> > >> That seems to imply that the service isn't running on the given URL. I > >> would > >> definitely double check that the server side part is running and > >> available. > >> > >> Dan > >> > >> > >> On Mon October 5 2009 5:44:05 am MaurizioLilli wrote: > >> > Hi, > >> > I'm using the Greeter example from the Apache CXF - Distributed OSGi. > I > >> > downloaded the samples from the usual repository. > >> > I have installed a Felix Server and an Equinox client on a single > >> machine, > >> > and the example works great! > >> > Then I separated the two OSGi applications on two separate phisical > >> > machines, and at this point when I run the client-bundle on the > Equinox > >> > console I get an exception and no communication happen between the two > >> > peer. Here are the detals of the exception: > >> > " > >> > *** Opening greeter client dialog *** > >> > 02-Oct-2009 16:05:29 org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook > >> > cacheEndpointId > >> > INFO: caching proxy registration for endpoint ID: > >> > bb6beb4f-c3e8-41e2-97b6-e818749f119d > >> > 02-Oct-2009 16:05:29 > >> > org.apache.cxf.dosgi.discovery.local.LocalDiscoveryService > >> bundleChanged > >> > INFO: bundle changed: org.eclipse.osgi > >> > *** Invoking greeter *** > >> > 02-Oct-2009 16:05:37 org.apache.cxf.phase.PhaseInterceptorChain > >> doIntercept > >> > INFO: Interceptor has thrown exception, unwinding now > >> > org.apache.cxf.interceptor.Fault: Could not send Message. > >> > at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageS > >> > enderEndingInterceptor.handleMessage(MessageSenderIntercepto > r.java:64) > >> > at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(Phase > >> > InterceptorChain.java:236) > >> > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:46 9) > >> > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:29 9) > >> > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:25 1) > >> > at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.j > ava:73) > >> > at org.apache.cxf.frontend.ClientProxy.invoke(ClientProxy.java: 68) > >> > at $Proxy34.greetMe(Unknown Source) > >> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > >> > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > >> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > >> > at java.lang.reflect.Method.invoke(Unknown Source) > >> > at org.apache.cxf.dosgi.dsw.handlers.ServiceInvocationHandler.i > >> > nvoke(ServiceInvocationHandler.java:46) > >> > at $Proxy34.greetMe(Unknown Source) > >> > at org.apache.cxf.dosgi.samples.greeter.client.Activator.greete > >> > rUI(Activator.java:71) > >> > at org.apache.cxf.dosgi.samples.greeter.client.Activator.access > >> > $000(Activator.java:32) > >> > at org.apache.cxf.dosgi.samples.greeter.client.Activator$2.run( > >> > Activator.java:59) > >> > at java.lang.Thread.run(Unknown Source) > >> > Caused by: java.net.ConnectException: Connection refused: connect > >> > at java.net.PlainSocketImpl.socketConnect(Native Method) > >> > at java.net.PlainSocketImpl.doConnect(Unknown Source) > >> > at java.net.PlainSocketImpl.connectToAddress(Unknown Source) > >> > at java.net.PlainSocketImpl.connect(Unknown Source) > >> > at java.net.Socket.connect(Unknown Source) > >> > at sun.net.NetworkClient.doConnect(Unknown Source) > >> > at sun.net.www.http.HttpClient.openServer(Unknown Source) > >> > at sun.net.www.http.HttpClient.openServer(Unknown Source) > >> > at sun.net.www.http.HttpClient.<init>(Unknown Source) > >> > at sun.net.www.http.HttpClient.New(Unknown Source) > >> > at sun.net.www.http.HttpClient.New(Unknown Source) > >> > at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient > >> (Unknown > >> > Source) > >> > at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unk nown > >> > Source) at > sun.net.www.protocol.http.HttpURLConnection.connect(Unknown > >> > Source) at > >> sun.net.www.protocol.http.HttpURLConnection.getOutputStream( > >> > Unknown Source) > >> > at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStrea > >> > m.handleHeadersTrustCaching(HTTPConduit.java:1907) > >> > at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStrea > >> > m.onFirstWrite(HTTPConduit.java:1862) > >> > at org.apache.cxf.io.AbstractWrappedOutputStream.write(Abstract > >> > WrappedOutputStream.java:42) > >> > at org.apache.cxf.io.AbstractThresholdOutputStream.write(Abstra > >> > ctThresholdOutputStream.java:69) > >> > at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStrea > >> > m.close(HTTPConduit.java:1925) > >> > at org.apache.cxf.transport.AbstractConduit.close(AbstractCondu > >> it.java:66) > >> > at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit. > >> java:626) > >> > at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageS > >> > enderEndingInterceptor.handleMessage(MessageSenderIntercepto > r.java:62) > >> > ... 17 more > >> > Exception in thread "Thread-6" > >> > java.lang.reflect.UndeclaredThrowableException > >> > at $Proxy34.greetMe(Unknown Source) > >> > at org.apache.cxf.dosgi.samples.greeter.client.Activator.greete > >> > rUI(Activator.java:71) > >> > at org.apache.cxf.dosgi.samples.greeter.client.Activator.access > >> > $000(Activator.java:32) > >> > at org.apache.cxf.dosgi.samples.greeter.client.Activator$2.run( > >> > Activator.java:59) > >> > at java.lang.Thread.run(Unknown Source) > >> > " > >> > > >> > Any idea what I can be using wrong or I need to configure? > >> > > >> > Thanks in advance > >> > Kind regards. > >> > Maurizio > >> > > >> > >> -- > >> Daniel Kulp > >> [email protected] > >> http://www.dankulp.com/blog > >> > > > > > > -- > View this message in context: > http://www.nabble.com/Exception-running-CXF-client-side-tp25747848p25765449.html > Sent from the cxf-user mailing list archive at Nabble.com. > >
