I am a student working on developing a plugin for JIRA, and have been having trouble getting my servlet to read my html file. So now I wonder which annotations are right to use ?, and what dependencies?. I don't get any error messages, I just can't open the index.vm page.
Would really appreciate if anyone could take a look at my code in the link that i attach below, or just help me find the right person who is knowledgeable in this area.Thanks for help https://stackoverflow.com/questions/66554458/jira-plugin-development-servlet-issue
Hi @Rickard Forslund , welcome on the community
When developing with Atlassian SDK, you need to add servlet description to atlassian-plugin.xml as described in this "how to" article
https://developer.atlassian.com/server/jira/platform/servlet/
I don't know if it is what you need, but eventually get back to me so we can fix it
i Martin, first of all I want to thank you for taking your time to look at my problem, appreciated! I double checked my atlassian-plugin.xml file and it seems that I already have a description in my servlet.
<description key="sumalizer-servlet.description">The Sumalizer Servlet Plugin</description>
what could it be besides that?, any thoughts?
HI @Rickard Forslund , ok, I didn't check it precisely, I thought link leads to some "old" stackoverflow issue... sorry .
I would adjust "variables" and "constructor" part to this:
<span>private</span> <span>final</span> VelocityManager velocityManager; <span>private</span> final PageBuilderService pageBuilderService; <span>private</span> final IssueManager im; <span>private</span> final TemplateRenderer tr; <span>private</span> <span>static</span> <span>final</span> Logger log = LoggerFactory.getLogger( SumalizerServlet.class ); <span>@Autowired</span> <span>public SumalizerServlet(@ComponentImport VelocityManager velocityManager, <br> @ComponentImport PageBuilderService pageBuilderService, <br> @ComponentImport IssueManager im, <br> @ComponentImport TemplateRenderer tr) </span>{ <span>this</span>.velocityManager = velocityManager; <span>this</span>.pageBuilderService = pageBuilderService; <span>this</span>.im = im; <span>this</span>.tr = tr; }
where Autowired is from package
org.springframework.beans.factory.annotation
I would also add some logging to doGet method. It is weird there are no errors in your atlassian-jira.log log file.
Ye okay, I changed what you said, I already had dependency from all 100 attempts I already made hehe, and now I actually get error messages again, saying.
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.i3tex.plugin.servlet.SumalizerServlet': Unsatisfied dependency expressed through constructor argument with index 0 of type [com.atlassian.velocity.VelocityManager]: No qualifying bean of type [com.atlassian.velocity.VelocityManager] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport(value=)}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atlassian.velocity.VelocityManager] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport(value=)}at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1143)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1046)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:342)... 2 filteredat java.lang.reflect.Method.invoke(Method.java:498)at com.atlassian.plugin.osgi.spring.DefaultSpringContainerAccessor.createBean(DefaultSpringContainerAccessor.java:97)at com.atlassian.plugin.module.ClassPrefixModuleFactory.createModule(ClassPrefixModuleFactory.java:35)at com.atlassian.plugin.module.PrefixDelegatingModuleFactory.createModule(PrefixDelegatingModuleFactory.java:88)at com.atlassian.plugin.servlet.descriptors.ServletModuleDescriptor.getModule(ServletModuleDescriptor.java:43)at com.atlassian.plugin.servlet.DelegatingPluginServlet.<init>(DelegatingPluginServlet.java:30)at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedServletReference.create(DefaultServletModuleManager.java:545)at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedServletReference.create(DefaultServletModuleManager.java:529)at com.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:325)at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:143)... 233 moreCaused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atlassian.velocity.VelocityManager] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport(value=)}at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1373)at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119)at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
It looks like you're new here. Sign in or register to get started.