deegree / deegree3

Official deegree repository providing geospatial core libraries, data access and advanced OGC web service implementations
https://www.deegree.org
GNU Lesser General Public License v2.1
146 stars 99 forks source link

Unable to build resource: Referenced attribute doesn't exist (xlink:type). #1030

Open lglref32team2 opened 4 years ago

lglref32team2 commented 4 years ago

Hi!

Since the update from Version 3.4.3 to 3.4.11 we experience difficulties using xlink in an application schema. Even in an existing workspace which worked fine before the errors start to appear. The application schema and the database tables are created automatically.

When we create and load the feature it works and starts without any errors. As soon as we activate and deactivate the database connection and sometimes when we activate and deactivate the feature itself the following error appears:

Unable to build resource FeatureStoreProvider:ps_fgeo_waldschutz: Error in mapping of table 'fgeo_waldschutz.ps_protectedsite_ps_legalfoundationdocument_gmd_ci_citation_g_3': java.lang.IllegalArgumentException: Unable to match XPath '-PropertyName ('@xlink:type')' to application schema. Referenced attribute does not exist.

After turning the debug logging on we found the following error in the log: 2020-01-24 07:15:45,862 DEBUG [org.deegree.filter.expression.ValueReference] XPath: [(DefaultRelativeLocationPath): [(DefaultNameStep): gmd:date]] 2020-01-24 07:15:45,862 DEBUG [org.deegree.filter.expression.ValueReference] gmd -> http://www.isotc211.org/2005/gmd 2020-01-24 07:15:45,862 DEBUG [org.deegree.filter.expression.ValueReference] QName: {http://www.isotc211.org/2005/gmd}date 2020-01-24 07:15:45,862 DEBUG [org.deegree.feature.persistence.sql.config.MappedSchemaBuilderGML] Building mapping for path '@xlink:type' on element '<"http://www.isotc211.org/2005/gmd":date, false>' 2020-01-24 07:15:45,862 DEBUG [org.deegree.filter.expression.ValueReference] XPath: [(DefaultRelativeLocationPath): [(DefaultNameStep): xlink:type]] 2020-01-24 07:15:45,862 DEBUG [org.deegree.filter.expression.ValueReference] xlink -> null 2020-01-24 07:15:45,862 ERROR [org.deegree.workspace.standard.DefaultWorkspace] Unable to build resource FeatureStoreProvider:ps_fgeo_waldschutz: Error in mapping of table 'fgeo_waldschutz.ps_protectedsite_ps_legalfoundationdocument_gmd_ci_citation_g_3': java.lang.IllegalArgumentException: Unable to match XPath '-PropertyName ('@xlink:type')

Usually it should be something like this: 2020-01-24 08:45:42,301 DEBUG [org.deegree.feature.persistence.sql.config.MappedSchemaBuilderGML] Building mapping for path '@xlink:type' on element '<"http://www.isotc211.org/2005/gmd":date, false>' 2020-01-24 08:45:42,301 DEBUG [org.deegree.filter.expression.ValueReference] XPath: [(DefaultRelativeLocationPath): [(DefaultNameStep): xlink:type]] 2020-01-24 08:45:42,301 DEBUG [org.deegree.filter.expression.ValueReference] xlink -> http://www.w3.org/1999/xlink 2020-01-24 08:45:42,301 DEBUG [org.deegree.feature.persistence.sql.config.MappedSchemaBuilderGML] Targeted primitive type: <STRING, true>

The full stack trace can be found here: [08:08:40] ERROR: [DefaultWorkspace] Unable to build resource FeatureStoreProvider:ps_fgeo_waldschutz: Error in mapping of table 'fgeo_waldschutz.ps_protectedsi te_ps_legalfoundationdocument_gmd_ci_citation_g_3': java.lang.IllegalArgumentException: Unable to match XPath '-PropertyName ('@xlink:type') ' to application schema. Referenced attribute does not exist. org.deegree.workspace.ResourceInitException: Unable to build resource FeatureStoreProvider:ps_fgeo_waldschutz: Error in mapping of table 'fgeo_waldschutz.ps_pro tectedsite_ps_legalfoundationdocument_gmd_ci_citation_g_3': java.lang.IllegalArgumentException: Unable to match XPath '-PropertyName ('@xlink:type') ' to application schema. Referenced attribute does not exist. at org.deegree.workspace.standard.DefaultWorkspace.init(DefaultWorkspace.java:398) 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:247) at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:267) 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) at javax.faces.component.UICommand.broadcast(UICommand.java:315) at com.sun.faces.facelets.component.UIRepeat.broadcast(UIRepeat.java:927) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:786) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1251) at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.deegree.client.core.filter.InputFileFilter.doFilter(InputFileFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:836) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1839) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: org.deegree.workspace.ResourceInitException: Error in mapping of table 'fgeo_waldschutz.ps_protectedsite_ps_legalfoundationdocument_gmd_ci_citation_g _3': java.lang.IllegalArgumentException: Unable to match XPath '-PropertyName ('@xlink:type') ' to application schema. Referenced attribute does not exist. at org.deegree.feature.persistence.sql.SQLFeatureStore.init(SQLFeatureStore.java:1589) at org.deegree.workspace.standard.DefaultWorkspace.init(DefaultWorkspace.java:388) ... 44 more Caused by: java.lang.RuntimeException: Error in mapping of table 'fgeo_waldschutz.ps_protectedsite_ps_legalfoundationdocument_gmd_ci_citation_g_3': java.lang.Il legalArgumentException: Unable to match XPath '-PropertyName ('@xlink:type') ' to application schema. Referenced attribute does not exist. at org.deegree.feature.persistence.sql.config.MappedSchemaBuilderGML.buildMapping(MappedSchemaBuilderGML.java:390) at org.deegree.feature.persistence.sql.config.MappedSchemaBuilderGML.buildMapping(MappedSchemaBuilderGML.java:367) at org.deegree.feature.persistence.sql.config.MappedSchemaBuilderGML.buildMapping(MappedSchemaBuilderGML.java:454) at org.deegree.feature.persistence.sql.config.MappedSchemaBuilderGML.buildMapping(MappedSchemaBuilderGML.java:376) at org.deegree.feature.persistence.sql.config.MappedSchemaBuilderGML.buildMapping(MappedSchemaBuilderGML.java:454) at org.deegree.feature.persistence.sql.config.MappedSchemaBuilderGML.buildMapping(MappedSchemaBuilderGML.java:376) at org.deegree.feature.persistence.sql.config.MappedSchemaBuilderGML.buildMapping(MappedSchemaBuilderGML.java:454) at org.deegree.feature.persistence.sql.config.MappedSchemaBuilderGML.buildMapping(MappedSchemaBuilderGML.java:376) at org.deegree.feature.persistence.sql.config.MappedSchemaBuilderGML.buildFtMapping(MappedSchemaBuilderGML.java:327) at org.deegree.feature.persistence.sql.config.MappedSchemaBuilderGML.(MappedSchemaBuilderGML.java:173) at org.deegree.feature.persistence.sql.config.AbstractMappedSchemaBuilder.build(AbstractMappedSchemaBuilder.java:125) at org.deegree.feature.persistence.sql.SQLFeatureStore.init(SQLFeatureStore.java:1587) ... 45 more

I attached the workspace and the sql statements. deegree-workspace-inspire_public.zip featureStore.txt

Thanks in advance for every hint and help!

copierrj commented 4 years ago

Could you investigate which version between 3.4.3 and 3.4.11 is the last one that actually works?

lglref32team2 commented 4 years ago

I checked all versions between 3.4.0 and 3.4.4 and the error is reproducable in all versions. So maybe my predeccessor had found the same issue and thought it's not important.

It's very reproducable:

  1. Activate feature -> Everything is working fine
  2. Deactivate database connection
  3. Activate database connection -> the feature is failing to start again.

From now on we need to keep an eye on the production server.

tfr42 commented 4 years ago

This may be a regression or was introduced with PR #787, #837, #879 (all included in 3.4.0). You may check if this behavior is reproducible with versions earlier than 3.4-RC4. You can download RC versions from here: http://repo.deegree.org/content/groups/public/org/deegree/deegree-webservices/

lglref32team2 commented 4 years ago

Thanks for all the input!

Same in 3.4-RC3. I couldn't test it in earlier Versions since I would have to change the schema and the database settings.

tfr42 commented 3 years ago

That is understandable. For now we keep this issue open since it has not been resolved. Contributions are welcome.