Genesys Backend issueshttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues2019-01-31T12:07:34+01:00https://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/407RequestRejectedException logging2019-01-31T12:07:34+01:00Matija ObrezaRequestRejectedException loggingAdd `RequestRejectedException` to `UserControllerAdvice` as `@ResponseStatus(HttpStatus.BAD_REQUEST)`.
Our logs are filling up with log entires on invalid requests like `/zh%20https://dx.doi.org/10.18730/J69RS`:
```
2019-01-22T21:44:49...Add `RequestRejectedException` to `UserControllerAdvice` as `@ResponseStatus(HttpStatus.BAD_REQUEST)`.
Our logs are filling up with log entires on invalid requests like `/zh%20https://dx.doi.org/10.18730/J69RS`:
```
2019-01-22T21:44:49.178472275Z 2019-01-22 21:44:49.174:WARN:oejs.HttpChannel:qtp2027961269-136: /zh%20https://dx.doi.org/10.18730/J69RS
2019-01-22T21:44:49.178523532Z org.springframework.security.web.firewall.RequestRejectedException: The request was rejected because the URL was not normalized.
2019-01-22T21:44:49.178536170Z at org.springframework.security.web.firewall.StrictHttpFirewall.getFirewalledRequest(StrictHttpFirewall.java:123)
2019-01-22T21:44:49.178544339Z at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:193)
2019-01-22T21:44:49.178552584Z at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
2019-01-22T21:44:49.178559971Z at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
2019-01-22T21:44:49.178566143Z at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
2019-01-22T21:44:49.178572666Z at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
2019-01-22T21:44:49.178578859Z at org.genesys2.server.servlet.filter.LocaleURLFilter.doFilter(LocaleURLFilter.java:179)
2019-01-22T21:44:49.178585336Z at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
2019-01-22T21:44:49.178592151Z at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:293)
2019-01-22T21:44:49.178598490Z at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
2019-01-22T21:44:49.178604983Z at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
2019-01-22T21:44:49.178613303Z at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
2019-01-22T21:44:49.178620417Z at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
2019-01-22T21:44:49.178627557Z at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
2019-01-22T21:44:49.178633984Z at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
2019-01-22T21:44:49.178640652Z at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
```2.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/406Audited Subset2019-01-24T15:04:13+01:00Matija ObrezaAudited SubsetMake `Subset` an audited entity.Make `Subset` an audited entity.2.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/405Transaction boundaries2019-01-22T13:35:13+01:00Matija ObrezaTransaction boundariesWe're doing something wrong either in the AuditLog or in the AccessionProcessor. It may have something to do with `REQUIRES_NEW` which will conflict with inserting audit logs (at level 1):
```java
@Override
public void beforeTransacti...We're doing something wrong either in the AuditLog or in the AccessionProcessor. It may have something to do with `REQUIRES_NEW` which will conflict with inserting audit logs (at level 1):
```java
@Override
public void beforeTransactionCompletion(final Transaction tx) {
if (level == 1 && auditLogs.get().size() > 0) {
LOG.trace("We have {} auditlogs", auditLogs.get().size());
auditLogs.get().stream().forEach(auditLog -> {
LOG.debug("Audit log to save: {}", auditLog);
});
this.auditTrailService.addAuditLogs(auditLogs.get());
auditLogs.get().clear();
}
super.beforeTransactionCompletion(tx);
}
```
I guess we need to add level-specific `auditLogs` lists.
```
13:24:19,215 genesys-background-2 DEBUG o.g.s.m.a.AdminController:366 - Assigned 654 tileIndexes
13:24:20,302 qtp147403080-32 INFO o.g.s.s.w.AccessionProcessor:198 - Processing Accessions took 4088907ms
13:24:20,335 qtp147403080-32 ERROR o.h.i.SessionImpl:521 - HHH000088: Exception in interceptor beforeTransactionCompletion()
org.springframework.orm.jpa.JpaSystemException: could not execute statement; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:333)
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:244)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:525)
at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:209)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:57)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy340.save(Unknown Source)
at sun.reflect.GeneratedMethodAccessor575.invoke(Unknown Source)
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:333)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:52)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:52)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy341.save(Unknown Source)
at org.genesys.blocks.auditlog.service.impl.AuditTrailServiceImpl.addAuditLogs(AuditTrailServiceImpl.java:75)
at sun.reflect.GeneratedMethodAccessor585.invoke(Unknown Source)
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:333)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy342.addAuditLogs(Unknown Source)
at org.genesys.blocks.auditlog.component.AuditTrailInterceptor.beforeTransactionCompletion(AuditTrailInterceptor.java:719)
at org.genesys2.spring.config.DatabaseConfig$1.beforeTransactionCompletion(DatabaseConfig.java:214)
at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:518)
at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:105)
at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:177)
at org.hibernate.jpa.internal.TransactionImpl.commit(TransactionImpl.java:77)
at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:517)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:765)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:734)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:518)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:292)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671)
at org.genesys2.server.service.worker.AccessionProcessor$$EnhancerBySpringCGLIB$$7a6edb7c.apply(<generated>)
at org.genesys2.server.mvc.admin.AdminController.updateTileIndex(AdminController.java:348)
at org.genesys2.server.mvc.admin.AdminController$$FastClassBySpringCGLIB$$958b96d7.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:69)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671)
at org.genesys2.server.mvc.admin.AdminController$$EnhancerBySpringCGLIB$$183bd5b0.updateTileIndex(<generated>)
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.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:215)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.sitemesh.webapp.contentfilter.ContentBufferingFilter.bufferAndPostProcess(ContentBufferingFilter.java:169)
at org.sitemesh.webapp.contentfilter.ContentBufferingFilter.doFilter(ContentBufferingFilter.java:126)
at org.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:120)
at org.sitemesh.config.ConfigurableSiteMeshFilter.doFilter(ConfigurableSiteMeshFilter.java:163)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:121)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:124)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.genesys2.server.servlet.filter.LocaleURLFilter.doFilter(LocaleURLFilter.java:179)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:293)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:389)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1634)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:503)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.hibernate.exception.GenericJDBCException: could not execute statement
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:211)
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:96)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:58)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3032)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3558)
at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:98)
at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:492)
at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:197)
at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:181)
at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:216)
at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:334)
at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:289)
at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:195)
at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:126)
at org.hibernate.jpa.event.internal.core.JpaPersistEventListener.saveWithGeneratedId(JpaPersistEventListener.java:84)
at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:206)
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:149)
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:75)
at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:811)
at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:784)
at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:789)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1181)
at sun.reflect.GeneratedMethodAccessor582.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:300)
at com.sun.proxy.$Proxy208.persist(Unknown Source)
at org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:508)
at org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:542)
at org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:74)
at sun.reflect.GeneratedMethodAccessor576.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:515)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:500)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:477)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:56)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
... 171 more
Caused by: java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:898)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:887)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:861)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2044)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)
at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:208)
... 214 more
13:24:20,345 qtp147403080-32 WARN o.g.s.m.a.AdminController:370 - Done recalculating tileIndexes
```2.4Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/404Frontend URL2019-01-27T17:19:18+01:00Matija ObrezaFrontend URLThe server "public URL" is configured in `.properties`:
```
host.name=localhost
host.nameAndPort=${host.name}
base.url=http://${host.name}:8080
```
and these values are used as the base url in emails, redirects, sitemap controller, etc...The server "public URL" is configured in `.properties`:
```
host.name=localhost
host.nameAndPort=${host.name}
base.url=http://${host.name}:8080
```
and these values are used as the base url in emails, redirects, sitemap controller, etc. With the new website, we need another setting `frontend.url` where we can configure the URL to be used.
```
frontend.url=http://localhost:3000
```
Find references to `base.url` in code and replace with `frontend.url` as appropriate.2.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/402Filter by WorldClim data2019-01-17T16:44:30+01:00Matija ObrezaFilter by WorldClim dataIntroduce a new `WorldClim` model with type `Double` properties: ***tileIndex* as primary key** `+ private Double ` *alt tmin1 tmax1 tmean1 prec1 tmin2 tmax2 tmean2 prec2 tmin3 tmax3 tmean3 prec3 tmin4 tmax4 tmean4 prec4 tmin5 tmax5 tmea...Introduce a new `WorldClim` model with type `Double` properties: ***tileIndex* as primary key** `+ private Double ` *alt tmin1 tmax1 tmean1 prec1 tmin2 tmax2 tmean2 prec2 tmin3 tmax3 tmean3 prec3 tmin4 tmax4 tmean4 prec4 tmin5 tmax5 tmean5 prec5 tmin6 tmax6 tmean6 prec6 tmin7 tmax7 tmean7 prec7 tmin8 tmax8 tmean8 prec8 tmin9 tmax9 tmean9 prec9 tmin10 tmax10 tmean10 prec10 tmin11 tmax11 tmean11 prec11 tmin12 tmax12 tmean12 prec12 bio1 bio2 bio3 bio4 bio5 bio6 bio7 bio8 bio9 bio10 bio11 bio12 bio13 bio14 bio15*.
Variable names are explained at http://worldclim.org/bioclim and http://worldclim.org/formats1 -- we need this for the UI.
All properties need their own database index.
Introduce a `WorldclimService` and `*Repository` as needed.
Update the `WorldclimUpdater` to update the new entity, not the DS2 dataset.
~~http://localhost:8080/admin/ds2/ -- update WC, then migrate current `DS2` **worldclim.org** dataset to the new model -- MVC admin action only.~~
Add `private Worldclim climate` to `AccessionGeo`, it should use the `accessionGeo#tileIndex` to link to the corresponding `WorldClim` entity. This will include the climate data in the Elasticsearch index and enable "Overviews" to work.
Implement a new filter `WorldclimFilter` with `NumberFilter` for all variables in `WorldClim` model. Add `public WorldclimFilter climate` to `AccessionFilter` to allow filtering by climatic properties.
Update `WorldclimUpdater` to use WorldClim 2.0 at http://worldclim.org/version2
2.4Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/401Download MCPD for subsets and datasets2019-01-17T21:06:59+01:00Matija ObrezaDownload MCPD for subsets and datasetsAdd API endpoints to generate and stream Excel with MCPD passport data for any:
- subset
- dataset
Add buttons to UI.Add API endpoints to generate and stream Excel with MCPD passport data for any:
- subset
- dataset
Add buttons to UI.2.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/400Remove AuditedModel class2019-01-11T18:28:58+01:00Matija ObrezaRemove AuditedModel classUpgrade entities that extend `AuditedModel` (`Article`, `ITPGRFAStatus`, `Organization`, `VerificationToken`) to use `AuditedVersionedModel`.
Remove `AuditedModel` from the code.
Update liquibase.Upgrade entities that extend `AuditedModel` (`Article`, `ITPGRFAStatus`, `Organization`, `VerificationToken`) to use `AuditedVersionedModel`.
Remove `AuditedModel` from the code.
Update liquibase.2.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/399Accession with RepositoryFolder2019-01-15T11:26:44+01:00Matija ObrezaAccession with RepositoryFolderWe currently store accession-related images and files in the file repository at a specific path `/wiews/${instCode}/acn/${acceNumb}`. When loading full accession information, we check if such folder exists (by convention). This makes it ...We currently store accession-related images and files in the file repository at a specific path `/wiews/${instCode}/acn/${acceNumb}`. When loading full accession information, we check if such folder exists (by convention). This makes it difficult when ACCENUMB contains `/`.
Update `AccessionId` and add properties:
- `private RepositoryFolder repositoryFolder;`
- `private int imageCount;`
The `GenesysImageGalleryAspects` needs to be extended and the `repositoryFolder` (of the `ImageGallery`) recorded with the `Accession`. The `imageCount` in the `AccessionId` should be updated after each image `save` or `delete` in the accession's image gallery.2.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/398Fix: KPI List of available metrics2019-01-07T18:24:00+01:00Matija ObrezaFix: KPI List of available metricsImplementation of `KPIServiceImpl#listExecutions` returns Executions where user has direct READ permission assigned.
Change this to `List<Execution>` with `@PostFilter("hasPermission(returnObject, ...`
# List of available metrics
**GE...Implementation of `KPIServiceImpl#listExecutions` returns Executions where user has direct READ permission assigned.
Change this to `List<Execution>` with `@PostFilter("hasPermission(returnObject, ...`
# List of available metrics
**GET** _/api/v1/kpi/observations_ returns the list of **names** of available metrics:
```json
[ "accession.updates","accessions.count","accessions.doi","dataset.accessions","institute.pdci"... ]
```2.4Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/397AppliedFiltersConverter for sciName2019-01-31T12:07:33+01:00Matija ObrezaAppliedFiltersConverter for sciNameShould filter on full name in Taxonomy2.
```
Caused by: java.lang.RuntimeException: Unhandled Taxonomy filter property=sciName
at org.genesys2.server.service.filter.AppliedFiltersConverter.apply(AppliedFiltersConverter.java:405)
at...Should filter on full name in Taxonomy2.
```
Caused by: java.lang.RuntimeException: Unhandled Taxonomy filter property=sciName
at org.genesys2.server.service.filter.AppliedFiltersConverter.apply(AppliedFiltersConverter.java:405)
at org.genesys2.server.service.filter.AppliedFiltersConverter.convert(AppliedFiltersConverter.java:156)
at org.genesys2.server.service.filter.AccessionFilter.convert(AccessionFilter.java:195)
```2.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/395Google Sign-in authentication system2019-01-31T12:07:33+01:00Matija ObrezaGoogle Sign-in authentication systemMigrate from the **Google+ Sign-In** feature to the more comprehensive **Google Sign-in authentication system**. The Google+ Sign-In will be deprecated in late January 2019.
This affects the user logins on Genesys. Please update the bac...Migrate from the **Google+ Sign-In** feature to the more comprehensive **Google Sign-in authentication system**. The Google+ Sign-In will be deprecated in late January 2019.
This affects the user logins on Genesys. Please update the backend code in `GoogleOAuthUtil`.2.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/394CMS Activity post API v12018-12-24T17:06:23+01:00Matija ObrezaCMS Activity post API v1Upgrade `ActivityPost` to `AuditedVersionedModel`. Update liquibase with `version = 1`.
Add `ActivityPostFilter` and add `listActivityPosts` method with filtering and pagination to CMS controller v1. The Filter can extend `AuditedVersio...Upgrade `ActivityPost` to `AuditedVersionedModel`. Update liquibase with `version = 1`.
Add `ActivityPostFilter` and add `listActivityPosts` method with filtering and pagination to CMS controller v1. The Filter can extend `AuditedVersionedModelFilter`. Filter with keyword search on title and body.
2.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/393Download Genesys1 descriptor lists by crop2018-12-24T10:54:49+01:00Matija ObrezaDownload Genesys1 descriptor lists by cropGenesys1 came with a trait database and descriptor definitions. We will be migrating the data from traits database to Catalog entries and we can already export the data in Catalog-compliant Excel file.
To ensure that trait descriptors f...Genesys1 came with a trait database and descriptor definitions. We will be migrating the data from traits database to Catalog entries and we can already export the data in Catalog-compliant Excel file.
To ensure that trait descriptors from Genesys **1** are properly migrated, add support to download descriptor definitions **by crop** in Catalog format for import to the Catalog.
https://www.genesys-pgr.org/c/wheat/descriptors should allow for downloading the data for importing as **new descriptor list** to Genesys. When registering and uploading the original datasets, we will be able to reuse descriptor definitions across all imports.2.4Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/392KPI alias2018-12-23T22:36:42+01:00Matija ObrezaKPI aliasI'm not able to set `accession.historic` as an alias of ExecutionGroup; the query fails.I'm not able to set `accession.historic` as an alias of ExecutionGroup; the query fails.2.4Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/391MCPD Excel: Include LASTUPDATED2018-12-22T13:16:08+01:00Matija ObrezaMCPD Excel: Include LASTUPDATEDUpdate template and the code to include column `LASTMODIFIED` with date from `accession#lastModifiedDate`.Update template and the code to include column `LASTMODIFIED` with date from `accession#lastModifiedDate`.2.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/390Multiple matching descriptors2018-12-20T17:11:59+01:00Matija ObrezaMultiple matching descriptors`Descriptor searchMatchingDescriptor()` in descriptor service uses `findOne()`. When multiple matches are found this causes an exception to be thrown.
Update to `List<> searchMatchingDescriptor()` and return all matches. Update UI accor...`Descriptor searchMatchingDescriptor()` in descriptor service uses `findOne()`. When multiple matches are found this causes an exception to be thrown.
Update to `List<> searchMatchingDescriptor()` and return all matches. Update UI accordingly.2.4Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/389Export trait data in Catalog dataset template2018-12-19T22:38:39+01:00Matija ObrezaExport trait data in Catalog dataset templateGenesys has a searchable trait database of C&E data. The list of "datasets" is available at https://www.genesys-pgr.org/data/.
It is possible to download the "dataset" as a DwC-A CSV+ZIP file (DarwinCore Archive) that contains all recor...Genesys has a searchable trait database of C&E data. The list of "datasets" is available at https://www.genesys-pgr.org/data/.
It is possible to download the "dataset" as a DwC-A CSV+ZIP file (DarwinCore Archive) that contains all records relating to this dataset.
Add a controller endpoint that will generate the Excel version using the current Catalog Dataset template based on trait data in the database.2.4Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/388KPI Executions ACL2018-12-24T09:07:37+01:00Matija ObrezaKPI Executions ACLWe wish to make some Executions publicly accessible, some restricted and some only for ADMIN.
Update KPI `Execution` to support permissions and update KPI service implementation:
- Updating `Execution` requires WRITE permission
- Readi...We wish to make some Executions publicly accessible, some restricted and some only for ADMIN.
Update KPI `Execution` to support permissions and update KPI service implementation:
- Updating `Execution` requires WRITE permission
- Reading `Execution` or any of its observations requires READ permission
- Add API endpoint to `listExecutions` to KPIReadController. It should return a list of executions but only the `name` and `title` properties.
Please update the UI and add "Permissions" button to KPI Execution display page.2.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/387KPI group by with null2018-12-19T18:44:29+01:00Matija ObrezaKPI group by with nullGroup by in our KPI implementation does not capture `null` values. The run below does not contain the count where `crop is null`:
![image](/uploads/3c5ce8ba09518c0d0e89140a5ab72eb6/image.png)
Entities must be left joined in JPA for `nu...Group by in our KPI implementation does not capture `null` values. The run below does not contain the count where `crop is null`:
![image](/uploads/3c5ce8ba09518c0d0e89140a5ab72eb6/image.png)
Entities must be left joined in JPA for `null` to be considered as a "group". JPA defaults to inner join.2.4Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/385ApplicationStartup actions to /admin actions2018-12-18T21:39:57+01:00Matija ObrezaApplicationStartup actions to /admin actionsWe now have a number of actions executed in `ApplicationStartup` and they have all been executed on the sandbox and production servers.
Please move these actions to MVC /admin controller and add action buttons to `/jsp/admin/index.jsp`...We now have a number of actions executed in `ApplicationStartup` and they have all been executed on the sandbox and production servers.
Please move these actions to MVC /admin controller and add action buttons to `/jsp/admin/index.jsp`.
Add these actions as POST endpoints to Admin v1 Controller -- or create one if it doesn't exist.2.4Maxym BorodenkoMaxym Borodenko