Skip to content

Geofence not working on 26.0 release (2.28.x-georchestra-geofence) #400

Description

@Dallery

Hi,

I have just upgraded my geOrchestra installation from 24.x to 26.0 and I am using Geofence with Geoserver.

The docker-compose.yml file associated with the feat: init docker 26 commit specifies that version 2.28.4-georchestra-00 should be used.

I therefore changed the relevant line to use the GeoFence image named 2.28.4-georchestra-00-geofence (like i saw on hub.docker), and I updated the other configuration elements according to the documentation, as I had previously done for version 24.x.

After starting the container, I got a 503 error on my geoserver website. The logs contained the following message Cannot load JDBC driver class 'org.h2.Driver' except that i use the same configuration like here : https://github.com/georchestra/datadir/blob/docker-26.0/geoserver/geofence/geofence-datasource-ovr.properties

However, the file located at /etc/georchestra/geoserver/geofence/geofence-datasource-ovr.properties in my geoserver container was indeed the same as the one provided in config/geoserver/geofence/geofence-datasource-ovr.properties.

It seems 2.28.4-georchestra-00-geofence image does not take this configuration file into account and prefer use the H2 default configuration.

As a result, I switched to the GeoServer version used in the 26.0 release, namely 2.28.2-georchestra-geofence.

GeoServer then started correctly with the same configuration file, il just changed the name of image in docker-compose.yml, and the 503 error disappeared.

However, although I can access the GeoFence page on my geoserver, I cannot access the GeoFence Rules page or the Administration Rules GeoFence page. I receive the following message:

org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public org.geoserver.geofence.server.web.GeofenceServerPage()'. An exception has been thrown during construction!
	[...]
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source)
	at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
	at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:175)
	... 146 more
Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is java.lang.NoSuchMethodError: 'org.hibernate.FlushMode org.hibernate.Session.getFlushMode()'
	at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:431)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.startTransaction(AbstractPlatformTransactionManager.java:400)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:595)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:382)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:241)
	at jdk.proxy3/jdk.proxy3.$Proxy113.findAll(Unknown Source)
	at org.geoserver.geofence.services.RuleAdminServiceImpl.getAll(RuleAdminServiceImpl.java:185)
	at org.geoserver.geofence.server.web.GeofenceRulesModel.<init>(GeofenceRulesModel.java:104)
	at org.geoserver.geofence.server.web.GeofenceServerPage.<init>(GeofenceServerPage.java:75)
	... 152 more
Caused by: java.lang.NoSuchMethodError: 'org.hibernate.FlushMode org.hibernate.Session.getFlushMode()'
	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.prepareFlushMode(HibernateJpaDialect.java:187)
	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.beginTransaction(HibernateJpaDialect.java:173)
	at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:380)
	... 163 more

So, is there an issue with the GeoServer 2.28.x GeoFence images, or did something change between the 24.x and 26.x releases that I need to adapt in order to get GeoFence working properly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions