[Geoserver-devel] Hibernate-based catalog LazyInitializationException

Hi, all.

I'm trying to set up the hibernate-based catalog in GeoServer. I can't
seem to get the war to build on its own, so I grabbed the latest from
(http://gridlock.opengeo.org/geoserver/2.1.x/), along with the compiled
dbconfig plugin from
(http://gridlock.opengeo.org/geoserver/2.1.x/community-latest/). After
adding the dbconfig jars (and an antlr jar for an exception class that
seemed to be missing) I try deploying the war to Tomcat. I keep getting a
LazyInitializationException (stack trace at the end) at this point.

Is there some other initialization/setup step I'm missing?

I don't know if this is related: I see this page
(geoserver-users@lists.sourceforge.net) that says the database is stored in
geoserver.db, but in my geoserver data directory I see instead

geoserver.1.log.db
geoserver.data.db
geoserver.index.db

Thanks in advance for any help you can offer.

Stack Trace
-----------
24 Jan 11:39:58 ERROR [context.ContextLoader] - Context initialization
failed
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'gwcFacade' defined in URL
[jar:file:/opt/devel/tools/apache-tomcat-7.0.12/webapps/geoserver/WEB-INF/lib/gwc-2.1-SNAPSHOT.jar!/geowebcache-geoserver-context.xml]:
Cannot resolve reference to bean 'DiskQuotaStore' while setting
constructor argument; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'DiskQuotaStore' defined in URL
[jar:file:/opt/devel/tools/apache-tomcat-7.0.12/webapps/geoserver/WEB-INF/lib/gwc-2.1-SNAPSHOT.jar!/geowebcache-diskquota-context.xml]:
Invocation of init method failed; nested exception is
org.hibernate.LazyInitializationException: could not initialize proxy - no
Session
  at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
  at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
  at
org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:495)
  at
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:162)
  at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
  at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)
  at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
  at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
  at java.security.AccessController.doPrivileged(Native Method)
  at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
  at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
  at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
  at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
  at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
  at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
  at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
  at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
  at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
  at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
  at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
  at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
  at
org.geoserver.platform.GeoServerContextLoaderListener.contextInitialized(GeoServerContextLoaderListener.java:18)
  at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701)
  at
org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204)
  at
org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199)
  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
  at java.util.concurrent.FutureTask.run(FutureTask.java:138)
  at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
  at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
  at java.lang.Thread.run(Thread.java:662)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'DiskQuotaStore' defined in URL
[jar:file:/opt/devel/tools/apache-tomcat-7.0.12/webapps/geoserver/WEB-INF/lib/gwc-2.1-SNAPSHOT.jar!/geowebcache-diskquota-context.xml]:
Invocation of init method failed; nested exception is
org.hibernate.LazyInitializationException: could not initialize proxy - no
Session
  at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)
  at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
  at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
  at java.security.AccessController.doPrivileged(Native Method)
  at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
  at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
  at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
  at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
  at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
  at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
  at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
  ... 29 more
Caused by: org.hibernate.LazyInitializationException: could not initialize
proxy - no Session
  at
org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:57)
  at
org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
  at
org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:150)
  at
org.geoserver.catalog.impl.NamespaceInfoImpl$$EnhancerByCGLIB$$ce26dca8.getPrefix(<generated>)
  at
org.geoserver.catalog.impl.ResourceInfoImpl.getPrefixedName(ResourceInfoImpl.java:142)
  at
org.geoserver.gwc.layer.CatalogConfiguration.getTileLayerNames(CatalogConfiguration.java:159)
  at
org.geowebcache.layer.TileLayerDispatcher.getLayerNames(TileLayerDispatcher.java:135)
  at
org.geowebcache.diskquota.storage.TilePageCalculator.getLayerNames(TilePageCalculator.java:78)
  at
org.geowebcache.diskquota.storage.BDBQuotaStore$StartUpInitializer.call(BDBQuotaStore.java:204)
  at
org.geowebcache.diskquota.storage.BDBQuotaStore$StartUpInitializer.call(BDBQuotaStore.java:186)
  ... 5 more

Hi John,

Unfortunately the dbconfig module is sort of unmaintained at the moment. That said, it looks like gwc is probably doing some initialization in a separate thread, which the hibernate startup does not like.

If you don’t need geowebcache, i would just disable it for now.

-Justin

On Tue, Jan 24, 2012 at 11:09 AM, John Armstrong <john.armstrong@anonymised.com> wrote:

Hi, all.

I’m trying to set up the hibernate-based catalog in GeoServer. I can’t
seem to get the war to build on its own, so I grabbed the latest from
(http://gridlock.opengeo.org/geoserver/2.1.x/), along with the compiled
dbconfig plugin from
(http://gridlock.opengeo.org/geoserver/2.1.x/community-latest/). After
adding the dbconfig jars (and an antlr jar for an exception class that
seemed to be missing) I try deploying the war to Tomcat. I keep getting a
LazyInitializationException (stack trace at the end) at this point.

Is there some other initialization/setup step I’m missing?

I don’t know if this is related: I see this page
(geoserver-users@anonymised.comists.sourceforge.net) that says the database is stored in
geoserver.db, but in my geoserver data directory I see instead

geoserver.1.log.db
geoserver.data.db
geoserver.index.db

Thanks in advance for any help you can offer.

Stack Trace

24 Jan 11:39:58 ERROR [context.ContextLoader] - Context initialization
failed
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name ‘gwcFacade’ defined in URL
[jar:file:/opt/devel/tools/apache-tomcat-7.0.12/webapps/geoserver/WEB-INF/lib/gwc-2.1-SNAPSHOT.jar!/geowebcache-geoserver-context.xml]:
Cannot resolve reference to bean ‘DiskQuotaStore’ while setting
constructor argument; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name ‘DiskQuotaStore’ defined in URL
[jar:file:/opt/devel/tools/apache-tomcat-7.0.12/webapps/geoserver/WEB-INF/lib/gwc-2.1-SNAPSHOT.jar!/geowebcache-diskquota-context.xml]:
Invocation of init method failed; nested exception is
org.hibernate.LazyInitializationException: could not initialize proxy - no
Session
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at
org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:495)
at
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:162)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at
org.geoserver.platform.GeoServerContextLoaderListener.contextInitialized(GeoServerContextLoaderListener.java:18)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701)
at
org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204)
at
org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name ‘DiskQuotaStore’ defined in URL
[jar:file:/opt/devel/tools/apache-tomcat-7.0.12/webapps/geoserver/WEB-INF/lib/gwc-2.1-SNAPSHOT.jar!/geowebcache-diskquota-context.xml]:
Invocation of init method failed; nested exception is
org.hibernate.LazyInitializationException: could not initialize proxy - no
Session
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
… 29 more
Caused by: org.hibernate.LazyInitializationException: could not initialize
proxy - no Session
at
org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:57)
at
org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
at
org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:150)
at
org.geoserver.catalog.impl.NamespaceInfoImpl$$EnhancerByCGLIB$$ce26dca8.getPrefix()
at
org.geoserver.catalog.impl.ResourceInfoImpl.getPrefixedName(ResourceInfoImpl.java:142)
at
org.geoserver.gwc.layer.CatalogConfiguration.getTileLayerNames(CatalogConfiguration.java:159)
at
org.geowebcache.layer.TileLayerDispatcher.getLayerNames(TileLayerDispatcher.java:135)
at
org.geowebcache.diskquota.storage.TilePageCalculator.getLayerNames(TilePageCalculator.java:78)
at
org.geowebcache.diskquota.storage.BDBQuotaStore$StartUpInitializer.call(BDBQuotaStore.java:204)
at
org.geowebcache.diskquota.storage.BDBQuotaStore$StartUpInitializer.call(BDBQuotaStore.java:186)
… 5 more


Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

And sorry, by disable i mean remove the jars. Or perhaps just the diskquota jar might do it, not 100% sure.

On Tue, Jan 24, 2012 at 3:20 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Hi John,

Unfortunately the dbconfig module is sort of unmaintained at the moment. That said, it looks like gwc is probably doing some initialization in a separate thread, which the hibernate startup does not like.

If you don’t need geowebcache, i would just disable it for now.

-Justin

On Tue, Jan 24, 2012 at 11:09 AM, John Armstrong <john.armstrong@anonymised.com> wrote:

Hi, all.

I’m trying to set up the hibernate-based catalog in GeoServer. I can’t
seem to get the war to build on its own, so I grabbed the latest from
(http://gridlock.opengeo.org/geoserver/2.1.x/), along with the compiled
dbconfig plugin from
(http://gridlock.opengeo.org/geoserver/2.1.x/community-latest/). After
adding the dbconfig jars (and an antlr jar for an exception class that
seemed to be missing) I try deploying the war to Tomcat. I keep getting a
LazyInitializationException (stack trace at the end) at this point.

Is there some other initialization/setup step I’m missing?

I don’t know if this is related: I see this page
(geoserver-users@lists.sourceforge.net) that says the database is stored in
geoserver.db, but in my geoserver data directory I see instead

geoserver.1.log.db
geoserver.data.db
geoserver.index.db

Thanks in advance for any help you can offer.

Stack Trace

24 Jan 11:39:58 ERROR [context.ContextLoader] - Context initialization
failed
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name ‘gwcFacade’ defined in URL
[jar:file:/opt/devel/tools/apache-tomcat-7.0.12/webapps/geoserver/WEB-INF/lib/gwc-2.1-SNAPSHOT.jar!/geowebcache-geoserver-context.xml]:
Cannot resolve reference to bean ‘DiskQuotaStore’ while setting
constructor argument; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name ‘DiskQuotaStore’ defined in URL
[jar:file:/opt/devel/tools/apache-tomcat-7.0.12/webapps/geoserver/WEB-INF/lib/gwc-2.1-SNAPSHOT.jar!/geowebcache-diskquota-context.xml]:
Invocation of init method failed; nested exception is
org.hibernate.LazyInitializationException: could not initialize proxy - no
Session
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at
org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:495)
at
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:162)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at
org.geoserver.platform.GeoServerContextLoaderListener.contextInitialized(GeoServerContextLoaderListener.java:18)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701)
at
org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204)
at
org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name ‘DiskQuotaStore’ defined in URL
[jar:file:/opt/devel/tools/apache-tomcat-7.0.12/webapps/geoserver/WEB-INF/lib/gwc-2.1-SNAPSHOT.jar!/geowebcache-diskquota-context.xml]:
Invocation of init method failed; nested exception is
org.hibernate.LazyInitializationException: could not initialize proxy - no
Session
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
… 29 more
Caused by: org.hibernate.LazyInitializationException: could not initialize
proxy - no Session
at
org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:57)
at
org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
at
org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:150)
at
org.geoserver.catalog.impl.NamespaceInfoImpl$$EnhancerByCGLIB$$ce26dca8.getPrefix()
at
org.geoserver.catalog.impl.ResourceInfoImpl.getPrefixedName(ResourceInfoImpl.java:142)
at
org.geoserver.gwc.layer.CatalogConfiguration.getTileLayerNames(CatalogConfiguration.java:159)
at
org.geowebcache.layer.TileLayerDispatcher.getLayerNames(TileLayerDispatcher.java:135)
at
org.geowebcache.diskquota.storage.TilePageCalculator.getLayerNames(TilePageCalculator.java:78)
at
org.geowebcache.diskquota.storage.BDBQuotaStore$StartUpInitializer.call(BDBQuotaStore.java:204)
at
org.geowebcache.diskquota.storage.BDBQuotaStore$StartUpInitializer.call(BDBQuotaStore.java:186)
… 5 more


Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

On Tue, 24 Jan 2012 15:21:15 -0700, Justin Deoliveira
<jdeolive@anonymised.com> wrote:

And sorry, by disable i mean remove the jars. Or perhaps just the

diskquota

jar might do it, not 100% sure.

On Tue, Jan 24, 2012 at 3:20 PM, Justin Deoliveira
<jdeolive@anonymised.com>wrote:

Hi John,

Unfortunately the dbconfig module is sort of unmaintained at the

moment.

That said, it looks like gwc is probably doing some initialization in a
separate thread, which the hibernate startup does not like.

If you don't need geowebcache, i would just disable it for now.

-Justin

Thanks; just to be sure I understand you, you think that it's something in
GWC that's conflicting with the Hibernate module? I'm not sure I
understand where you're getting that, but I'm willing to believe it.

On Tue, Jan 24, 2012 at 3:26 PM, John Armstrong <john.armstrong@anonymised.com> wrote:

On Tue, 24 Jan 2012 15:21:15 -0700, Justin Deoliveira
<jdeolive@anonymised.com> wrote:

And sorry, by disable i mean remove the jars. Or perhaps just the
diskquota
jar might do it, not 100% sure.

On Tue, Jan 24, 2012 at 3:20 PM, Justin Deoliveira
<jdeolive@anonymised.com>wrote:

Hi John,

Unfortunately the dbconfig module is sort of unmaintained at the
moment.
That said, it looks like gwc is probably doing some initialization in a
separate thread, which the hibernate startup does not like.

If you don’t need geowebcache, i would just disable it for now.

-Justin

Thanks; just to be sure I understand you, you think that it’s something in
GWC that’s conflicting with the Hibernate module? I’m not sure I
understand where you’re getting that, but I’m willing to believe it.

Sorry, allow me to explain better. The way hibernate is set up in geoserver is that a session is bound to a single request, or thread. If you try to access a hibernate backed bean that has a lazy property from outside that thread/session then you get this exception.

Now, during regular geoserver operation this is rarely an issue because essentially there is a filter in place that always set ups and tears down the thread local session, meaning that for the life of a single request/thread a valid session will always be present.

However, on startup we don’t have this same filter available, so we fake it. BAsically the code that loads the configuration creates a session before loading, and tears it down after loading. Again this session is bound to the current thread, which means if any components that initialize on startup do so in a separate thread, and they access a lazy property of a bean, then this exception occurs.

So yes, i am saying that gwc is doing just that, it is using a new thread to do some of its initialization on startup. Gabriel should be able to verify this but i am pretty sure i have run up against this one before.

Hope that makes it a bit clearer.

-Justin


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

On Tue, Jan 24, 2012 at 7:33 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

On Tue, Jan 24, 2012 at 3:26 PM, John Armstrong <john.armstrong@anonymised.com.>
wrote:

On Tue, 24 Jan 2012 15:21:15 -0700, Justin Deoliveira
<jdeolive@anonymised.com> wrote:
> And sorry, by disable i mean remove the jars. Or perhaps just the
diskquota
> jar might do it, not 100% sure.
>
> On Tue, Jan 24, 2012 at 3:20 PM, Justin Deoliveira
> <jdeolive@anonymised.com>wrote:
>
>> Hi John,
>>
>> Unfortunately the dbconfig module is sort of unmaintained at the
moment.
>> That said, it looks like gwc is probably doing some initialization in a
>> separate thread, which the hibernate startup does not like.
>>
>> If you don't need geowebcache, i would just disable it for now.
>>
>> -Justin

Thanks; just to be sure I understand you, you think that it's something in
GWC that's conflicting with the Hibernate module? I'm not sure I
understand where you're getting that, but I'm willing to believe it.

Sorry, allow me to explain better. The way hibernate is set up in geoserver
is that a session is bound to a single request, or thread. If you try to
access a hibernate backed bean that has a lazy property from outside that
thread/session then you get this exception.

Now, during regular geoserver operation this is rarely an issue because
essentially there is a filter in place that always set ups and tears down
the thread local session, meaning that for the life of a single
request/thread a valid session will always be present.

However, on startup we don't have this same filter available, so we fake it.
BAsically the code that loads the configuration creates a session before
loading, and tears it down after loading. Again this session is bound to the
current thread, which means if any components that initialize on startup do
so in a separate thread, and they access a lazy property of a bean, then
this exception occurs.

So yes, i am saying that gwc is doing just that, it is using a new thread to
do some of its initialization on startup. Gabriel should be able to verify
this but i am pretty sure i have run up against this one before.

Hope that makes it a bit clearer.

Right. My understanding is that anything that calls the catalog
outside an http client request will suffer from this. GWC is an
example, as it may also do that if you want to seed the cache. Another
example is could think of, but didn't really tried, is the wps module,
as it can run async processes.

I don't know what the general practice to avoid that kind of lazy
initialization errors with hibernate is though.

Cheers,
Gabriel

-Justin

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

--
Gabriel Roldan
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Hmmm… perhaps some sort of callback interface where code that needs to do something from a separate thread can do something, and the executor can ensure that a hibernate session is there.

An alternative would be an different hibernate configuration… like disabling lazy loading which you pay a performance hit for.

I also believe with spring there is a way to proxy in such a way that creates sessions on demand etc… to be honest i am a bit ignorant when it comes to hibernate.

On Tue, Jan 24, 2012 at 4:06 PM, Gabriel Roldan <groldan@anonymised.com> wrote:

On Tue, Jan 24, 2012 at 7:33 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

On Tue, Jan 24, 2012 at 3:26 PM, John Armstrong <john.armstrong@anonymised.com>
wrote:

On Tue, 24 Jan 2012 15:21:15 -0700, Justin Deoliveira
<jdeolive@anonymised.com> wrote:

And sorry, by disable i mean remove the jars. Or perhaps just the
diskquota
jar might do it, not 100% sure.

On Tue, Jan 24, 2012 at 3:20 PM, Justin Deoliveira
<jdeolive@anonymised.com.>wrote:

Hi John,

Unfortunately the dbconfig module is sort of unmaintained at the
moment.
That said, it looks like gwc is probably doing some initialization in a
separate thread, which the hibernate startup does not like.

If you don’t need geowebcache, i would just disable it for now.

-Justin

Thanks; just to be sure I understand you, you think that it’s something in
GWC that’s conflicting with the Hibernate module? I’m not sure I
understand where you’re getting that, but I’m willing to believe it.

Sorry, allow me to explain better. The way hibernate is set up in geoserver
is that a session is bound to a single request, or thread. If you try to
access a hibernate backed bean that has a lazy property from outside that
thread/session then you get this exception.

Now, during regular geoserver operation this is rarely an issue because
essentially there is a filter in place that always set ups and tears down
the thread local session, meaning that for the life of a single
request/thread a valid session will always be present.

However, on startup we don’t have this same filter available, so we fake it.
BAsically the code that loads the configuration creates a session before
loading, and tears it down after loading. Again this session is bound to the
current thread, which means if any components that initialize on startup do
so in a separate thread, and they access a lazy property of a bean, then
this exception occurs.

So yes, i am saying that gwc is doing just that, it is using a new thread to
do some of its initialization on startup. Gabriel should be able to verify
this but i am pretty sure i have run up against this one before.

Hope that makes it a bit clearer.

Right. My understanding is that anything that calls the catalog
outside an http client request will suffer from this. GWC is an
example, as it may also do that if you want to seed the cache. Another
example is could think of, but didn’t really tried, is the wps module,
as it can run async processes.

I don’t know what the general practice to avoid that kind of lazy
initialization errors with hibernate is though.

Cheers,
Gabriel

-Justin


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.


Gabriel Roldan
OpenGeo - http://opengeo.org
Expert service straight from the developers.


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.