[Geoserver-devel] [jira] Created: (GEOS-4425) GeoServerLoader reload forgets to load initializers

GeoServerLoader reload forgets to load initializers
---------------------------------------------------

                 Key: GEOS-4425
                 URL: http://jira.codehaus.org/browse/GEOS-4425
             Project: GeoServer
          Issue Type: Bug
            Reporter: Alessio Fabiani
            Assignee: Andrea Aime

The GeoServerLoader reload method actually reloads only the catalog and geoserver metadata

        loadCatalog( catalog, xp );
        loadGeoServer( geoserver, xp);

It's should also invoke the
       
        loadInitializers(geoserver);

method in order to reload the JAI tilecache and other initializers also.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

     [ http://jira.codehaus.org/browse/GEOS-4425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Aime reopened GEOS-4425:
-------------------------------

Unfortunately this one is not really fixed.. I thought so but missed a bit.

When the GeoServerLoader does the reload it calls destroy on GeoServerImpl, that in turn clears up all the listeners.
This means the listeners setup by the initializers are lost, and since the initializer are called just once, they are lost forever.
This is btw also the cause for the problem reported on the user list about the status page going NPE, it's due to the jai initializer code not rerunning and not setting up jai properly (which results in some null objects around, thus the NPE).

Now, I have in mind two solutions for this one:
- go back and apply the solution originally suggested by Alessio. That one is simple, but some initializers will have to be re-coded to know they can be called multiple times (but that they have to reattach listeners... might get a bit convoluted)
- make a copy of the listeners list before destroy, and set it back. Tried this one and it works, it also makes sense from the p.o.v of the initializers, but unfortunately it also results in a leak, because there are other parts that are reattaching listeners, so the list grows, first 9 listeners, reload, 11, reload, 13 and so on

Justin, opinions on this one? I guess the path chosen by Alessio works better, but that will require changes in the way some services (monitoring afaik) do their initialization

GeoServerLoader reload forgets to load initializers
---------------------------------------------------

                Key: GEOS-4425
                URL: http://jira.codehaus.org/browse/GEOS-4425
            Project: GeoServer
         Issue Type: Bug
   Affects Versions: 2.1-RC2
           Reporter: Alessio Fabiani
           Assignee: Andrea Aime
           Priority: Critical
            Fix For: 2.1-RC3

        Attachments: GEOS-4425.patch

The GeoServerLoader reload method actually reloads only the catalog and geoserver metadata
        loadCatalog( catalog, xp );
        loadGeoServer( geoserver, xp);
It's should also invoke the
       
        loadInitializers(geoserver);
method in order to reload the JAI tilecache and other initializers also.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira