[Geoserver-devel] [JIRA] (GEOS-9212) GeoFence Internal Server plugin gives NPE when run from web/app

Torben Barsballe created an issue

GeoServer / BugGEOS-9212

GeoFence Internal Server plugin gives NPE when run from web/app

Issue Type:

BugBug

Assignee:

Unassigned

Components:

GeoFence

Created:

13/May/19 7:48 PM

Priority:

MediumMedium

Reporter:

Torben Barsballe

The geofence-server profile does not work properly when running from the demo web app - the beans in geofence-services-impl-3.4.2.jar/applicationContext.xml do not get loaded at startup, leading to NPEs on all of the GeoFence admin pages.

For example:

    ...
Caused by: java.lang.NullPointerException
    at org.hibernate.impl.SessionFactoryImpl.getClassMetadata(SessionFactoryImpl.java:807)
    at com.googlecode.genericdao.search.hibernate.HibernateMetadataUtil.get(HibernateMetadataUtil.java:92)
    at com.googlecode.genericdao.dao.jpa.JPABaseDAO._all(JPABaseDAO.java:206)
    at com.googlecode.genericdao.dao.jpa.GenericDAOImpl.findAll(GenericDAOImpl.java:61)
    at org.geoserver.geofence.core.dao.impl.RuleDAOImpl.findAll(RuleDAOImpl.java:101)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
    at com.sun.proxy.$Proxy39.findAll(Unknown Source)
    at org.geoserver.geofence.services.RuleAdminServiceImpl.getAll(RuleAdminServiceImpl.java:189)
    at org.geoserver.geofence.web.GeofenceRulesModel.<init>(GeofenceRulesModel.java:99)
    at org.geoserver.geofence.web.GeofenceServerPage.<init>(GeofenceServerPage.java:68)
    ... 124 more

I have been able to reproduce this when running the web app through Intellij, with both the geofence and geofence-server profiles enabled, as well as through maven, using mvn jetty:run -Pgeofence,geofence-server

Note: This does not affect a normal WAR install of the GeoFence Internal Server plugin.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100101-sha1:5e04bb1)

Atlassian logo