Thanks to visit codestin.com
Credit goes to github.com

Skip to content

NullPointerException in POAFactory#removePoaManager when shutting down ORB created with -Dorg.omg.CORBA.SkipGmbalInit=true #239

@ahubold

Description

@ahubold

Version: 5.0.0

If the ORB is created with system property -Dorg.omg.CORBA.SkipGmbalInit=true (see #204), a NullPointerException is thrown when shutting down, because POAFactory#removePoaManager expects a non-null ManagedObjectManager in field mom. But that field is null, because it's initialized from com.sun.corba.ee.spi.orb.ORB#mom, which is null with above system property.

java.lang.NullPointerException: Cannot invoke "org.glassfish.gmbal.ManagedObjectManager.unregister(Object)" because "this.mom" is null
	at com.sun.corba.ee.impl.oa.poa.POAFactory.removePoaManager(POAFactory.java:246)
	at com.sun.corba.ee.impl.oa.poa.POAManagerImpl$POAManagerDeactivator.run(POAManagerImpl.java:556)
	at com.sun.corba.ee.impl.oa.poa.POAManagerImpl.deactivate(POAManagerImpl.java:492)
	at com.sun.corba.ee.impl.oa.poa.POAFactory.shutdown(POAFactory.java:236)
	at com.sun.corba.ee.impl.orb.ORBImpl.shutdownServants(ORBImpl.java:1395)
	at com.sun.corba.ee.impl.orb.ORBImpl.shutdown(ORBImpl.java:1355)
	at com.sun.corba.ee.impl.orb.ORBImpl.destroy(ORBImpl.java:1448)

public synchronized void removePoaManager( POAManager manager )
{
poaManagers.remove(manager);
mom.unregister( manager ) ;
}

Let me add some context, why I ended up trying to use that system property:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions