Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] Difficulty connecting to services using r_osgi and web sockets

Hi Tim,

Jan and/or Markus may respond with better information about the rosgi provider, but it looks like the TIMEOUT from ChannelEndpointImpl is set to a constant here:

    /**
     * Timeout.
     */
    private static final int TIMEOUT = 120000;

I'm not sure why you are experiencing ~20sec, as this looks like it should timeout after 120s. 

I think this should probably be a system property/configurable, but I'll let Jan or Markus comment as there may be something else going on.  If that's the right thing to do then a System property to configure/change default can be easily added.

But one question:   even 20s seems too long to have to wait for response...at least under most conditions.  Is it possible something else is going on on the server that's preventing it from responding?

Scott


On 3/13/2015 2:20 PM, Timothy Vogel wrote:
I have a set of OSGi services running in karaf that are using r_osgi and web sockets to make them available via http on port 80.  I am able to connect to these services from a client installed on the same machine but not from computers over the internet.

I think this is due to timeout while waiting to make the connection from client to server over the Internet.  I put the exceptions received on the client below.

How can I increase the timeout while waiting for a connection?

Thanks,
Timothy Vogel


The client throws the following exception after approximately 20 seconds.
Exception in thread "Thread-11" java.lang.NullPointerException
at ch.ethz.iks.r_osgi.transport.http.HttpChannelFactory$HttpChannel.closeSocket(HttpChannelFactory.java:194)
at ch.ethz.iks.r_osgi.transport.http.HttpChannelFactory$HttpChannel$1.onClose(HttpChannelFactory.java:141)
at org.java_websocket.client.WebSocketClient.onWebsocketClose(WebSocketClient.java:389)
at org.java_websocket.WebSocketImpl.closeConnection(WebSocketImpl.java:412)
at org.java_websocket.WebSocketImpl.closeConnection(WebSocketImpl.java:420)
at org.java_websocket.WebSocketImpl.eot(WebSocketImpl.java:434)
at org.java_websocket.client.WebSocketClient.interruptableRun(WebSocketClient.java:281)
at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java:204)
at java.lang.Thread.run(Thread.java:745)

