Problem
Currently, PersistenceManagerFactory.addInstanceLifecycleListener(...) throws an exception if it's called after the PMF has been initialized or after a PersistenceManager has been created:
"Configuration changes are not allowed on this PMF, since either it was generated using a JDOHelper factory method, or persistence managers have been generated."
Solution:
boolean allowListeners = getNucleusContext().getConfiguration().getBooleanProperty("datanucleus.allowListenerUpdateAfterInit".toLowerCase(), false);