···
On Wed, May 7, 2014 at 1:56 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:
Hi Sampo,
I’ve just merged the changes, and added modifications to make the initializers be picked up regardless of
whether the factory was created via spring or programatically: there were just too many places using
it programatically, so I went for a GeoServerExtensions.extensions(…) call instead (the version that
does not take the spring context as an argument, but uses the one set in GeoServerExtensions itself
Cheers
Andrea
–
Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc
This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.
On Fri, Apr 25, 2014 at 9:06 AM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:
Ok. This is a bit ugly, but seems to work for me:
In org.geoserver.config.GeoServerLoader:
public void setApplicationContext(ApplicationContext applicationContext)
throws BeansException {
xpf.setApplicationContext(applicationContext);
}
The method already exists but was empty. Passing the application context to the parser does activate the initializer. It’s more of a band-aid though, the real problem is that GS is not 100% spring managed.
S.
–
==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
On Fri, Apr 25, 2014 at 9:55 AM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:
There are multiple points in GS code where XStreamPersisterFactories are created using the raw constructor. This results in the setApplicationContext() method not being called in most cases. This configuration model works only when the XStreamPersisterFactory is instantiated via Spring.
Any ideas?
S.
–
Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc
This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.
On Fri, Apr 25, 2014 at 9:44 AM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:
Oops. Scratch that. It’s loaded before GWCConfigPersister. I was missing a breakpoint I thought I had set up
Nevertheless, it’s loaded too late.
S.
–
Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc
This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.
On Fri, Apr 25, 2014 at 9:42 AM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:
Hi,
I’ve looked at this further. For some strange reason, the gs-wfs-ng extension applicationContext is loaded only inside GWCConfigPersister.loadConfig(). Do you know of an extension which is for sure initialized before parsing configuration? Maybe I’m missing some configuration magic.
S.
–
Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc
This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.
On Fri, Apr 25, 2014 at 9:38 AM, Andrea Aime <andrea.aime@anonymised.com> wrote:
–
Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc
This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.
On Fri, Apr 25, 2014 at 8:08 AM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:
Hi Andrea,
I just merged this into my branch. It seems that during geoserver startup, the XStreamPersisterInitializer.init() method is called only after the server configuration is loaded.
Hum, I’ve indeed noticed yesterday that some bits of code in GeoServer instantiate the persister factory
programatically instead of fetching it from the application context, that might be the reason.
I believe it can be fixed by having them use Spring injection instead
Cheers
Andrea
–
==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it