Hi,
can someone point me, how to correctly implement JAX WS client in JIRA 4.1.2 plugin v2? There is some classloader issue, every service call returns:
com.emc.documentum.fs.rt.impl.servicemodel.ServiceModelException: Unmarshalling service descriptor "javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory not found - with linked exception: [java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory]" failed. Please see underlying error for details. at com.emc.documentum.fs.rt.impl.servicemodel.JavaBeanTreeFactory.getModuleByName(JavaBeanTreeFactory.java:123) at com.emc.documentum.fs.rt.context.ContextFactory.getVersionedUrl(ContextFactory.java:191) at com.emc.documentum.fs.rt.context.ContextFactory.makeRegistryUrl(ContextFactory.java:166) at com.emc.documentum.fs.rt.context.ContextFactory.register(ContextFactory.java:130)
My pom dependency:
<dependency> <groupId>com.atlassian.jira</groupId> <artifactId>atlassian-jira</artifactId> <version>${jira.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.6</version> <scope>test</scope> </dependency> <dependency> <groupId>com.atlassian.jira</groupId> <artifactId>jira-func-tests</artifactId> <version>${jira.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>javax.ws.rs</groupId> <artifactId>jsr311-api</artifactId> <version>1.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.atlassian.jira</groupId> <artifactId>jira-rest-plugin</artifactId> <version>4.3.2</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.atlassian.plugins.rest</groupId> <artifactId>atlassian-rest-common</artifactId> <version>1.0.2</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.3</version> <scope>provided</scope> </dependency>
Community moderators have prevented the ability to post new answers.
Hello,
Have a look at my article, how to call a SOAP web service from Jira using jax-ws in Jira 7.2.x:
The source code of the plugin is available there.
Im unable to import packages into <plugin-info> element. When I added
<plugin-info> ... <bundle-instructions> <Import-Package> javax.xml.bind*;resolution:=optional, com.sun.xml.internal.bind.v2*;resolution:=optional, com.sun.xml.bind.v2.runtime*;resolution:=optional </Import-Package> </bundle-instructions> ... </plugin-info>
plugin have not been enabled, because of next spring framework initialization exception. Spring bean factory can not load other dependent classes.
I try add it myself into import, but this is neverending process, more and mode dependences are required.
Error:
2011-10-18 22:13:03,015 SpringOsgiExtenderThread-52 ERROR [extender.internal.activator.ContextLoaderListener] Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=com.ness.jira.plugin.ea, config=osgibundle:/META-INF/spring/*.xml)) org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'helper' defined in URL [bundle://48.0:0/META-INF/spring/atlassian-plugins-components.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [com.atlassian.jira.security.JiraAuthenticationContext]: : Error loading class [com.ness.jira.plugin.ea.ExternalAttachmentCleanUpListener] for bean with name 'clean-up-listener' defined in URL [bundle://48.0:0/META-INF/spring/atlassian-plugins-components.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: com.ness.jira.plugin.ea.ExternalAttachmentCleanUpListener not found from bundle [com.ness.jira.plugin.ea (com.ness.jira.plugin.ea)]; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.ness.jira.plugin.ea.ExternalAttachmentCleanUpListener] for bean with name 'clean-up-listener' defined in URL [bundle://48.0:0/META-INF/spring/atlassian-plugins-components.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: com.ness.jira.plugin.ea.ExternalAttachmentCleanUpListener not found from bundle [com.ness.jira.plugin.ea (com.ness.jira.plugin.ea)] at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:591) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:193) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:136) at java.lang.Thread.run(Thread.java:619) Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.ness.jira.plugin.ea.ExternalAttachmentCleanUpListener] for bean with name 'clean-up-listener' defined in URL [bundle://48.0:0/META-INF/spring/atlassian-plugins-components.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: com.ness.jira.plugin.ea.ExternalAttachmentCleanUpListener not found from bundle [com.ness.jira.plugin.ea (com.ness.jira.plugin.ea)] at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1144) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:524) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1177) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:222) at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:187) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:652) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:610) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:622) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:584) ... 20 more Caused by: java.lang.NoClassDefFoundError: com.ness.jira.plugin.ea.ExternalAttachmentCleanUpListener not found from bundle [com.ness.jira.plugin.ea (com.ness.jira.plugin.ea)] at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:112) at org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at org.springframework.util.ClassUtils.forName(ClassUtils.java:211) at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:385) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1138) ... 28 more Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/factory/InitializingBean at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1770) at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:670) at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:60) at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1633) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:580) at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1487) at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:897) at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99) ... 33 more Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.InitializingBean at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:726) at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:60) at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1633) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 45 more
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yep, if you have no <Import-Package> in your plugin XML, the plugin system will try to generate one for your automatically by inspecting your plugin. If you do declare one, you have to declare all the packages that you require which aren't included in you jar - it's an all or nothing thing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should be able to just add a wild card as follows at the end of your declarations so you don't have to manually specify all the other imports:
<Import-Package> javax.xml.bind*;resolution:=optional, com.sun.xml.internal.bind.v2*;resolution:=optional, com.sun.xml.bind.v2.runtime*;resolution:=optional, *;resolution:=optional </Import-Package>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It looks like files not imported, because WS client call returns: com.sun.xml.bind.v2.ContextFactory class not found.
com.emc.documentum.fs.rt.impl.servicemodel.ServiceModelException: Unmarshalling service descriptor "javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory not found - with linked exception: [java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory]" failed. Please see underlying error for details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have a look at the answer on this question for some guidance: https://answers.atlassian.com/questions/10018/how-to-use-a-jaxb-dependent-maven-project-as-a-dependency-inside-confluence
Although it's for Confluence, you should be able to adapt it for JIRA, too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.