Sure, we tried but that didn’t solve the issue with the lock of the H2 database. For now, adding the ;AUTO_SERVER=TRUE to the db connection string seem doing the trick in this setup.
Thanks for the feedback provided.
···
On Wed, Apr 6, 2016 at 12:30 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:
Note that you can clear formatter cache from admin console.
–
On Wed, Apr 6, 2016 at 12:25 PM, Jose Garcia <jose.garcia@anonymised.com> wrote:
Hi
Solved the issue with the lock using ;AUTO_SERVER=TRUE when creating the h2 connection in FilesystemStore. Also now the rendering looks much faster, not sure if related to this or previously the server had some performance issue.
I’ll test a bit more that doesn’t cause issues and will commit the change.
Regards,
Jose García
–
camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS
Florent Gravin
0479444492
On Wed, Apr 6, 2016 at 11:19 AM, Jose Garcia <jose.garcia@anonymised.com> wrote:
Hi
Finally cleaning the formatter folder before a deployment, looks fixing partially. The first record I try shows up the full view, but for next records the following error is displayed in the console:
Apache Tomcat/7.0.42 - Error report HTTP Status 500 - Request processing failed; nested exception is java.lang.RuntimeException: org.h2.jdbc.JdbcSQLException: Database may be already in use: "Locked by another process". Possible solutions: close all other connection(s); use the server mode [90020-174]
type Exception report
message Request processing failed; nested exception is java.lang.RuntimeException: org.h2.jdbc.JdbcSQLException: Database may be already in use: "Locked by another process". Possible solutions: close all other connection(s); use the server mode [90020-174]
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.RuntimeException: org.h2.jdbc.JdbcSQLException: Database may be already in use: "Locked by another process". Possible solutions: close all other connection(s); use the server mode [90020-174]
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:965)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
…
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
root cause
java.lang.RuntimeException: org.h2.jdbc.JdbcSQLException: Database may be already in use: "Locked by another process". Possible solutions: close all other connection(s); use the server mode [90020-174]
jeeves.transaction.TransactionManager.runInTransaction(TransactionManager.java:98)
jeeves.config.springutil.JeevesDispatcherServlet.doDispatch(JeevesDispatcherServlet.java:24)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
…
Seem the cache is using a h2 database to store the cached formatters, that unfortunately in my customer setup causes some lock issues, what is really unfortunate. Not clear why not used the default database setup in GeoNetwork for the cache, instead of adding a new level of complexity with a new db in the system for the cache, but possibly I’m missing something here.
At least disabling the cache seem somehow working, with the downside of taking ages (and this unfortunately not a joke) to show the full view for the records. Maybe would be better to get back to the old xslt formatter for full view until this groovy/cache stuffs works fine.
Regards,
Jose García
–
Vriendelijke groeten / Kind regards,
Jose García
Veenderweg 13
6721 WD Bennekom
The Netherlands
T: +31 (0)318 416664
Please consider the environment before printing this email.
On Tue, Apr 5, 2016 at 4:35 PM, Jose Garcia <jose.garcia@anonymised.com> wrote:
Hi Florent
Thanks again for your help.
I can’t debug from IntelliJ as the problem occurs in a server where I have very limited access. Unfortunately, locally with a similar configuration works fine. So most probably is related to some configuration difference, but nothing obvious and unfortunately the error thrown is not very clear and makes things really hard.
Regards,
Jose García
–
Vriendelijke groeten / Kind regards,
Jose García
Veenderweg 13
6721 WD Bennekom
The Netherlands
T: +31 (0)318 416664
Please consider the environment before printing this email.
On Tue, Apr 5, 2016 at 4:30 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:
I’m not used either.
You should be able to configure your Intellij to debug the groovy code, i don’t know how, but Jesse did debug the groovy.
Otherwise, just print thing in the metadata to debug (return something from your handler).
I dont really know, i haven’t really worked on this part.
–
Vriendelijke groeten / Kind regards,
Jose García
Veenderweg 13
6721 WD Bennekom
The Netherlands
T: +31 (0)318 416664
Please consider the environment before printing this email.
On Tue, Apr 5, 2016 at 4:27 PM, Jose Garcia <jose.garcia@anonymised.com> wrote:
Hi Florent
Thanks for this. I’ll check as it happens in other metadata for different model properties.
Related to the debug of groovy code, is it possible to add some debug messages in groovy files to get logged in geonetwork.log file? I’m not very use to groovy.
Regards,
Jose García
–
camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS
Florent Gravin
0479444492
On Tue, Apr 5, 2016 at 4:13 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:
Hi,
Seems it happens there https://github.com/geonetwork/core-geonetwork/blob/develop/schemas/iso19139/src/main/plugin/iso19139/formatter/html/graphic-overview.html#L29
The model you send to this template might miss some properties.
Check where it is done, and try to debug it:
https://github.com/geonetwork/core-geonetwork/blob/60dfc3f87019b3760700d89c45ba009d2c5e9bb9/schemas/iso19139/src/main/plugin/iso19139/formatter/groovy/iso19139/Handlers.groovy#L330
So one element of your graphics is either null, or doesnt contain a src property.
–
Vriendelijke groeten / Kind regards,
Jose García
Veenderweg 13
6721 WD Bennekom
The Netherlands
T: +31 (0)318 416664
Please consider the environment before printing this email.
On Tue, Apr 5, 2016 at 4:03 PM, Jose Garcia <jose.garcia@anonymised.com> wrote:
Hi
Maybe someone has an idea of what can be causing this issue that is driving me really crazy. When trying to access the full metadata view in the detail page or print to pdf I get this exception and nothing is displayed to the user:
org.fao.geonet.services.metadata.format.groovy.template.TemplateException: There is no object in the model map with the id ‘g’ in the model map. The model selection expression is: g.src’.
The current options are:
[graphics, label]
at org.fao.geonet.services.metadata.format.groovy.template.TRenderContext.getModelValue(TRenderContext.java:123)
at org.fao.geonet.services.metadata.format.groovy.template.TRenderContext.getModelValue(TRenderContext.java:97)
at org.fao.geonet.services.metadata.format.groovy.template.TextContentReplacement.text(TextContentReplacement.java:21)
at org.fao.geonet.services.metadata.format.groovy.template.TextBlock.render(TextBlock.java:23)
at org.fao.geonet.services.metadata.format.groovy.template.TNodeTextContent.render(TNodeTextContent.java:21)
at org.fao.geonet.services.metadata.format.groovy.template.FileResult.toString(FileResult.java:29)
at java.lang.String.valueOf(String.java:2847)
at java.lang.StringBuilder.append(StringBuilder.java:128)
at org.fao.geonet.services.metadata.format.groovy.Handler.processResult(Handler.java:75)
at org.fao.geonet.services.metadata.format.groovy.Handler.handle(Handler.java:55)
at org.fao.geonet.services.metadata.format.groovy.TransformEngine.processElement(TransformEngine.java:76)
at org.fao.geonet.services.metadata.format.groovy.TransformEngine.processChildren(TransformEngine.java:110)
at org.fao.geonet.services.metadata.format.groovy.TransformEngine.processElementsInMode(TransformEngine.java:33)
at org.fao.geonet.services.metadata.format.groovy.Handlers.processElementsInMode(Handlers.java:586)
at org.fao.geonet.services.metadata.format.groovy.Handlers.processElements(Handlers.java:557)
at org.fao.geonet.services.metadata.format.groovy.Handlers$processElements$7.call(Unknown Source)
at common.Handlers$_entryEl_closure3.doCall(Handlers.groovy:50)
at sun.reflect.GeneratedMethodAccessor498.invoke(Unknown Source)
Exception is thrown in https://github.com/geonetwork/core-geonetwork/blob/3.0.x/services/src/main/java/org/fao/geonet/services/metadata/format/groovy/template/TRenderContext.java#L112-L114
I got similar errors with other metadata with different values of model properties, but for now can’t figure out whats wrong and unfortunately seem there’s no much documentation about this formatter feature or at least I haven’t find it.
If someone has an idea what can be causing this or any point to documentation that can help would be really appreciated.
Regards,
Jose García
–
Vriendelijke groeten / Kind regards,
Jose García
Veenderweg 13
6721 WD Bennekom
The Netherlands
T: +31 (0)318 416664
Please consider the environment before printing this email.
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
–
camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS
Florent Gravin
0479444492
Vriendelijke groeten / Kind regards,
Jose García
Veenderweg 13
6721 WD Bennekom
The Netherlands
T: +31 (0)318 416664
Please consider the environment before printing this email.