Skip to main content

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


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:


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

Back to the top