Trouble Creating New Plugin

I am looking to develop a plugin that adds a new task to Bamboo to handle a common build and deployment tasks we do, instead of building scripts.

I install the SDK and create a new Bamboo plugin, but when I try to run the initial created framework, it fails. The run is having java errors that are occurring.

[INFO] [talledLocalContainer] 2020-08-26 22:25:31,917 INFO [localhost-startStop-1] [lifecycle] Default charset: UTF-8, file name ecoding: UTF-8
[INFO] [talledLocalContainer] 2020-08-26 22:25:31,934 INFO [localhost-startStop-1] [[/bamboo]] Initializing Spring root WebApplicationContext
[INFO] [talledLocalContainer] Aug 26, 2020 10:25:31 PM org.apache.catalina.core.ApplicationContext log
[INFO] [talledLocalContainer] INFO: Initializing Spring root WebApplicationContext
[INFO] [talledLocalContainer] 2020-08-26 22:25:35,010 WARN [localhost-startStop-1] [GenericTypeAwarePropertyDescriptor] Invalid JavaBean property ‘mappingResources’ being accessed! Ambiguous write methods found next to actually used [public void bucket.core.persistence.hibernate.ConfigurableLocalSessionFactoryBean.setMappingResources(bucket.core.persistence.hibernate.MappingResources)]: [public void org.springframework.orm.hibernate5.LocalSessionFactoryBean.setMappingResources(java.lang.String)]
[INFO] [talledLocalContainer] 2020-08-26 22:25:35,048 WARN [localhost-startStop-1] [XmlWebApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘reloadableBeanFactories’ defined in class path resource [applicationContextPlugin.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.transaction.config.internalTransactionAdvisor’: Cannot resolve reference to bean ‘org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0’ while setting bean property ‘transactionAttributeSource’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0’: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘customBuildCompleteActionAdvisor’ defined in class path resource [applicationContextManagers.xml]: Cannot resolve reference to bean ‘hibernateInterceptor’ while setting bean property ‘advice’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘hibernateInterceptor’ defined in class path resource [applicationContextPersistence.xml]: Cannot resolve reference to bean ‘sessionFactory’ while setting bean property ‘sessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory’ defined in class path resource [applicationContextPersistence.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
[INFO] [talledLocalContainer] Aug 26, 2020 10:25:35 PM org.apache.catalina.core.StandardContext listenerStart
[INFO] [talledLocalContainer] 2020-08-26 22:25:35,050 ERROR [localhost-startStop-1] [ContextLoader] Context initialization failed
[INFO] [talledLocalContainer] SEVERE: Exception sending context initialized event to listener instance of class com.atlassian.bamboo.ww2.actions.setup.BambooContextLoaderListener
[INFO] [talledLocalContainer] org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘reloadableBeanFactories’ defined in class path resource [applicationContextPlugin.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.transaction.config.internalTransactionAdvisor’: Cannot resolve reference to bean ‘org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0’ while setting bean property ‘transactionAttributeSource’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0’: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘customBuildCompleteActionAdvisor’ defined in class path resource [applicationContextManagers.xml]: Cannot resolve reference to bean ‘hibernateInterceptor’ while setting bean property ‘advice’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘hibernateInterceptor’ defined in class path resource [applicationContextPersistence.xml]: Cannot resolve reference to bean ‘sessionFactory’ while setting bean property ‘sessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory’ defined in class path resource [applicationContextPersistence.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

I’ve tried from both Windows and Linux machines. In Windows I was running AdoptOpenJDK 11 and OpenJDK 11 on Pop!_OS 20.04.

Any ideas what the problem is? Is there a configuration in the template that needs to be adjusted?

Thanks,
Curtis

I get the same issue on OSX, also with OpenJDK11.

Using JAVA_HOME=<jdk 8 path> atlas-run seems to resolve the issue. I assume there is a problem due to the JAXB classes being removed from the JDK in Java 9. The Bamboo docs should probably be updated to more explicitly clarify that exactly JDK8 must be used for development, not JDK8 or greater.

I had tried Java 8, but it didn’t work either. I retried, and remember why I switched to Java 11. With OpenJDK 8 on Ubuntu 20.04, it is version 265, which gives the following error when trying to run Bamboo:

Caused by: java.lang.IllegalArgumentException: Invalid version number: Version number may be negative or greater than 255

After some quick research, found out the common cause is the icu4j library in Tomcat. I replaced its 3.8 version with 67.1 and it was able to start up just fine.