I’ve been trying to create a validtor for my extension but I keep running into problems. I think I’m importing something wrong because I keep getting the error java.lang.LinkageError on the AbstractDescriptor class.
Could someone help figure out what I’m doing wrong?
ValidatorFactory.java
public class ValidatorFactory extends AbstractWorkflowPluginFactory implements WorkflowPluginValidatorFactory
{
protected void getVelocityParamsForInput(Map velocityParams) {}
protected void getVelocityParamsForEdit(Map velocityParams, AbstractDescriptor descriptor) {}
protected void getVelocityParamsForView(Map velocityParams, AbstractDescriptor descriptor) {}
public Map getDescriptorParams(Map validatorParams)
{
// Process The map
return Maps.newHashMap();
}
}
Validator.java
public class Validator implements Validator
{
private final Repository repository;
public Validator(Repository repository) {
this.repository = repository;
}
public void validate(Map transientVars, Map args, PropertySet ps) throws InvalidInputException {
Issue issue = (Issue) transientVars.get("issue");
Boolean status = repository.allCompleted(issue.getKey());
if (status){
throw new InvalidInputException("Not eveything is done");
}
}
}
I’ve added the two dependencies below to my POM because I couldn’t get the required classes to import. But I think I need something else because this keeps failing to.
[INFO] [talledLocalContainer] 2018-05-23 08:34:03,690 http-nio-2990-exec-11 ERROR admin 514x357x1 18w7wo5 0:0:0:0:0:0:0:1 /secure/admin/workflows/AddWorkflowTransitionValidatorParams!default.jspa [c.a.plugin.module.PrefixDelegatingModuleFactory] Detected an error (LinkageError) instantiating the module for plugin 'tig.jira.extension.tigChecklistExtension' for module 'checklist-completed-validator': loader constraint violation: loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) previously initiated loading for a different type with name "com/opensymphony/workflow/loader/AbstractDescriptor". This error is usually caused by your plugin including copies of libraries in META-INF/lib unnecessarily. For more details on how to fix this, see https://developer.atlassian.com/x/EgAN .
[INFO] [talledLocalContainer] 2018-05-23 08:34:03,692 http-nio-2990-exec-11 ERROR admin 514x357x1 18w7wo5 0:0:0:0:0:0:0:1 /secure/admin/workflows/AddWorkflowTransitionValidatorParams!default.jspa [webwork.util.ValueStack] query="/descriptorHtml" {[id="null" type="5" values=""]} {[id="descriptorHtml" type="8" values=""]}
[INFO] [talledLocalContainer] java.lang.reflect.InvocationTargetException
[INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:498)
[INFO] [talledLocalContainer] at webwork.util.InjectionUtils$DefaultInjectionImpl.invoke(InjectionUtils.java:70)
[INFO] [talledLocalContainer] at webwork.util.InjectionUtils.invoke(InjectionUtils.java:56)
[INFO] [talledLocalContainer] at webwork.util.ValueStack.findValue(ValueStack.java:417)
[INFO] [talledLocalContainer] at webwork.util.ValueStack.findValue(ValueStack.java:216)
[INFO] [talledLocalContainer] at webwork.view.taglib.WebWorkBodyTagSupport.findValue(WebWorkBodyTagSupport.java:62)
[INFO] [talledLocalContainer] at webwork.view.taglib.BasicPropertyTag.doStartTag(BasicPropertyTag.java:54)
[INFO] [talledLocalContainer] at jsp.secure.admin.views.workflow.addworkflowtransitiondescriptorparams_jsp._jspx_meth_ww_005fproperty_005f4(addworkflowtransitiondescriptorparams_jsp.java:1081)
[INFO] [talledLocalContainer] at jsp.secure.admin.views.workflow.addworkflowtransitiondescriptorparams_jsp._jspx_meth_page_005fparam_005f6(addworkflowtransitiondescriptorparams_jsp.java:957)
[INFO] [talledLocalContainer] at jsp.secure.admin.views.workflow.addworkflowtransitiondescriptorparams_jsp._jspx_meth_page_005fapplyDecorator_005f0(addworkflowtransitiondescriptorparams_jsp.java:262)
[INFO] [talledLocalContainer] at jsp.secure.admin.views.workflow.addworkflowtransitiondescriptorparams_jsp._jspService(addworkflowtransitiondescriptorparams_jsp.java:115)
[INFO] [talledLocalContainer] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
[INFO] [talledLocalContainer] at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
[INFO] [talledLocalContainer] ... 48 filtered
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.web.ExternalCustomerLockoutFilter.doFilter(ExternalCustomerLockoutFilter.java:56)
[INFO] [talledLocalContainer] ... 4 filtered
[INFO] [talledLocalContainer] at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
[INFO] [talledLocalContainer] ... 45 filtered
[INFO] [talledLocalContainer] at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66)
[INFO] [talledLocalContainer] ... 1 filtered
[INFO] [talledLocalContainer] at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64)
[INFO] [talledLocalContainer] ... 20 filtered
[INFO] [talledLocalContainer] at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
[INFO] [talledLocalContainer] ... 5 filtered
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:116)
[INFO] [talledLocalContainer] ... 11 filtered
[INFO] [talledLocalContainer] at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
[INFO] [talledLocalContainer] ... 11 filtered
[INFO] [talledLocalContainer] at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
[INFO] [talledLocalContainer] ... 48 filtered
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.web.ExternalCustomerLockoutFilter.doFilter(ExternalCustomerLockoutFilter.java:56)
[INFO] [talledLocalContainer] ... 13 filtered
[INFO] [talledLocalContainer] at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
[INFO] [talledLocalContainer] ... 24 filtered
[INFO] [talledLocalContainer] at com.atlassian.labs.httpservice.resource.ResourceFilter.doFilter(ResourceFilter.java:59)
[INFO] [talledLocalContainer] ... 41 filtered
[INFO] [talledLocalContainer] at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66)
[INFO] [talledLocalContainer] ... 1 filtered
[INFO] [talledLocalContainer] at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64)
[INFO] [talledLocalContainer] ... 39 filtered
[INFO] [talledLocalContainer] at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
[INFO] [talledLocalContainer] ... 5 filtered
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.lambda$invokeFilterChain$0(CustomerContextSettingFilter.java:181)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.rteInvoke(ReentrantThreadLocalBasedCodeContext.java:137)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.runOutOfContext(ReentrantThreadLocalBasedCodeContext.java:90)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.runOutOfCustomerContext(CustomerContextServiceImpl.java:47)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.outOfCustomerContext(CustomerContextSettingFilter.java:174)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:130)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:121)
[INFO] [talledLocalContainer] ... 4 filtered
[INFO] [talledLocalContainer] at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:32)
[INFO] [talledLocalContainer] ... 8 filtered
[INFO] [talledLocalContainer] at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
[INFO] [talledLocalContainer] ... 4 filtered
[INFO] [talledLocalContainer] at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
[INFO] [talledLocalContainer] ... 26 filtered
[INFO] [talledLocalContainer] at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
[INFO] [talledLocalContainer] ... 23 filtered
[INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[INFO] [talledLocalContainer] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
[INFO] [talledLocalContainer] at java.lang.Thread.run(Thread.java:748)
[INFO] [talledLocalContainer] Caused by: com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) previously initiated loading for a different type with name "com/opensymphony/workflow/loader/AbstractDescriptor"
[INFO] [talledLocalContainer] at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149)
[INFO] [talledLocalContainer] at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112)
[INFO] [talledLocalContainer] at com.atlassian.util.concurrent.ResettableLazyReference.get(ResettableLazyReference.java:92)
[INFO] [talledLocalContainer] at com.atlassian.jira.plugin.AbstractJiraModuleDescriptor.getModule(AbstractJiraModuleDescriptor.java:167)
[INFO] [talledLocalContainer] at com.atlassian.jira.plugin.workflow.WorkflowValidatorModuleDescriptor.getHtml(WorkflowValidatorModuleDescriptor.java:28)
[INFO] [talledLocalContainer] ... 426 more
[INFO] [talledLocalContainer] Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) previously initiated loading for a different type with name "com/opensymphony/workflow/loader/AbstractDescriptor"
[INFO] [talledLocalContainer] at java.lang.ClassLoader.defineClass1(Native Method)
[INFO] [talledLocalContainer] at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
[INFO] [talledLocalContainer] at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279)
[INFO] [talledLocalContainer] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501)
[INFO] [talledLocalContainer] at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
[INFO] [talledLocalContainer] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[INFO] [talledLocalContainer] at java.lang.Class.getDeclaredMethods0(Native Method)
[INFO] [talledLocalContainer] at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
[INFO] [talledLocalContainer] at java.lang.Class.getDeclaredMethods(Class.java:1975)
[INFO] [talledLocalContainer] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:609)
[INFO] [talledLocalContainer] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:521)
[INFO] [talledLocalContainer] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:507)
[INFO] [talledLocalContainer] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:241)
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1069)
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:342)
[INFO] [talledLocalContainer] ... 2 filtered
[INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:498)
[INFO] [talledLocalContainer] at com.atlassian.plugin.osgi.spring.DefaultSpringContainerAccessor.createBean(DefaultSpringContainerAccessor.java:97)
[INFO] [talledLocalContainer] at com.atlassian.plugin.module.ClassPrefixModuleFactory.createModule(ClassPrefixModuleFactory.java:35)
[INFO] [talledLocalContainer] at com.atlassian.plugin.module.PrefixDelegatingModuleFactory.createModule(PrefixDelegatingModuleFactory.java:88)
[INFO] [talledLocalContainer] at com.atlassian.jira.plugin.AbstractJiraModuleDescriptor.createModule(AbstractJiraModuleDescriptor.java:179)
[INFO] [talledLocalContainer] at com.atlassian.jira.plugin.AbstractJiraModuleDescriptor$1.create(AbstractJiraModuleDescriptor.java:60)
[INFO] [talledLocalContainer] at com.atlassian.util.concurrent.ResettableLazyReference$InternalReference.create(ResettableLazyReference.java:182)
[INFO] [talledLocalContainer] at com.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:325)
[INFO] [talledLocalContainer] at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:143)
[INFO] [talledLocalContainer] ... 431 more