When the client exits it throws the additional 2 exceptions below:
!STACK 0
ch.ethz.iks.r_osgi.RemoteOSGiException: Interrupted while waiting for callback
at ch.ethz.iks.r_osgi.impl.ChannelEndpointImpl.sendAndWait(ChannelEndpointImpl.java:1361)
at ch.ethz.iks.r_osgi.impl.ChannelEndpointImpl.sendLease(ChannelEndpointImpl.java:749)
at ch.ethz.iks.r_osgi.impl.RemoteOSGiServiceImpl.connect(RemoteOSGiServiceImpl.java:725)
at org.eclipse.ecf.internal.provider.r_osgi.R_OSGiRemoteServiceContainer.doConnect(R_OSGiRemoteServiceContainer.java:551)
at org.eclipse.ecf.internal.provider.r_osgi.R_OSGiRemoteServiceContainer.connect(R_OSGiRemoteServiceContainer.java:532)
at org.eclipse.ecf.internal.provider.r_osgi.R_OSGiRemoteServiceContainer.getRemoteServiceReferences(R_OSGiRemoteServiceContainer.java:251)
at org.eclipse.ecf.internal.provider.r_osgi.R_OSGiRemoteServiceContainer.getRemoteServiceReferences(R_OSGiRemoteServiceContainer.java:217)
at org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin$14.run(RemoteServiceAdmin.java:2288)
at org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin$14.run(RemoteServiceAdmin.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.importService(RemoteServiceAdmin.java:2284)
at org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.importService(RemoteServiceAdmin.java:428)
at org.eclipse.ecf.osgi.services.remoteserviceadmin.AbstractTopologyManager.handleECFEndpointAdded(AbstractTopologyManager.java:293)
at org.eclipse.ecf.internal.osgi.services.distribution.BasicTopologyManagerImpl.handleEndpointAdded(BasicTopologyManagerImpl.java:104)
at org.eclipse.ecf.internal.osgi.services.distribution.BasicTopologyManagerImpl.endpointChanged(BasicTopologyManagerImpl.java:181)
at org.eclipse.ecf.internal.osgi.services.distribution.Activator$ProxyEndpointEventListener.deliverSafe(Activator.java:206)
at org.eclipse.ecf.internal.osgi.services.distribution.Activator$ProxyEndpointEventListener.endpointChanged(Activator.java:183)
at org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescriptionLocator$1.dispatchEvent(EndpointDescriptionLocator.java:198)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at ch.ethz.iks.r_osgi.impl.ChannelEndpointImpl.sendAndWait(ChannelEndpointImpl.java:1357)
... 19 more
119106 ERROR org.eclipse.ecf.osgi.services.remoteserviceadmin - org.eclipse.core.runtime.Status[plugin=org.eclipse.ecf.osgi.services.remoteserviceadmin;code=4;message=org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin:importService:selectRemoteServiceReference returned null for rsRefs=[],targetID=r-osgi.ws://easa.vogelware.com,idFilter=[Lorg.eclipse.ecf.core.identity.ID;@48b68d98,interfaces=[com.easa.motordb.services.IDcMotorEntity],rsFilter=null,rsContainerID=r-osgi.ws://TimLaptop;severity4;exception=ch.ethz.iks.r_osgi.RemoteOSGiException: Interrupted while waiting for callback;children=[]]
ch.ethz.iks.r_osgi.RemoteOSGiException: Interrupted while waiting for callback
at ch.ethz.iks.r_osgi.impl.ChannelEndpointImpl.sendAndWait(ChannelEndpointImpl.java:1361) ~[na:na]
at ch.ethz.iks.r_osgi.impl.ChannelEndpointImpl.sendLease(ChannelEndpointImpl.java:749) ~[na:na]
at ch.ethz.iks.r_osgi.impl.RemoteOSGiServiceImpl.connect(RemoteOSGiServiceImpl.java:725) ~[na:na]
at org.eclipse.ecf.internal.provider.r_osgi.R_OSGiRemoteServiceContainer.doConnect(R_OSGiRemoteServiceContainer.java:551) ~[na:na]
at org.eclipse.ecf.internal.provider.r_osgi.R_OSGiRemoteServiceContainer.connect(R_OSGiRemoteServiceContainer.java:532) ~[na:na]
at org.eclipse.ecf.internal.provider.r_osgi.R_OSGiRemoteServiceContainer.getRemoteServiceReferences(R_OSGiRemoteServiceContainer.java:251) ~[na:na]
at org.eclipse.ecf.internal.provider.r_osgi.R_OSGiRemoteServiceContainer.getRemoteServiceReferences(R_OSGiRemoteServiceContainer.java:217) ~[na:na]
at org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin$14.run(RemoteServiceAdmin.java:2288) ~[na:na]
at org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin$14.run(RemoteServiceAdmin.java:1) ~[na:na]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_65]
at org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.importService(RemoteServiceAdmin.java:2284) ~[na:na]
at org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.importService(RemoteServiceAdmin.java:428) ~[na:na]
at org.eclipse.ecf.osgi.services.remoteserviceadmin.AbstractTopologyManager.handleECFEndpointAdded(AbstractTopologyManager.java:293) ~[na:na]
at org.eclipse.ecf.internal.osgi.services.distribution.BasicTopologyManagerImpl.handleEndpointAdded(BasicTopologyManagerImpl.java:104) ~[na:na]
at org.eclipse.ecf.internal.osgi.services.distribution.BasicTopologyManagerImpl.endpointChanged(BasicTopologyManagerImpl.java:181) ~[na:na]
at org.eclipse.ecf.internal.osgi.services.distribution.Activator$ProxyEndpointEventListener.deliverSafe(Activator.java:206) ~[na:na]
at org.eclipse.ecf.internal.osgi.services.distribution.Activator$ProxyEndpointEventListener.endpointChanged(Activator.java:183) ~[na:na]
at org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescriptionLocator$1.dispatchEvent(EndpointDescriptionLocator.java:198) ~[na:na]
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) ~[na:na]
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) ~[na:na]
Caused by: java.lang.InterruptedException: null
at java.lang.Object.wait(Native Method) ~[na:1.7.0_65]
at ch.ethz.iks.r_osgi.impl.ChannelEndpointImpl.sendAndWait(ChannelEndpointImpl.java:1357) ~[na:na]
... 19 common frames omitted



_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/ecf-dev


Back to the top