Has anyone seen this error before? It seems to happen when you have record in scripts. Every now and then after clearing groovy cache, the system seems to forget how to find java.util.Map. A reboot usually fixes it.
the full error is
c.a.j.web.component.ModuleWebComponentImpl] An exception occured while rendering the web panel: com.onresolve.jira.groovy.groovyrunner:WEBPANEL_NAME (null)
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'RECORD NAME': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'java.util.Map<?, ?>' available: expected single matching bean but found 2: systemProperties,systemEnvironment
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:794)
at... (lots of stack trace, proxying, reflection etc)
Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'java.util.Map<?, ?>' available: expected single matching bean but found 2: systemProperties,systemEnvironment
at org.springframework.beans.factory.config.DependencyDescriptor.resolveNotUnique(DependencyDescriptor.java:220)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1369)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:904)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:781) ... 538 more
This looks more like a ScriptRunner/Spring classloader issue than a problem with java.util.Map itself.
The interesting part is that Spring finds two Map beans (systemProperties and systemEnvironment) and is unable to decide which one should be injected. The fact that a Jira restart fixes it also suggests that something related to the ScriptRunner classloader/cache may be getting into an inconsistent state after compiling or reloading scripts containing records.
Have you noticed whether it starts happening after editing/reloading a specific script, or only after using record? Also, which Jira and ScriptRunner versions are you running?
If it is reproducible, I’d definitely raise it with Adaptavist Support, as the restart fixing it makes it sound like a potential ScriptRunner bug rather than an issue with the script itself.
I'm thinking it must be a classloader issue.
It doesn't matter which script is edited, but scripts that contained records are affected. Classes that contained records and records that lived in their own file were not affected.
I've see the issue with several scriptrunner versions but it doesn't happen that often. Maybe once every 2-3 months.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.