Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing bbox_cache.properties causes NPE #825

Closed
lgoltz opened this issue Apr 25, 2017 · 1 comment
Closed

Removing bbox_cache.properties causes NPE #825

lgoltz opened this issue Apr 25, 2017 · 1 comment
Labels
bug error issue and bug (fix)

Comments

@lgoltz
Copy link
Contributor

lgoltz commented Apr 25, 2017

Removing the bbox_cache.properties file causes to NullPointerExceptions in some cases. We observed two different NPEs:

  1. NPE during reload
    If the bbox_cache.properties file is removed during deegree is running layers cannot be initialised after a workspace reload.
    The layers with errors during insert are vector layers with SQLFeatureStore and does not contain data.

Stacktrace:

[12:24:10] ERROR: [DefaultWorkspace] Unable to build resource LayerStoreProvider:fplan: Could not parse layer configuration file: null
org.deegree.workspace.ResourceInitException: Unable to build resource LayerStoreProvider:fplan: Could not parse layer configuration file: null
	at org.deegree.workspace.standard.DefaultWorkspace.init(DefaultWorkspace.java:397)
	at org.deegree.workspace.WorkspaceUtils.reinitializeChain(WorkspaceUtils.java:89)
	at org.deegree.console.Config.activate(Config.java:105)
	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.apache.el.parser.AstValue.invoke(AstValue.java:245)
	at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:277)
	at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:101)
[12:24:27] Dirk Stenger: Caused by: org.deegree.workspace.ResourceInitException: Could not parse layer configuration file: null
	at org.deegree.layer.persistence.feature.FeatureLayerStoreBuilder.build(FeatureLayerStoreBuilder.java:85)
	at org.deegree.layer.persistence.feature.FeatureLayerStoreBuilder.build(FeatureLayerStoreBuilder.java:49)
	at org.deegree.workspace.standard.DefaultWorkspace.init(DefaultWorkspace.java:379)
	... 44 more
Caused by: java.lang.NullPointerException
	at org.deegree.layer.persistence.feature.LayerMetadataBuilder.buildMetadata(LayerMetadataBuilder.java:107)
	at org.deegree.layer.persistence.feature.ManualFeatureLayerBuilder.buildFeatureLayers(ManualFeatureLayerBuilder.java:116)
	at org.deegree.layer.persistence.feature.FeatureLayerStoreBuilder.build(FeatureLayerStoreBuilder.java:83)
	... 46 more
  1. NPE during insert
    This also requires that the store is empty. Steps to reproduce:
  • remove bbox_cache.properties
  • Reload Workspace
  • GetCapabilities with POST (this seems to be important)
  • Insert (stacktrace below)

The error only occurs if the last two steps are executed one after another with less than a few seconds between.

Stacktrace:

deegree3  | java.lang.NullPointerException
deegree3  | 	at org.deegree.feature.persistence.cache.BBoxPropertiesCache.encodePropValue(BBoxPropertiesCache.java:197)
deegree3  | 	at org.deegree.feature.persistence.cache.BBoxPropertiesCache.persist(BBoxPropertiesCache.java:149)
deegree3  | 	at org.deegree.feature.persistence.cache.BBoxPropertiesCache.set(BBoxPropertiesCache.java:137)
deegree3  | 	at org.deegree.feature.persistence.sql.SQLFeatureStoreTransaction.updateBBoxCache(SQLFeatureStoreTransaction.java:213)
deegree3  | 	at org.deegree.feature.persistence.sql.SQLFeatureStoreTransaction.commit(SQLFeatureStoreTransaction.java:183)
deegree3  | 	at org.deegree.services.wfs.TransactionHandler.doTransaction(TransactionHandler.java:264)
deegree3  | 	at org.deegree.services.wfs.WebFeatureService.doXML(WebFeatureService.java:983)
deegree3  | 	at org.deegree.services.controller.OGCFrontController.dispatchXMLRequest(OGCFrontController.java:895)
deegree3  | 	at org.deegree.services.controller.OGCFrontController.doPost(OGCFrontController.java:502)
deegree3  | 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
@tfr42 tfr42 added the bug error issue and bug (fix) label May 29, 2017
@tfr42 tfr42 added this to the 3.4 milestone May 29, 2017
@tfr42 tfr42 removed this from the 3.4 milestone Apr 7, 2018
@julianzz98 julianzz98 self-assigned this Dec 1, 2023
@julianzz98
Copy link
Contributor

The following tests were conducted using deegree 3.5.0:

  1. Locally deployed deegree 3.5.0
  2. Start workspace with database connection, wms and layers (database is empty)
  3. Removed bbox_cache.properties
  4. Reloaded workspace

The following output is given by the logs:

2023-12-01 17:11:22,856 INFO o.d.f.p.c.BBoxPropertiesCache [http-nio-8080-exec-8] File '/root/.deegree/xplansyn-wms-workspace/datasources/feature/bbox_cache.properties' does not exist. Will be created as needed.

The workspace reload was successful and a new bbox_cache.properties was created (could be from PR #1477).

Therefore I am considering this issue obsolete and close it.

@julianzz98 julianzz98 removed their assignment Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug error issue and bug (fix)
Projects
None yet
Development

No branches or pull requests

3 participants