grails / grails-cache Goto Github PK
View Code? Open in Web Editor NEWGrails Cache Plugin
Home Page: https://plugins.grails.org/plugin/grails/cache
Grails Cache Plugin
Home Page: https://plugins.grails.org/plugin/grails/cache
The monolithic grails project has been broken up into several smaller projects. Visit http://github.com/grails.
Ideally this would be done similar to @Transactional
to stop the usage of spring proxys. This is the kind of code that I would like to see no longer necessary
class AbcService {
def grailsApplication
@Cacheable("myCache")
def list(String role) {
...
}
def adminList() {
grailsApplication.mainContext.abcService.list("ROLE_ADMIN")
}
}
Currently the we need to add each version manually adding version of the index page.
The compilation of CustomCacheKeyGenerator.groovy CacheKey.hashCode() and TemporaryGrailsCacheKey.hashCode() implementation into bytecode ignores the targetClassName
, targetMethodName
& simpleKey
decompiled bytecode:
public int hashCode() {
int prime = 31;
int result = 1;
int var3 = prime * result;
boolean var10000;
if (this.simpleKey == null) {
var10000 = false;
} else {
this.simpleKey.hashCode();
}
int var4 = prime * var3;
if (this.targetClassName == null) {
var10000 = false;
} else {
this.targetClassName.hashCode();
}
int var5 = prime * var4;
if (this.targetMethodName == null) {
var10000 = false;
} else {
this.targetMethodName.hashCode();
}
int var6 = prime * var5 + this.targetObjectHashCode;
return var6;
}
Using Grails 4.0.0.M1 and Gradle 5.1.1, just a simple new project with a service
package cacheableissue
import grails.plugin.cache.Cacheable
class FooService {
@Cacheable("fooService")
def calculateSomething() {
return "foo"
}
}
Fails to compile with:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileGroovy'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:95)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:119)
at org.gradle.api.internal.tasks.execution.ResolvePreviousStateExecuter.execute(ResolvePreviousStateExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:93)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:45)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:94)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:56)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:67)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:315)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:305)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:101)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:49)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: BUG! exception in phase 'canonicalization' in source unit '/Users/along/play/cacheableIssue/grails-app/services/cacheableissue/FooService.groovy' unexpected NullpointerException
at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:179)
at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:57)
at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:80)
at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:68)
at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:86)
at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:74)
at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:42)
at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:36)
at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:110)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157)
at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
... 3 more
Caused by: java.lang.NullPointerException
at org.grails.datastore.gorm.transform.OrderedGormTransformation.collectAndOrderGormTransformations(OrderedGormTransformation.groovy:87)
at org.grails.datastore.gorm.transform.OrderedGormTransformation.visit(OrderedGormTransformation.groovy:55)
... 17 more
As of plugin version 4.0.0 controller caching is no longer supported, but if we add the @Cacheable annotation above a controller method the expected behavior should be that the annotation is ignored and the controller action is execute, currently this does not happen and the method is executed only the first time as if it were being cached but this causes serious problems since if the controller action receives parameters it would always be showing the same result.
class personController {
@Cacheable('show')
def show (Long id) {
println "I'm in ${id}"
}
}
In the first execution it would return I am in 1
but if we call the method again passing it the id 2 the action is not executed because the method is already cached, causing an inconsistency in the response. If caching is no longer supported for controller actions, the action must be executed every time
I'm receiving a NullPointerException here: https://github.com/grails-plugins/grails-cache/blob/master/grails-app/taglib/grails/plugin/cache/CacheTagLib.groovy#L116
I assume there's an issue where groovyPagesTemplateRenderer is not being injected properly.
My code looks like this: <cache:render template="path/to/template" key="1000" />
This issue is related to #49.
grails -v
Grails Version: 3.3.7
Groovy Version: 2.4.15
JVM Version: 1.8.0_222
The following service method will give the stacktrace below. Issue is with how the key is formed.
It works without the @transactional annotation. Version of cache plugin is 4.0.3.
@Transactional(readOnly=true)
@Cacheable(value='codes', key={code + '' + layer})
def getCachedData(String code, String layer){
return 'some code'
}
Caused by: java.lang.NoSuchMethodError: java.lang.String.plus(Ljava/lang/CharSequence;)Ljava/lang/String;
at helloworld.SimpleService$__tt__getCachedData_closure4.doCall(SimpleService.groovy:89)
at grails.plugin.cache.CustomCacheKeyGenerator.generate(CustomCacheKeyGenerator.groovy:115)
at grails.gorm.transactions.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:94)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
Please add a simple "time to live" functionality, e.g. using Java Timer would be more than enough.
Thank you.
The jar file cannot include the logback.xml file without breaking builds which rely on it and do not want to use the xml file.
For instance those builds which use the logback configurator will not supply an xml file and currently the snapshot build suplants the xml file in place thereby overriding built in logging
I coded like this:
@Cacheable(value = "AuthToken", key = { key })
def getAuthToken(String key) {
return key
}
but comes an error:
[Static type checking] - The variable [key] is undeclared.
Can u help me?
Consider a method annotated with grails.plugin.cache.Cacheable.
testgsp.PanelsRefresher
@Cacheable(value="gabiTest") public Integer gabiTest() { log.info("Gabi is testing") return 5 }
Consider an aspect that should be executed when gabiTest method is executed:
`@Aspect
@slf4j
class TestAspect {
@Around("execution(* testgsp.PanelsRefresher.gabi*())")
public Object gabiAspect(ProceedingJoinPoint jp) {
def result
log.info("Aspect for gabi before.")
try {
result = jp.proceed()
} catch (Exception e) {
log.info("Exception execution method ${jp.getSignature().getName()}",e)
result = jp.proceed()
}
log.info("Aspect for gabi after.")
return result
}`
The aspect will be executed every time, even if the result is cached.
Sample output when executing PanelsRefresher.gabiTest() multiple times:
2019-01-14 15:20:15.151 INFO --- [ main] testgsp.PanelsRefresher : Gabi is testing 2019-01-14 15:20:15.151 INFO --- [ main] testgsp.TestAspect : Aspect for gabi after. 2019-01-14 15:20:15.152 INFO --- [ main] testgsp.TestAspect : Aspect for gabi before. 2019-01-14 15:20:15.155 INFO --- [ main] testgsp.TestAspect : Aspect for gabi after. 2019-01-14 15:20:15.155 INFO --- [ main] testgsp.TestAspect : Aspect for gabi before. 2019-01-14 15:20:15.155 INFO --- [ main] testgsp.TestAspect : Aspect for gabi after. 2019-01-14 15:20:15.155 INFO --- [ main] testgsp.TestAspect : Aspect for gabi before. 2019-01-14 15:20:15.155 INFO --- [ main] testgsp.TestAspect : Aspect for gabi after. 2019-01-14 15:20:15.156 INFO --- [ main] testgsp.TestAspect : Aspect for gabi before. 2019-01-14 15:20:15.156 INFO --- [ main] testgsp.TestAspect : Aspect for gabi after. 2019-01-14 15:20:15.156 INFO --- [ main] testgsp.TestAspect : Aspect for gabi before. 2019-01-14 15:20:15.156 INFO --- [ main] testgsp.TestAspect : Aspect for gabi after.
This is not reproducible when using the spring Cacheable annotation, together with @EnableCaching annotation on Application.groovy.
I am using grails 3.3.9 with grails cache plugin 4.0.1. In grails 2.5.2, with cache:1.1.8 this works fine.
This is wrecking havoc on our layout rendering.
When no key closure is specified, the key generator ignores the targetMethodName. V4.0.0 works fine.
All the "demo" gsp views are still included in 5.0.0 and 5.0.1.
This includes the views.properties file along with all the gsp compiled class files eg gsp_cachenotFound_gsp
This is breaking any builds which use grails-views as the SiteMeshViewResolver is tested for view resolution before any others and any views which match those stored in the gsp/views.properties files are breaking the codebases.
Specifically the notFound view is a major issue as this is a common view.
#Precompiled views for cache
#Wed Mar 16 12:40:34 UTC 2022
/WEB-INF/grails-app/views/demo/blockCacheTTL.gsp=gsp_cache_demoblockCacheTTL_gsp
/WEB-INF/grails-app/views/demo/renderTag.gsp=gsp_cache_demorenderTag_gsp
/WEB-INF/grails-app/views/notFound.gsp=gsp_cachenotFound_gsp
/WEB-INF/grails-app/views/demo/blockCache.gsp=gsp_cache_demoblockCache_gsp
/WEB-INF/grails-app/views/demo/renderTagTTL.gsp=gsp_cache_demorenderTagTTL_gsp
/WEB-INF/grails-app/views/demo/_counterTemplate.gsp=gsp_cache_demo_counterTemplate_gsp
/WEB-INF/grails-app/views/layouts/main.gsp=gsp_cache_layoutsmain_gsp
Plugin does not work on Grails 3.2.8
gradlew build
fails with
FAILURE: Build failed with an exception.
org.grails.datastore.gorm.transform.AbstractMethodDecoratingTransformation.buildDelegatingMethodCall(Lorg/codehaus/groovy/control/SourceUnit;Lorg/codehaus/groovy/ast/Annotat
ionNode;Lorg/codehaus/groovy/ast/ClassNode;Lorg/codehaus/groovy/ast/MethodNode;Lorg/codehaus/groovy/ast/expr/MethodCallExpression;Lorg/codehaus/groovy/ast/stmt/BlockStatement;
)Lorg/codehaus/groovy/ast/expr/MethodCallExpression;
Gradle task groovydoc
output:
Executing task 'groovydoc'...
line 49:56: unexpected token: >
:groovydoc
ERROR [org.codehaus.groovy.tools.groovydoc.GroovyRootDocBuilder] ignored due to RecognitionException: grails/plugin/cache/GrailsConcurrentLinkedMapCache.java [expecting EOF, found '}']
Error is caused by GROOVY-8628: Groovydoc fails to parse Java static nested classes with diamond operator
I suggest to use explicit type arguments as a workaround until a fix is included in dependency org.codehaus.groovy:groovy
.
No ETag created for assets in the "src/main/webapp" directory even when we create production war and deploy it to an standalone tomcat(8.0.26).
After upgrading to grails 3.1.7 we are seeing stack overflows in our system when accessing a url like /login/auth?dest=/home.jsp&et_cid=4597690&[email protected]&CTList=Mature&CTCredit=%%AccountProductTypeCode%%&CTid=267&CTCampName=RateReview_New&CTTestGrp=Bazaarvoice_Sub_Prod_Join&CTTemp=2016-05-31
It is unclear if this is actually a grails-cache issue or a grails core issue. We can not get this to happen locally.
java.lang.IllegalStateException: Could not get HttpServletRequest URI: Malformed escape pair at index 129: http://www.xxxxxxx.com/errors/serverError500?dest=/home.jsp&et_cid=4597690&[email protected]&CTList=Mature&CTCredit=%%AccountProductTypeCode%%&CTid=267&CTCampName=RateReview_New&CTTestGrp=Bazaarvoice_Sub_Prod_Join&CTTemp=2016-05-31
07:34:01.112 -0500 07:34:01.112 xxxxxxxxxx.corp.pgcore.com [http-nio-8080-exec-28] ERROR StackTrace - Full Stack Trace:
java.net.URISyntaxException: Malformed escape pair at index 118: http://www.xxxxxx.com/login/auth?dest=/home.jsp&et_cid=4597690&[email protected]&CTList=Mature&CTCredit=%%AccountProductTypeCode%%&CTid=267&CTCampName=RateReview_New&CTTestGrp=Bazaarvoice_Sub_Prod_Join&CTTemp=2016-05-31
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.scanEscape(URI.java:2978)
at java.net.URI$Parser.scan(URI.java:3001)
at java.net.URI$Parser.checkChars(URI.java:3019)
at java.net.URI$Parser.parseHierarchical(URI.java:3111)
at java.net.URI$Parser.parse(URI.java:3053)
at java.net.URI.(URI.java:588)
at org.springframework.http.server.ServletServerHttpRequest.getURI(ServletServerHttpRequest.java:96)
at org.springframework.web.util.UriComponentsBuilder.fromHttpRequest(UriComponentsBuilder.java:282)
at org.springframework.web.util.WebUtils.isSameOrigin(WebUtils.java:814)
at org.springframework.web.cors.DefaultCorsProcessor.processRequest(DefaultCorsProcessor.java:76)
at org.springframework.web.servlet.handler.AbstractHandlerMapping$CorsInterceptor.preHandle(AbstractHandlerMapping.java:503)
at org.springframework.web.servlet.HandlerExecutionChain.applyPreHandle(HandlerExecutionChain.java:134)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:956)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ApplicationContextHeaderFilter.doFilterInternal(EndpointWebMvcAutoConfiguration.java:261)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:115)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:75)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
07:34:13.482 bcpaprod101.corp.pgcore.com [http-nio-8080-exec-28] WARN g.p.c.w.f.s.MemoryPageFragmentCachingFilter - Throwable thrown during doFilter on request with URI: /errors/serverError500 and Query: dest=/home.jsp&et_cid=4597690&et_rid=[email protected]&CTList=Mature&CTCredit=%%AccountProductTypeCode%%&CTid=267&CTCampName=RateReview_New&CTTestGrp=Bazaarvoice_Sub_Prod_Join&CTTemp=2016-05-31 : Request processing failed; nested exception is org.grails.core.exceptions.GrailsRuntimeException: javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.grails.core.exceptions.GrailsRuntimeException: javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.grails.core.exceptions.GrailsRuntimeException: javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.grails.core.exceptions.GrailsRuntimeException: javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.grails.core.exceptions.GrailsRuntimeException: javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.grails.core.exceptions.GrailsRuntimeException: javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.grails.core.exceptions.GrailsRuntimeException: javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.grails.core.exceptions.GrailsRuntimeException: javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.grails.core.exceptions.GrailsRuntimeException: javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.grails.core.exceptions.GrailsRuntimeException: javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.grails.core.exceptions.GrailsRuntimeException: javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.grails.core.exceptions.GrailsRuntimeException: javax.servlet.ServletException: java.lang.StackOverflowError
gpars depends on groovy-all, which causes lots of unneeded jars in the war file, like testng or groovy-test.
Maybe exclude groovy-all from gpars.
Grails 5.0.2 example:
+--- org.grails.plugins:cache -> 4.0.3
| +--- org.codehaus.gpars:gpars:1.2.0
| | +--- org.multiverse:multiverse-core:0.7.0
| | +--- org.codehaus.jsr166-mirror:jsr166y:1.7.0
| | --- org.codehaus.groovy:groovy-all:2.1.9 -> 3.0.7
| | +--- org.codehaus.groovy:groovy:3.0.7
| | +--- org.codehaus.groovy:groovy-ant:3.0.7 ()
| | +--- org.codehaus.groovy:groovy-astbuilder:3.0.7
| | | --- org.codehaus.groovy:groovy:3.0.7
| | +--- org.codehaus.groovy:groovy-cli-picocli:3.0.7
| | | +--- org.codehaus.groovy:groovy:3.0.7
| | | --- info.picocli:picocli:4.5.2 -> 4.6.1
| | +--- org.codehaus.groovy:groovy-console:3.0.7
| | | +--- org.codehaus.groovy:groovy:3.0.7
| | | +--- org.codehaus.groovy:groovy-templates:3.0.7 ()
| | | --- org.codehaus.groovy:groovy-swing:3.0.7
| | | --- org.codehaus.groovy:groovy:3.0.7
| | +--- org.codehaus.groovy:groovy-datetime:3.0.7
| | | --- org.codehaus.groovy:groovy:3.0.7
| | +--- org.codehaus.groovy:groovy-docgenerator:3.0.7 ()
| | +--- org.codehaus.groovy:groovy-groovydoc:3.0.7 ()
| | +--- org.codehaus.groovy:groovy-groovysh:3.0.7
| | | +--- org.codehaus.groovy:groovy-templates:3.0.7 ()
| | | +--- org.codehaus.groovy:groovy:3.0.7
| | | +--- org.codehaus.groovy:groovy-console:3.0.7 ()
| | | +--- org.codehaus.groovy:groovy-xml:3.0.7 ()
| | | --- jline:jline:2.14.6
| | +--- org.codehaus.groovy:groovy-jmx:3.0.7
| | | --- org.codehaus.groovy:groovy:3.0.7
| | +--- org.codehaus.groovy:groovy-json:3.0.7 ()
| | +--- org.codehaus.groovy:groovy-jsr223:3.0.7
| | | --- org.codehaus.groovy:groovy:3.0.7
| | +--- org.codehaus.groovy:groovy-macro:3.0.7
| | | --- org.codehaus.groovy:groovy:3.0.7
| | +--- org.codehaus.groovy:groovy-nio:3.0.7
| | | --- org.codehaus.groovy:groovy:3.0.7
| | +--- org.codehaus.groovy:groovy-servlet:3.0.7
| | | +--- org.codehaus.groovy:groovy:3.0.7
| | | +--- org.codehaus.groovy:groovy-templates:3.0.7 ()
| | | --- org.codehaus.groovy:groovy-xml:3.0.7 ()
| | +--- org.codehaus.groovy:groovy-sql:3.0.7 ()
| | +--- org.codehaus.groovy:groovy-swing:3.0.7 ()
| | +--- org.codehaus.groovy:groovy-templates:3.0.7 ()
| | +--- org.codehaus.groovy:groovy-test:3.0.7
| | | +--- org.codehaus.groovy:groovy:3.0.7
| | | --- junit:junit:4.13.1 -> 4.13.2 ()
| | +--- org.codehaus.groovy:groovy-test-junit5:3.0.7
| | | +--- org.codehaus.groovy:groovy:3.0.7
| | | +--- org.junit.jupiter:junit-jupiter-api:5.7.0 -> 5.7.2
| | | | +--- org.junit:junit-bom:5.7.2 ()
| | | | +--- org.opentest4j:opentest4j:1.2.0
| | | | --- org.junit.platform:junit-platform-commons:1.7.2
| | | | --- org.junit:junit-bom:5.7.2 ()
| | | +--- org.junit.platform:junit-platform-launcher:1.7.0 -> 1.7.2
| | | | +--- org.junit:junit-bom:5.7.2 ()
| | | | --- org.junit.platform:junit-platform-engine:1.7.2
| | | | +--- org.junit:junit-bom:5.7.2 ()
| | | | +--- org.opentest4j:opentest4j:1.2.0
| | | | --- org.junit.platform:junit-platform-commons:1.7.2 ()
| | | --- org.junit.jupiter:junit-jupiter-engine:5.7.0 -> 5.7.2
| | | +--- org.junit:junit-bom:5.7.2 ()
| | | +--- org.junit.platform:junit-platform-engine:1.7.2 ()
| | | --- org.junit.jupiter:junit-jupiter-api:5.7.2 ()
| | +--- org.codehaus.groovy:groovy-testng:3.0.7
| | | +--- org.codehaus.groovy:groovy:3.0.7
| | | --- org.testng:testng:7.3.0
| | | --- com.beust:jcommander:1.78
| | --- org.codehaus.groovy:groovy-xml:3.0.7 (*)
| +--- com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4.2
| --- org.javassist:javassist:3.17.1-GA -> 3.28.0-GA
Releases page says:
PLEASE USE VERSION 5.0.1 WITH GRAILS 4 AND VERSION 6.0.0 WITH GRAILS 5
But version 6.0.0 isn't published/released.
In development time, I tried to disable the cache functionality.
The documentation says "grails.cache.enabled | true | Whether to enable the plugin"
When I use grails.cache.enabled = false, I'm getting the follow error:
Any idea? Or I'm missing something here
I'm using some tags for all project I would not like to change all them, just to work on development time.
After getting the error in the client app, I created a new project in isolation to reproduce it. Steps to recreate:
curl -O start.grails.org/VerifyCacheConfig.zip -d version=3.3.6 -d profile=rest-api
compile "org.grails.plugins:cache"
grails:
cache:
cacheManager: GrailsConcurrentLinkedMapCacheManager
caches:
foo:
maxCapacity: 5000
bar:
maxCapacity: 10000
bootrun
startup:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsCacheConfiguration': Could not bind properties to CachePluginConfiguration (prefix=grails.cache, ignoreInvalidFields=false, ignoreUnknownFields=true, ignoreNestedProperties=false); nested exception is org.springframework.beans.NullValueInNestedPathException: Invalid property 'caches[foo]' of bean class [grails.plugin.cache.CachePluginConfiguration]: Could not instantiate property type [grails.plugin.cache.CachePluginConfiguration$CacheConfig] to auto-grow nested property path; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [grails.plugin.cache.CachePluginConfiguration$CacheConfig]: Is it an abstract class?; nested exception is java.lang.InstantiationException: grails.plugin.cache.CachePluginConfiguration$CacheConfig
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:336)
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:292)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1626)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at grails.boot.GrailsApp.run(GrailsApp.groovy:84)
at grails.boot.GrailsApp.run(GrailsApp.groovy:393)
at grails.boot.GrailsApp.run(GrailsApp.groovy:380)
at grails.boot.GrailsApp$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:136)
at verifycacheconfig.Application.main(Application.groovy:8)
Caused by: org.springframework.beans.NullValueInNestedPathException: Invalid property 'caches[foo]' of bean class [grails.plugin.cache.CachePluginConfiguration]: Could not instantiate property type [grails.plugin.cache.CachePluginConfiguration$CacheConfig] to auto-grow nested property path; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [grails.plugin.cache.CachePluginConfiguration$CacheConfig]: Is it an abstract class?; nested exception is java.lang.InstantiationException: grails.plugin.cache.CachePluginConfiguration$CacheConfig
at org.springframework.beans.AbstractNestablePropertyAccessor.newValue(AbstractNestablePropertyAccessor.java:931)
at org.springframework.beans.AbstractNestablePropertyAccessor.createDefaultPropertyValue(AbstractNestablePropertyAccessor.java:899)
at org.springframework.beans.AbstractNestablePropertyAccessor.setDefaultValue(AbstractNestablePropertyAccessor.java:887)
at org.springframework.beans.AbstractNestablePropertyAccessor.getNestedPropertyAccessor(AbstractNestablePropertyAccessor.java:851)
at org.springframework.beans.AbstractNestablePropertyAccessor.getPropertyAccessorForPropertyPath(AbstractNestablePropertyAccessor.java:825)
at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:268)
at org.springframework.boot.bind.RelaxedDataBinder$RelaxedBeanWrapper.setPropertyValue(RelaxedDataBinder.java:726)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:95)
at org.springframework.validation.DataBinder.applyPropertyValues(DataBinder.java:860)
at org.springframework.validation.DataBinder.doBind(DataBinder.java:756)
at org.springframework.boot.bind.RelaxedDataBinder.doBind(RelaxedDataBinder.java:137)
at org.springframework.validation.DataBinder.bind(DataBinder.java:741)
at org.springframework.boot.bind.PropertiesConfigurationFactory.doBindPropertiesToTarget(PropertiesConfigurationFactory.java:287)
at org.springframework.boot.bind.PropertiesConfigurationFactory.bindPropertiesToTarget(PropertiesConfigurationFactory.java:250)
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:331)
... 24 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [grails.plugin.cache.CachePluginConfiguration$CacheConfig]: Is it an abstract class?; nested exception is java.lang.InstantiationException: grails.plugin.cache.CachePluginConfiguration$CacheConfig
at org.springframework.beans.BeanUtils.instantiate(BeanUtils.java:80)
at org.springframework.beans.AbstractNestablePropertyAccessor.newValue(AbstractNestablePropertyAccessor.java:926)
... 38 common frames omitted
Caused by: java.lang.InstantiationException: grails.plugin.cache.CachePluginConfiguration$CacheConfig
at org.springsource.loaded.ri.Exceptions.instantiation(Exceptions.java:118)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlClassNewInstance(ReflectiveInterceptor.java:1059)
at org.springframework.beans.BeanUtils.instantiate(BeanUtils.java:77)
... 39 common frames omitted
Given a simple service class annotated with @CurrentTenant
:
@CurrentTenant
@Transactional(readOnly = true)
class MultiTenantCachingService {
@Cacheable('test')
def serviceMethod() {
}
}
Calling serviceMethod()
throws the following exception:
No such property: tenantId for class: org.grails.MultiTenantCachingService
groovy.lang.MissingPropertyException: No such property: tenantId for class: org.grails.MultiTenantCachingService
at org.grails.MultiTenantCachingServiceSpec.$tt__$spock_feature_0_1(MultiTenantCachingServiceSpec.groovy:29)
at org.grails.MultiTenantCachingServiceSpec.multi-tenant service method with @Cacheable annotation doesn't throw an exception_closure2(MultiTenantCachingServiceSpec.groovy)
at groovy.lang.Closure.call(Closure.java:418)
at groovy.lang.Closure.call(Closure.java:434)
at grails.gorm.transactions.GrailsTransactionTemplate$1.doInTransaction(GrailsTransactionTemplate.groovy:68)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at grails.gorm.transactions.GrailsTransactionTemplate.executeAndRollback(GrailsTransactionTemplate.groovy:65)
at org.grails.MultiTenantCachingServiceSpec.multi-tenant service method with @Cacheable annotation doesn't throw an exception(MultiTenantCachingServiceSpec.groovy)
It looks like the AST triggered by the @Cacheable
annotation isn't playing nicely with the @CurrentTenant
annotation.
Here's an example application using v4.0.1 of the plugin that demonstrates the issue: https://github.com/dpcasady/multi-tenant-cacheable
It has one integration test that when run will throw the exception above.
There is an error when running Jenkins
See https://travis-ci.org/grails-plugins/grails-cache
:publishMavenPublicationToMavenRepository FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':publishMavenPublicationToMavenRepository'.
> Failed to publish publication 'maven' to repository 'maven'
> java.lang.NullPointerException (no error message)
I have an application stuck on 2.3.x.
It seems that all of the old documentation (before 3.0) has been deleted (or at least not linked from the main docs site anymore).
Where can I find the documentation for the old versions?
The latest documentation available here is for 4.0.x
http://grails-plugins.github.io/grails-cache/
Hi
I'm trying to get rid off all the WARN
messages when grails is booting and I found this one
ERROR --- [ main] g.boot.config.tools.ClassPathScanner : The application defines a Groovy source using the default package. Please move all Groovy sources into a package.
Then to verify which Groovy sources is using the default package I ran in the Console
ctx.grailsApplication.allClasses.findAll { !it.getPackage() }*.name
And this was the result
['DefaultCacheConfig', 'ConsoleUrlMappings']
So I came here searched for DefaultCacheConfig
and as ClassPathScanner
DefaultCacheConfig
is not in a package....
I'm using:
| Grails Version: 3.2.4
| Groovy Version: 2.4.7
| JVM Version: 1.8.0_112
| grails-cache Version: 3.0.3
Thanks :)
The issue logged at #62 was closed as fixed in 4.0.3 of the plugin. However, the fix appears to have not have been merged into 5.0.0.RC1 needed for Grails 4.0.x.
The 5.0.0.RC1 release was last published in February 2019 and the 4.0.3 fix was completed in October 2019, thus still has the pre-4.0.03 non-static inner class which results in the originally documented issue.
Either the 4.0.3 changes should be merged to 5.0.0.RC1 or a new RC2 release should be created, then the updated 5.0.x release should be published.
@Cacheable(value="token",key = { 1000 })
def getToken(){
this.updateToken()
}
@CachePut(value="token",key = {1000})
def updateToken(){
// some code get a result
*******
// some code get a result
return result;
}
"getToken" can not get the same after I run updateToken
We have a Grails 3.1.6 application using grails-cache 3.0.2 and ehcache 2.0.0.BUILD-SNAPSHOT
One of our applications came under heavier-than-usual load lately and we've started experiencing slowdowns with a period matching one of our caches' expiry interval. By turning on logging for the cache loading function we've determined that when a cache item expires, all cache fetches will trigger database loads until the first one of them finishes and the cache is populated again (which makes performance even worse since the queries are now competing for resources). The behaviour we expected was that the cache should be aware that it is loading a key's entry already and wait for that call to complete.
The call is from a controller to a service method with a single parameter of type Long
. The cache configuration looks like this:
<cache name="cache-name"
maxEntriesLocalHeap="100"
maxEntriesLocalDisk="0"
overflowToDisk="false"
eternal="false"
timeToIdleSeconds="60"
timeToLiveSeconds="60"
memoryStoreEvictionPolicy="LFU">
</cache>
Grails version - 3.3.9
compile "org.grails.plugins:cache"
Error
java.lang.NoClassDefFoundError: org/springframework/boot/context/embedded/FilterRegistrationBean
at grails.plugin.cache.CacheGrailsPlugin$_doWithSpring_closure1.doCall(CacheGrailsPlugin.groovy:119)
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.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1427)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
at groovy.lang.Closure.call(Closure.java:418)
at groovy.lang.Closure.call(Closure.java:412)
at grails.spring.BeanBuilder.invokeBeanDefiningClosure(BeanBuilder.java:759)
at grails.spring.BeanBuilder.beans(BeanBuilder.java:588)
at grails.spring.BeanBuilder.invokeMethod(BeanBuilder.java:531)
at org.grails.plugins.DefaultGrailsPlugin.doWithRuntimeConfiguration(DefaultGrailsPlugin.java:559)
Hi!
I'm on a project still using Grails 2.4, which seems to only be compatible with version 1 of this plugin.
I'm on the documentation page, but I only see documentation available for version 3 and up: http://grails-plugins.github.io/grails-cache/
Looking at the docs in the 1.x branch for 1.1.9-SNAPSHOT, I see that the content here is very similar to what's labelled as 3.0.0 on the documentation site. Is 3.0.0 on the documentation site usable for 1.1.9-SNAPSHOT?
Thanks,
Eric
I have some cache conditions where the value can only be cached if the value is not null.
Apparently there is now way to do it in version 4, since the result of the method call can not be accessed inside the condition closure.
Before, I had the following condition: "#result != null", now I would need to rewrite it to something like
{ result != null }
Why @caching is not available?
The GrailsConcurrentLinkedMapCache.put method is as follows:
public void put(Object key, Object value) {
this.store.put(key, toStoreValue(value));
}
If I configure the cache to not allow null entries, calling the above with ('aKey', null) will try to put a null value into the underlying ConcurrentLinkedHashMap, which causes a NPE to be thrown by that class's checkNotNull assertion on the value
I was able to get around this be subclassing GrailsConcurrentLinkedMapCache and overriding put with:
@Override
void put(Object key, Object value) {
if (allowNullValues || value) {
nativeCache.put(key, toStoreValue(value))
}
}
If I understand correctly, this was the intended behavior.
Simple test:
void 'test it'() {
given:
GrailsConcurrentLinkedMapCache cache = new GrailsConcurrentLinkedMapCache('name', 10, false)
when:
cache.put('key', null)
then:
null == cache.get('key')
}
yields
java.lang.NullPointerException
at com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap.checkNotNull(ConcurrentLinkedHashMap.java:254)
at com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap.put(ConcurrentLinkedHashMap.java:718)
at com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap.put(ConcurrentLinkedHashMap.java:698)
at grails.plugin.cache.GrailsConcurrentLinkedMapCache.put(GrailsConcurrentLinkedMapCache.java:115)
at com.rgatp.ng.disclosures.api.DecodedInterviewControllerSpec.test it(DecodedInterviewControllerSpec.groovy:19)
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
org.seleniumhq.selenium:selenium-support
, org.seleniumhq.selenium:selenium-api
, org.seleniumhq.selenium:selenium-remote-driver
, org.seleniumhq.selenium:selenium-firefox-driver
, org.seleniumhq.selenium:selenium-chrome-driver
).github/workflows/gradle.yml
actions/checkout v4
actions/setup-java v4
gradle/gradle-build-action v3
actions/upload-artifact v4
actions/checkout v4
actions/setup-java v4
gradle/gradle-build-action v3
actions/checkout v4
actions/setup-java v4
gradle/gradle-build-action v3
grails/github-pages-deploy-action v2
.github/workflows/release-notes.yml
actions/checkout v4
release-drafter/release-drafter v6
ncipollo/release-action v1
.github/workflows/release.yml
actions/checkout v4
gradle/wrapper-validation-action v2
actions/setup-java v4
gradle/gradle-build-action v3
actions/upload-artifact v4
gradle/gradle-build-action v3
actions/checkout v4
gradle/gradle-build-action v3
actions/checkout v4
actions/setup-java v4
gradle/gradle-build-action v3
grails/github-pages-deploy-action v2
gradle.properties
org.grails:grails-gradle-plugin 6.1.2
com.github.erdi:webdriver-binaries-gradle-plugin 3.2
org.gebish:geb-spock 6.0
org.seleniumhq.selenium:selenium-chrome-driver 4.18.1
org.seleniumhq.selenium:selenium-firefox-driver 4.18.1
org.seleniumhq.selenium:selenium-safari-driver 4.18.1
org.seleniumhq.selenium:selenium-remote-driver 4.18.1
org.seleniumhq.selenium:selenium-api 4.18.1
org.seleniumhq.selenium:selenium-support 4.18.1
settings.gradle
com.gradle.enterprise 3.16.2
com.gradle.common-custom-user-data-gradle-plugin 1.13
build.gradle
org.asciidoctor:asciidoctor-gradle-plugin 1.6.1
org.codehaus.gpars:gpars 1.2.1
com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru 1.4.2
gradle/testVerbose.gradle
gradle/wrapper/gradle-wrapper.properties
gradle 7.6.4
src/main/docs/resources/style/layout.html
clipboard.js 2.0.11
If an invocation of a method results in multiple caches to be cleared, the following was possible using v1.1.8
of this plugin.
@CacheEvict(value=[StatisticsService.SERVICE_STATISTICS_CACHE, StatisticsService.DETAILED_TRANSFER_STATISTICS_CACHE, StatisticsService.GENERAL_STATISTICS_CACHE], allEntries=true)
Now it's throwing an exception as the cacheNameException
is being cast to an ConstantExpression
(ConstantExpression cacheNameExpression = (ConstantExpression)ScriptBytecodeAdapter.castToType(annotationNode.getMember("value"), ConstantExpression.class);
)
java.lang.NoClassDefFoundError: org/openqa/selenium/interactions/HasTouchScreen
at Script_45a699fb8fec283c3092b552c4f696a2$_run_closure1.closure4$_closure9(Script_45a699fb8fec283c3092b552c4f696a2.groovy:25)
at groovy.lang.Closure.call(Closure.java:412)
at groovy.lang.Closure.call(Closure.java:428)
at groovy.lang.GString.writeTo(GString.java:194)
at groovy.lang.GString.toString(GString.java:157)
at geb.error.GebException.<init>(GebException.groovy:24)
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
at geb.driver.CachingDriverFactory.getDriver_closure4(CachingDriverFactory.groovy:57)
at geb.driver.CachingDriverFactory.getDriver_closure4(CachingDriverFactory.groovy)
at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:81)
at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:56)
at geb.Configuration.createDriver(Configuration.groovy:700)
at geb.Configuration.getDriver(Configuration.groovy:377)
at geb.Browser.getDriver(Browser.groovy:166)
at geb.Browser.retrieveCurrentUri(Browser.groovy:[122](https://github.com/grails/grails-cache/actions/runs/8236484530/job/22522999197?pr=182#step:5:125)9)
at geb.Browser.go(Browser.groovy:507)
at geb.Browser.go(Browser.groovy:485)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:1)
at com.demo.CacheTagIntegrationSpec.test clear cache(CacheTagIntegrationSpec.groovy:14)
Apply Change similar to grails/grails-core#13387
Where is the documentation page for grails-cache 1.1.8?
@jeffbrown
Default build.gradle from create-app has cache plugin with no version number. When v.5.0 of the plugin was released a clean build pulled in the new version but then failed to start when war was deployed to tomcat 9. Specifying v.4.0.3 in build.gradle fixes the problem. This is a large grails 4 application using 4.0.11 to build.
Error in catalina.out was:
2022-03-16 04:06:48.914 ERROR -- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsApplicationPostProcessor' defined in gdbxt.Application: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [grails.boot.config.GrailsApplicationPostProcessor]: Factory method 'grailsApplicationPostProcessor' threw exception; nested exception is grails.plugins.exceptions.PluginException: Failed to initialize class [com.demo.DemoController] from plugin [cache] : com.demo.DemoController
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:456)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1318)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1158)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:554)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:514)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:321)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:319)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:118)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
at grails.boot.GrailsApp.run(GrailsApp.groovy:99)
etc.
Copying issue from other repo: grails3-plugins#3
import grails.gorm.transactions.Transactional
import grails.plugin.cache.*
@Transactional
class TestService {
@Cacheable(value = 'testservice', key = { foobar.toLowerCase() } )
String serviceMethod(String foobar) {
return foobar
}
}
yeilds the following compiler error
[Static type checking] - The variable [foobar] is undeclared.
@ line 9, column 47.
alue = 'testservice', key = { foobar.toL
If I remove the @transactional annotation, it compiles and works as expected
Just checked the site and noticed there was an update, I have tried latest:
compile 'org.grails.plugins:cache:4.0.0.M2'
on local project and it appears to behave the same as sample/demo project. https://github.com/vahidhedayati/testcache4
When attempting to run grails run-app it produces :
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileGroovy'.
> org.grails.datastore.gorm.transform.AbstractMethodDecoratingTransformation.buildDelegatingMethodCall(Lorg/codehaus/groovy/control/SourceUnit;Lorg/codehaus/groovy/ast/AnnotationNode;Lorg/codehaus/groovy/ast/ClassNode;Lorg/codehaus/groovy/ast/MethodNode;Lorg/codehaus/groovy/ast/expr/MethodCallExpression;Lorg/codehaus/groovy/ast/stmt/BlockStatement;)Lorg/codehaus/groovy/ast/expr/MethodCallExpression;
If i disable cache plugin the site works - or my other site did at least
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.