Hi all,

I'm running into some issues trying out the new JDBCResourceStore module.
Running in my dev environment via Start.java is fine, the JDBC resource
store gets initialized and imported, and I can see resources (such as
Styles) being saved in the database; however, I run into issues running in
a WAR environment on Tomcat.

Hooking up the debugger and watching the startup, it seems that the
resource store beans are being initialized correctly *except* for the
actual resourceStore itself defined here:

https://github.com/geoserver/geoserver/blob/master/src/community/jdbcstore/src/main/resources/applicationContext.xml#L37

I'm not a Spring expert, but from what I've read the issue seems to be
overriding Spring beans by creating a duplicate with the same id doesn't
always produce consistent results. Whichever bean gets loaded first ends up
getting used, so in my WAR deployment the original resourceStore defined in
the main applicationContext.xml gets used:

https://github.com/geoserver/geoserver/blob/master/src/main/src/main/java/applicationContext.xml#L26

So that despite the fact that the jdbcstore module is enabled the original
data dir based resource store ends up getting used.

Am I maybe missing something? Has anyone tried this in a WAR deploy yet? I
don't think duplicating a bean like that is great practice according to
Spring docs. It looks like in the case of JDBCConfig a proxy class is used
to load an implementation via Spring and fall back on a default one if none
is found like this:

https://github.com/geoserver/geoserver/blob/a74a76d9c4bab0ef3bb8ea3a13f7abcabb3713d4/src/main/src/main/java/org/geoserver/config/GeoServerLoaderProxy.java#L75

I tried implementing a similar approach for the ResourceStore, but it's
complicated by the fact that GeoServerResourceLoader is itself an
implementation of ResourceStore and already define in the main
applicationContext.xml. I also looked at monkeying around with things using
the Spring Primary/Autowire functionality, but this is hampered by the XML
config API being slightly different than the annotations based config and I
didn't get very far.

Anyone have any thoughts? Is there something more basic I'm missing?

Thanks,
Devon
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to