[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] NullpointerException in RemoteServiceAdmin


while trying to integrate the fix for the bug below i stumbled upon a new issue:

Caused by: java.lang.NoSuchMethodError: org.eclipse.ecf.remoteservice.AbstractRemoteService.isReturnAsync(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Z
ÂÂÂ at org.eclipse.ecf.remoteservice.AbstractRemoteService.invoke(AbstractRemoteService.java:503)
ÂÂÂ ... 5 common frames omitted

I updated the ECF implementation to the latest stable version 3.14.1. The above problem happens in bundle org.eclipse.ecf.remoteservice. The class AbstractRemoteService extends AbstractAsyncProxyRemoteService which is imported via package import :


I decided to use the bundle org.eclipse.ecf.remoteservice.asyncproxy version 1.1.0.v20180311-0310 (and not version 2.1. 0 because of other dependencies) which perfectly fits into that version range.

The problem is that in that bundle the class AbstractAsyncProxyRemoteService does not have a method isReturnAsync which leads to the above error.

Should i file a bug or is that a known problem?

Thanks, bye Peter

Am 19.09.2018 um 10:28 schrieb Peter Hermsdorf:

Done: https://bugs.eclipse.org/bugs/show_bug.cgi?id=539218

Thanks for looking at the issue!

Bye Peter

Am 18.09.2018 um 19:19 schrieb Scott Lewis:
Hi Peter,

I believe this is due to the (incorrect) line in ImportRegistration.close():

ÂÂÂ ÂÂÂ public void close() {
ÂÂÂ ÂÂÂ ÂÂÂ boolean publish = false;
ÂÂÂ ÂÂÂ ÂÂÂ ID containerID = null;
ÂÂÂ ÂÂÂ ÂÂÂ Throwable exception = null;
ÂÂÂ ÂÂÂ ÂÂÂ EndpointDescription endpointDescription = null;
ÂÂÂ ÂÂÂ ÂÂÂ ImportReference imRef = null;
ÂÂÂ ÂÂÂ ÂÂÂ synchronized (this) {
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ // only do this once
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ if (!closed) {
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ containerID = getContainerID();
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ exception = getException();
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ endpointDescription = getEndpointDescription();
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ imRef = this.importReference;
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ publish = importReference.close(this);
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ this.importReference = null;ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ <-- this line should be deleted
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ closed = true;
...more code

I believe the importReference should never be set to null in the ImportRegistration and that it is incorrect that it did so.ÂÂ Also synchronization needs to be added to ImportRegistration accessors so that the synchronized block above prevents access to importReference before closed = true (which is resulting in NPE I think).

Peter if you would please open a bug, and put your info in comments I will address in latest version as soon as I can.


On 9/18/2018 7:33 AM, Peter Hermsdorf wrote:

we sometimes faces the following error:

ÂÂÂ at org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin$ImportRegistration.getException(RemoteServiceAdmin.java:1139)
ÂÂÂ at org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin$ImportRegistration.getImportReference(RemoteServiceAdmin.java:1104)
ÂÂÂ at org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.getImportedEndpoints(RemoteServiceAdmin.java:519)

The corresponding code in the class ImportRegistration is

public Throwable getException() {
ÂÂÂ ÂÂÂ ÂÂÂ return (closed)?updateException:importReference.getException();

So obviously importReference is null but closed is false.

Any ideas what could cause this state? I've seen that there are changes on this class but wasn't able to determine if these have something to do with this handling.

We are still on ECF version 3.13.8 and we are using the ecf-genric provider.

The above code and the call to getImportedEndpoints is used to update the connection state in an RCP application and is asynchronously executed and triggered by a new event to an RemoteServiceAdminListener .... so more ore less on service state change.

Any hints are welcome!

Thanks, bye Peter