You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Mark D <ma...@googlemail.com> on 2012/08/21 17:32:35 UTC

DOSGI RS client issue - JAXRSClientFactoryBean class visibility maybe causing a connect exception.

Hi all, I'm having a few issues getting DOSGi working in Servicemix. I've
slowly worked through issues and finally got a REST service running
server-side.

I'm now onto the client.

I'm using local discovery with a remote services xml file. I'm also using a
blueprint (I think the impl is Aries in Karaf) to reference the service and
inject it into a bean.

It looks like the inject is carried out ok but when the bean attempts to use
the service I get a ConnectException:

org.apache.cxf.interceptor.Fault: Could not send Message.
 at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)[337:org.apache.cxf.bundle-minimal:2.5.4]
...
...
Caused by: java.net.ConnectException: ConnectException invoking
http://192.168.3.170:9000/xtce/ssmfactory/model: Connection timed out:
connect
...
...
Caused by: java.net.ConnectException: Connection timed out: connect

The URL is correct and I can access the webservice successfully in a browser
from the same machine.


There is a suspicious error further up the log file which may be
significant! It appears when I start the client:

17:19:53,603 | ERROR | rint Extender: 1 | JAXRSClientFactoryBean           |
java.lang.IllegalArgumentException : interface
org.hbird.core.spacesystemmodel.SpaceSystemModelFactory is not visible from
class loader

I assume this is an import package issue but the client does in fact import
the package. It resolves and starts in the osgi container fine.

Any ideas where to look? I can of course post more log details but i'll save
the mailing list the huge log dump until somebody requests it!

Thanks!





--
View this message in context: http://cxf.547215.n5.nabble.com/DOSGI-RS-client-issue-JAXRSClientFactoryBean-class-visibility-maybe-causing-a-connect-exception-tp5712885.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: DOSGI RS client issue - JAXRSClientFactoryBean class visibility maybe causing a connect exception.

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 21/08/12 21:42, Mark D wrote:
> Thanks, Sergey.
>
> Do you mean this one?
> https://issues.apache.org/jira/browse/CXF-4290
>
> I noticed your comment at the end. I'm not familiar with the internals of
> CXF but it looks like this is an issue in the main CXF libraries, i.e., not
> specifically DOSGi and that the problem is only highlighted in particular
> cases, like OSGi's classloaders.
>
> I guess the class is attempting to create a proxy web client with the given
> interface and that isn't visible on it's class path. Was the fix passing in
> a classloader as a parameter?
>
The actual fix at the moment is to pass a composite loader in a retry 
attempt. This can be optimized and the loader can be passed as a 
parameter to the factory, but I was not yet 100% sure the simple 
composite loader we came up with was good enough to be used on the 
'main' path - a bit more testing is needed...

> I'm also curious as to why it works for the single-bundle dist and not the
> multi-bundle (the one I am using!). Surely it's just the CXF bundle?
>
I've really no idea - I guess in the single bundle case the class 
visibility is much higher

> Is there an open issue for the multi-bundle problem? I couldn't find one.
>

https://issues.apache.org/jira/browse/DOSGI-18

Cheers, Sergey

> Thanks for the help.
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/DOSGI-RS-client-issue-JAXRSClientFactoryBean-class-visibility-maybe-causing-a-connect-exception-tp5712885p5712924.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: DOSGI RS client issue - JAXRSClientFactoryBean class visibility maybe causing a connect exception.

Posted by Mark D <ma...@googlemail.com>.
Thanks, Sergey.

Do you mean this one?
https://issues.apache.org/jira/browse/CXF-4290

I noticed your comment at the end. I'm not familiar with the internals of
CXF but it looks like this is an issue in the main CXF libraries, i.e., not
specifically DOSGi and that the problem is only highlighted in particular
cases, like OSGi's classloaders.

I guess the class is attempting to create a proxy web client with the given
interface and that isn't visible on it's class path. Was the fix passing in
a classloader as a parameter?

I'm also curious as to why it works for the single-bundle dist and not the
multi-bundle (the one I am using!). Surely it's just the CXF bundle?

Is there an open issue for the multi-bundle problem? I couldn't find one.

Thanks for the help.



--
View this message in context: http://cxf.547215.n5.nabble.com/DOSGI-RS-client-issue-JAXRSClientFactoryBean-class-visibility-maybe-causing-a-connect-exception-tp5712885p5712924.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: DOSGI RS client issue - JAXRSClientFactoryBean class visibility maybe causing a connect exception.

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 21/08/12 16:32, Mark D wrote:
> Hi all, I'm having a few issues getting DOSGi working in Servicemix. I've
> slowly worked through issues and finally got a REST service running
> server-side.
>
> I'm now onto the client.
>
> I'm using local discovery with a remote services xml file. I'm also using a
> blueprint (I think the impl is Aries in Karaf) to reference the service and
> inject it into a bean.
>
> It looks like the inject is carried out ok but when the bean attempts to use
> the service I get a ConnectException:
>
> org.apache.cxf.interceptor.Fault: Could not send Message.
>   at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)[337:org.apache.cxf.bundle-minimal:2.5.4]
> ...
> ...
> Caused by: java.net.ConnectException: ConnectException invoking
> http://192.168.3.170:9000/xtce/ssmfactory/model: Connection timed out:
> connect
> ...
> ...
> Caused by: java.net.ConnectException: Connection timed out: connect
>
> The URL is correct and I can access the webservice successfully in a browser
> from the same machine.
>
>
> There is a suspicious error further up the log file which may be
> significant! It appears when I start the client:
>
> 17:19:53,603 | ERROR | rint Extender: 1 | JAXRSClientFactoryBean           |
> java.lang.IllegalArgumentException : interface
> org.hbird.core.spacesystemmodel.SpaceSystemModelFactory is not visible from
> class loader
>
> I assume this is an import package issue but the client does in fact import
> the package. It resolves and starts in the osgi container fine.
>
> Any ideas where to look? I can of course post more log details but i'll save
> the mailing list the huge log dump until somebody requests it!
>

This issue has been resolved on the DOSGi CXF trunk, should work in a 
single bundle distro, but there was an issue with a multi-bundle distro, 
Chris Dolan helped with fixing that

thanks, Sergey

> Thanks!
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/DOSGI-RS-client-issue-JAXRSClientFactoryBean-class-visibility-maybe-causing-a-connect-exception-tp5712885.html
> Sent from the cxf-user mailing list archive at Nabble.com.