Can't fix "There is no Action mapped for namespace [/build/result] ". What is the correct way of adding action to bamboo namespace? - struts2

I am developing a bamboo plugin using the Atlassian-SDK. This plugin would add a new tab to the Bamboo Jobs page that would display an HTML report (present in artifact) in the same tab.
My Atlassian-plugin.xml looks like
<xwork key="viewRobotReport" name="View Robot Report">
<package name="RobotPlugin" extends="buildResultView">
<action name="viewRobotReport" class="robot.RobotReport">
<result name="success" type="freemarker">viewRobotReport.ftl</result>
</action>
</package>
</xwork>
<web-item key="RobotJob-${planKey}-${buildNumber}" name="RobotReport" section="results.subMenu/results" weight="80">
<label key="Robot Report"/>
<link linkId="RobotBuild-${planKey}-${buildNumber}">/build/result/viewRobotReport.action?buildKey=${planKey}&buildNumber=${buildNumber}
</link>
<condition class="robot.RobotReportViewCondition"/>
</web-item>
I am extending my class RobotReport from ViewBuildResults so that I can fetch the artifact details.
After I click on the tab I get an error
Apologies, this page could not be properly decorated (data is missing)
The URL for the page is
172.xx.x.x0:6990/bamboo/build/result/viewRobotReport.action?buildKey=TPRO1-TPLAN1-JOB1&buildNumber=1
From the logs I can see the below errors
[INFO] [talledLocalContainer] 2018-05-02 13:41:48,724 INFO [http-nio-6990-exec-12] [AccessLogFilter] admin GET http://172.20.1.30:6990/bamboo/build/result/viewRobotReport.action?buildKey=TPRO1-TPLAN1-JOB1&buildNumber=1&_=1525264904397 177957kb
[INFO] [talledLocalContainer] 2018-05-02 13:41:48,725 ERROR [http-nio-6990-exec-12] [BambooStrutsUnknownHandler] There is no Action mapped for namespace [/build/result] and action name [viewRobotReport] associated with context path [/bamboo].
[INFO] [talledLocalContainer] 2018-05-02 13:41:48,788 INFO [http-nio-6990-exec-9] [AccessLogFilter] admin GET http://172.20.1.30:6990/bamboo/build/result/viewRobotReport.action?buildKey=TPRO1-TPLAN1-JOB1&buildNumber=1 76808kb
[INFO] [talledLocalContainer] 2018-05-02 13:41:48,789 ERROR [http-nio-6990-exec-9] [BambooStrutsUnknownHandler] There is no Action mapped for namespace [/build/result] and action name [viewRobotReport] associated with context path [/bamboo].
[INFO] [talledLocalContainer] 2018-05-02 13:41:48,819 ERROR [http-nio-6990-exec-9] [runtime] Error executing FreeMarker template
[INFO] [talledLocalContainer] FreeMarker template error:
[INFO] [talledLocalContainer] The following has evaluated to null or missing:
[INFO] [talledLocalContainer] ==> navigationContext [in template "decorators/resultDecorator.ftl" at line 17, column 18]
[INFO] [talledLocalContainer]
I understand that BambooStruts cannot find action in the namespace /build/result in /bamboo.
My freemarker template contains only this bit.
<html>
<head>
<meta name="decorator" content="result"/>
</head>
<body>
</body>
</html>
What is the correct way of adding action (viewRobotReport) in bamboo's /build/result namespace?
Bamboo Developer Forums doesn't have a guideline for implementing this.
Somewhere it mentions "setter injection" but not sure what that is.
Any tiny hint would be highly appreciated. Thanks in advance.

I found what the problem was when I was looking at all the logs of atlas-run.
I could the the below in the logs..
[INFO] [talledLocalContainer] 2018-05-03 13:30:07,737 ERROR [localhost-startStop-1] [BambooPluginUtils] A problem has occurred when instantiating action class [robot.RobotReport], skipping action [viewRobotReport]
[INFO] [talledLocalContainer] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'robot.RobotReport': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.atlassian.bamboo.storage.StorageLocationService com.atlassian.bamboo.build.ViewBuildResults.storageLocationService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atlassian.bamboo.storage.StorageLocationService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {#org.springframework.beans.factory.annotation.Autowired(required=true)}
I fixed it in the code by doing the below..
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;
import com.atlassian.plugin.spring.scanner.annotation.component.Scanned;
#Scanned
public class RobotReport extends ViewBuildResults {
public RobotReport(#ComponentImport StorageLocationService storageLocationService){
Useful link
https://community.developer.atlassian.com/t/spring-autowiring-issues-when-extending-viewbuildresults/14766/2

Related

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'beanName'

I'm trying to create a Web Service from a WSDL File (Top down Java bean Web Service) by using CXF 3.5.3, but it's not working. After I run it on the Server, this error appears
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:META-INF/cxf/cxf-extension-soap.xml]
Offending resource: ServletContext resource [/WEB-INF/cxf-beans.xml];
nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [META-INF/cxf/cxf-extension-soap.xml];
nested exception is java.io.FileNotFoundException: class path resource [META-INF/cxf/cxf-extension-soap.xml] cannot be opened because it does not exist
After researching on other forums, I deleted these two lines in cxf-beans.xml
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
And replace it with
<import resource="classpath*:META-INF/cxf/cxf-extension-*.xml"/>
After cleaning and running on the Server again, I see a new error appearing in the console
WARNING: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nvu3interfacev20': Cannot create inner bean '(inner bean)#b790f3d' of type [fr.band.tcn2021.nvu3.servicev2.Nvu3InterfaceV20Impl] while setting constructor argument; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [fr.band.tcn2021.nvu3.servicev2.Nvu3InterfaceV20Impl] for bean with name '(inner bean)#b790f3d'; nested exception is java.lang.ClassNotFoundException: fr.band.tcn2021.nvu3.servicev2.Nvu3InterfaceV20Impl
Juli 25, 2022 2:10:15 PM org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERED: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nvu3interfacev20': Cannot create inner bean '(inner bean)#b790f3d' of type [fr.band.tcn2021.nvu3.servicev2.Nvu3InterfaceV20Impl] while setting constructor argument; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [fr.band.tcn2021.nvu3.servicev2.Nvu3InterfaceV20Impl] for bean with name '(inner bean)#b790f3d'; nested exception is java.lang.ClassNotFoundException: fr.band.tcn2021.nvu3.servicev2.Nvu3InterfaceV20Impl
How can I debug this error and run this Web service on the Server. Hope you can help! Thanks!

Grails 3 hibernateDatastore stratup error after migrating from Grails 2

I am upgrading to Grails 3.3.1 from a Grails 2.4 app.
Things seemed to be going slow but OK until I stumbled into this problem when trying to run the app:
Configuring Spring Security Core ...
... finished configuring Spring Security Core
Configuring Spring Security Shiro ...
... finished configuring Spring Security Shiro
2017-12-19 18:51:43.400 ERROR --- [ost-startStop-1] o.s.b.c.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'grailsCacheFilter': Cannot create inner bean '(inner bean)#3238926e' of type [grails.plugin.cache.web.filter.simple.MemoryPageFragmentCachingFilter] while setting bean property 'filter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name '(inner bean)#3238926e': Unsatisfied dependency expressed through method 'setUrlMappingsHandlerMapping' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'urlMappingsHandlerMapping': Unsatisfied dependency expressed through method 'setWebRequestInterceptors' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'openSessionInViewInterceptor': Cannot resolve reference to bean 'hibernateDatastore' while setting bean property 'hibernateDatastore'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateDatastore': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.grails.orm.hibernate.HibernateDatastore]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
2017-12-19 18:51:43.492 ERROR --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
The dependencies of some of the beans in the application context form a cycle:
grailsCacheFilter
↓
(inner bean)#3238926e
↓
urlMappingsHandlerMapping
↓
openSessionInViewInterceptor
┌─────┐
| hibernateDatastore
└─────┘
Hibernate and Shiro version in the build gradle:
// hibernate
compile "org.grails.plugins:hibernate5:6.0.13"
compile "org.hibernate:hibernate-core:5.1.10.Final"
compile "org.hibernate:hibernate-ehcache:5.1.10.Final"
compile 'org.grails.plugins:spring-security-shiro:3.0.1'
Is this a common error people are running into?
Will I have to go through my dependences one by one to see if one of them is causing this?

How to use Active Objects with annotation in atlassian sdk

I do Jira plugin and I need to use Active Object. (Jira v7.1.8)
But in official documentation is outdated. It is written using xml, but if I understood correctly, now used Atlassian Spring Scanner (I use v1.2.3)
Following this a manual https://bitbucket.org/atlassian/atlassian-spring-scanner/src/1.2.x/README.md?at=1.2.x&fileviewer=file-view-default nothing succeeded.
atlassian-plugin.xml
<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2">
<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}" />
<param name="plugin-icon">images/pluginIcon.png</param>
<param name="plugin-logo">images/pluginLogo.png</param>
</plugin-info>
<!-- add our i18n resource -->
<resource type="i18n" name="i18n" location="dbplugin"/>
<web-resource key="my-resources">
<dependency>com.atlassian.jira.jira-project-config-plugin:project-config-global</dependency>
<context>my-resources</context>
</web-resource>
<!----------- This is old xml version ------------------
<component-import key="ao" name="Active Objects service" interface="com.atlassian.activeobjects.external.ActiveObjects">
<description>Component to access Active Objects functionality from the plugin</description>
</component-import>
<component key="dao-factory" class="com.lemon.dbplugin.DAO.DAOFactory">
</component>
-------------------------------------------------------->
<ao key="ao-module">
<entity>com.lemon.dbplugin.entity.StudentEntity</entity>
</ao>
<webwork1 key="actions" name="MyActions">
<actions>
<action name="com.lemon.dbplugin.ActionAlpha" alias="action" roles-required="admin">
<view name="success">/templates/success.vm</view>
</action>
</actions>
</webwork1>
ActionAlpha
package com.lemon.dbplugin;
import com.atlassian.jira.project.Project;
import com.atlassian.jira.web.action.JiraWebActionSupport;
import com.lemon.dbplugin.DAO.DAOFactory;
import com.lemon.dbplugin.entity.StudentEntity;
import com.lemon.dbplugin.logic.Student;
import com.lemon.dbplugin.logic.StudentImpl;
import org.apache.log4j.Logger;
import webwork.action.ServletActionContext;
public class ActionAlpha extends JiraWebActionSupport {
private static final Logger log = Logger.getLogger(ActionAlpha.class);
private Project project;
private StudentEntity[] students;
#Override
public String execute() throws Exception {
log.debug("Entered in execute ActionAlpha");
project = getSelectedProjectObject();
getHttpRequest().setAttribute("com.atlassian.jira.projectconfig.util.ServletRequestProjectConfigRequestCache:project", project);
students = DAOFactory.getInstance().getStudentDAO().getStudents();
log.debug("students :" + students);
return super.execute();
}
public String doAdd() throws Exception {
log.debug("Entered in doAdd ActionAlpha");
String name = getHttpRequest().getParameterValues("name")[0];
Student student = new StudentImpl(name);
log.debug("student :" + student);
DAOFactory.getInstance().getStudentDAO().addStudent(student);
ServletActionContext.getResponse().sendRedirect("/secure/action.jspa");
return NONE;
}
}
DAOFactory
package com.lemon.dbplugin.DAO;
import com.atlassian.activeobjects.external.ActiveObjects;
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;
import com.lemon.dbplugin.DAO.Impl.StudentDAOImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
#Component
public class DAOFactory {
private static StudentDAO studentDAO = null;
private static DAOFactory instance = null;
#ComponentImport private static ActiveObjects ao;
#Autowired
public DAOFactory(#ComponentImport ActiveObjects ao) {
DAOFactory.ao = ao;
}
public static synchronized DAOFactory getInstance() {
if (instance == null) {
instance = new DAOFactory(ao);
}
return instance;
}
public StudentDAO getStudentDAO() {
if (studentDAO == null) {
studentDAO = new StudentDAOImpl(ao);
}
return studentDAO;
}
}
StudentDAOImpl
package com.lemon.dbplugin.DAO.Impl;
import com.atlassian.activeobjects.external.ActiveObjects;
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;
import com.atlassian.sal.api.transaction.TransactionCallback;
import com.lemon.dbplugin.DAO.StudentDAO;
import com.lemon.dbplugin.entity.StudentEntity;
import com.lemon.dbplugin.logic.Student;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
public class StudentDAOImpl implements StudentDAO {
private final ActiveObjects ao;
private static final Logger log = Logger.getLogger(StudentDAOImpl.class);
#Autowired
public StudentDAOImpl(#ComponentImport ActiveObjects ao) {
this.ao = ao;
}
#Override
public StudentEntity addStudent(final Student student) throws Exception {
log.debug("Entered to addStudents");
log.debug("AO :" + ao);
return ao.executeInTransaction(new TransactionCallback<StudentEntity>() {
public StudentEntity doInTransaction() {
StudentEntity entity = ao.create(StudentEntity.class);
entity.setName(student.getName());
entity.setCreated(new Date(System.currentTimeMillis()));
entity.save();
return entity;
}
});
}
public StudentEntity[] getStudents() throws Exception {
log.debug("Entered to getStudents");
log.debug("ao: " + ao);
try {
return ao.executeInTransaction(new TransactionCallback<StudentEntity[]>() {
public StudentEntity[] doInTransaction() {
StudentEntity[] result = ao.find(StudentEntity.class);
if (result != null) {
return ao.find(StudentEntity.class);
} else {
return new StudentEntity[]{};
}
}
});
}
catch(NullPointerException e){
return new StudentEntity[]{};
}
}
}
Compile and package whithout errors. But if I try open /jira/secure/action.jspa,
in console I get this:
[INFO] [talledLocalContainer] 2016-06-30 09:38:15,837 http-nio-2990-exec-8 DEBUG admin 578x129x1 bnt30i 10.0.0.120 /rest/plugins/1.0/com.lemon.dbplugin.dbplugin-key [c.a.activeobjects.osgi.OsgiServiceUtilsImpl] Registering service net.java.ao.atlassian.AtlassianTableNameConverter#16856656 with interface net.java.ao.schema.TableNameConverter and properties {com.atlassian.plugin.key=com.lemon.dbplugin.dbplugin}
[INFO] [talledLocalContainer] 2016-06-30 09:38:15,839 http-nio-2990-exec-8 DEBUG admin 578x129x1 bnt30i 10.0.0.120 /rest/plugins/1.0/com.lemon.dbplugin.dbplugin-key [c.a.activeobjects.osgi.OsgiServiceUtilsImpl] Registering service com.atlassian.activeobjects.config.internal.DefaultActiveObjectsConfiguration#3cf99a08 with interface com.atlassian.activeobjects.config.ActiveObjectsConfiguration and properties {com.atlassian.plugin.key=com.lemon.dbplugin.dbplugin}
[INFO] [talledLocalContainer] 2016-06-30 09:38:15,845 http-nio-2990-exec-8 DEBUG admin 578x129x1 bnt30i 10.0.0.120 /rest/plugins/1.0/com.lemon.dbplugin.dbplugin-key [c.a.activeobjects.osgi.ActiveObjectsServiceFactory] onPluginModuleEnabledEvent storing unattached <ao> configuration module for [com.lemon.dbplugin.dbplugin]
[INFO] [talledLocalContainer] 2016-06-30 09:38:15,875 http-nio-2990-exec-8 DEBUG admin 578x129x1 bnt30i 10.0.0.120 /rest/plugins/1.0/com.lemon.dbplugin.dbplugin-key [c.a.activeobjects.osgi.ActiveObjectsServiceFactory] onPluginEnabledEvent attaching unbound <ao> to [com.lemon.dbplugin.dbplugin]
[INFO] [talledLocalContainer] 2016-06-30 09:38:15,876 http-nio-2990-exec-8 DEBUG admin 578x129x1 bnt30i 10.0.0.120 /rest/plugins/1.0/com.lemon.dbplugin.dbplugin-key [c.a.activeobjects.osgi.TenantAwareActiveObjects] init bundle [com.lemon.dbplugin.dbplugin]
[INFO] [talledLocalContainer] 2016-06-30 09:38:15,876 http-nio-2990-exec-8 DEBUG admin 578x129x1 bnt30i 10.0.0.120 /rest/plugins/1.0/com.lemon.dbplugin.dbplugin-key [c.a.activeobjects.osgi.TenantAwareActiveObjects] bundle [com.lemon.dbplugin.dbplugin] loading new AO promise for JiraTenantImpl{id='system'}
[INFO] [talledLocalContainer] 2016-06-30 09:38:15,876 http-nio-2990-exec-8 DEBUG admin 578x129x1 bnt30i 10.0.0.120 /rest/plugins/1.0/com.lemon.dbplugin.dbplugin-key [c.a.activeobjects.osgi.TenantAwareActiveObjects] setAoConfiguration [com.lemon.dbplugin.dbplugin]
[INFO] [talledLocalContainer] 2016-06-30 09:38:15,876 http-nio-2990-exec-8 DEBUG admin 578x129x1 bnt30i 10.0.0.120 /rest/plugins/1.0/com.lemon.dbplugin.dbplugin-key [c.a.activeobjects.osgi.TenantAwareActiveObjects] bundle [com.lemon.dbplugin.dbplugin] got ActiveObjectsConfiguration
[INFO] [talledLocalContainer] 2016-06-30 09:38:15,877 active-objects-init-JiraTenantImpl{id='system'}-0 DEBUG admin [c.a.activeobjects.osgi.TenantAwareActiveObjects] bundle [com.lemon.dbplugin.dbplugin] creating ActiveObjects
[INFO] [talledLocalContainer] 2016-06-30 09:38:15,905 active-objects-init-JiraTenantImpl{id='system'}-0 DEBUG admin [c.a.activeobjects.osgi.TenantAwareActiveObjects] bundle [com.lemon.dbplugin.dbplugin] created ActiveObjects
[INFO] [talledLocalContainer] 2016-06-30 09:38:53,798 http-nio-2990-exec-12 ERROR admin 578x184x1 bnt30i 10.0.0.120 /secure/action.jspa [c.a.j.config.webwork.JiraActionFactory] Error autowiring Action 'com.lemon.dbplugin.ActionAlpha'.
[INFO] [talledLocalContainer] java.lang.NullPointerException
[INFO] [talledLocalContainer] at com.atlassian.jira.config.webwork.JiraActionFactory$JiraPluginActionFactory.getActionImpl(JiraActionFactory.java:389)
[INFO] [talledLocalContainer] at webwork.action.factory.PrefixActionFactoryProxy.getActionImpl(PrefixActionFactoryProxy.java:99)
[INFO] [talledLocalContainer] at webwork.action.factory.JspActionFactoryProxy.getActionImpl(JspActionFactoryProxy.java:59)
[INFO] [talledLocalContainer] at webwork.action.factory.CommandActionFactoryProxy.getActionImpl(CommandActionFactoryProxy.java:60)
[INFO] [talledLocalContainer] at com.atlassian.jira.config.webwork.LookupAliasActionFactoryProxy.getActionImpl(LookupAliasActionFactoryProxy.java:61)
[INFO] [talledLocalContainer] at webwork.action.factory.CommandActionFactoryProxy.getActionImpl(CommandActionFactoryProxy.java:60)
[INFO] [talledLocalContainer] at webwork.action.factory.ContextActionFactoryProxy.getActionImpl(ContextActionFactoryProxy.java:36)
[INFO] [talledLocalContainer] at webwork.action.factory.PrepareActionFactoryProxy.getActionImpl(PrepareActionFactoryProxy.java:37)
[INFO] [talledLocalContainer] at com.atlassian.jira.config.webwork.JiraActionFactory$SafeParameterSettingActionFactoryProxy.getActionImpl(JiraActionFactory.java:147)
[INFO] [talledLocalContainer] at webwork.action.factory.ChainingActionFactoryProxy.getActionImpl(ChainingActionFactoryProxy.java:53)
[INFO] [talledLocalContainer] at com.atlassian.jira.config.webwork.JiraActionFactory.getActionImpl(JiraActionFactory.java:301)
[INFO] [talledLocalContainer] ... 2 filtered
[INFO] [talledLocalContainer] at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
[INFO] [talledLocalContainer] ... 55 filtered
[INFO] [talledLocalContainer] at com.atlassian.greenhopper.jira.filters.ClassicBoardRouter.doFilter(ClassicBoardRouter.java:59)
[INFO] [talledLocalContainer] ... 27 filtered
[INFO] [talledLocalContainer] at com.atlassian.labs.httpservice.resource.ResourceFilter.doFilter(ResourceFilter.java:59)
[INFO] [talledLocalContainer] ... 38 filtered
[INFO] [talledLocalContainer] at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:70)
[INFO] [talledLocalContainer] ... 38 filtered
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.lambda$invokeFilterChain$0(CustomerContextSettingFilter.java:169)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.util.scala.ScalaJavaInterOp$1.apply(ScalaJavaInterOp.java:25)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.utils.context.CustomerContextUtil$.outOfCustomerContext(CustomerContextUtil.scala:48)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.utils.context.CustomerContextUtil.outOfCustomerContext(CustomerContextUtil.scala)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.outOfCustomerContext(CustomerContextServiceImpl.java:24)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.outOfCustomerContext(CustomerContextSettingFilter.java:164)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:120)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:112)
[INFO] [talledLocalContainer] ... 55 filtered
[INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[INFO] [talledLocalContainer] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
[INFO] [talledLocalContainer] at java.lang.Thread.run(Thread.java:745)
[INFO] [talledLocalContainer] 2016-06-30 09:38:53,801 http-nio-2990-exec-12 ERROR admin 578x184x1 bnt30i 10.0.0.120 /secure/action.jspa [c.a.j.web.dispatcher.JiraWebworkActionDispatcher] Exception thrown from action 'action', returning 404
[INFO] [talledLocalContainer] java.lang.NullPointerException
[INFO] [talledLocalContainer] at com.atlassian.jira.config.webwork.JiraActionFactory$JiraPluginActionFactory.getActionImpl(JiraActionFactory.java:389)
[INFO] [talledLocalContainer] at webwork.action.factory.PrefixActionFactoryProxy.getActionImpl(PrefixActionFactoryProxy.java:99)
[INFO] [talledLocalContainer] at webwork.action.factory.JspActionFactoryProxy.getActionImpl(JspActionFactoryProxy.java:59)
[INFO] [talledLocalContainer] at webwork.action.factory.CommandActionFactoryProxy.getActionImpl(CommandActionFactoryProxy.java:60)
[INFO] [talledLocalContainer] at com.atlassian.jira.config.webwork.LookupAliasActionFactoryProxy.getActionImpl(LookupAliasActionFactoryProxy.java:61)
[INFO] [talledLocalContainer] at webwork.action.factory.CommandActionFactoryProxy.getActionImpl(CommandActionFactoryProxy.java:60)
[INFO] [talledLocalContainer] at webwork.action.factory.ContextActionFactoryProxy.getActionImpl(ContextActionFactoryProxy.java:36)
[INFO] [talledLocalContainer] at webwork.action.factory.PrepareActionFactoryProxy.getActionImpl(PrepareActionFactoryProxy.java:37)
[INFO] [talledLocalContainer] at com.atlassian.jira.config.webwork.JiraActionFactory$SafeParameterSettingActionFactoryProxy.getActionImpl(JiraActionFactory.java:147)
[INFO] [talledLocalContainer] at webwork.action.factory.ChainingActionFactoryProxy.getActionImpl(ChainingActionFactoryProxy.java:53)
[INFO] [talledLocalContainer] at com.atlassian.jira.config.webwork.JiraActionFactory.getActionImpl(JiraActionFactory.java:301)
[INFO] [talledLocalContainer] ... 2 filtered
[INFO] [talledLocalContainer] at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
[INFO] [talledLocalContainer] ... 55 filtered
[INFO] [talledLocalContainer] at com.atlassian.greenhopper.jira.filters.ClassicBoardRouter.doFilter(ClassicBoardRouter.java:59)
[INFO] [talledLocalContainer] ... 27 filtered
[INFO] [talledLocalContainer] at com.atlassian.labs.httpservice.resource.ResourceFilter.doFilter(ResourceFilter.java:59)
[INFO] [talledLocalContainer] ... 38 filtered
[INFO] [talledLocalContainer] at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:70)
[INFO] [talledLocalContainer] ... 38 filtered
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.lambda$invokeFilterChain$0(CustomerContextSettingFilter.java:169)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.util.scala.ScalaJavaInterOp$1.apply(ScalaJavaInterOp.java:25)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.utils.context.CustomerContextUtil$.outOfCustomerContext(CustomerContextUtil.scala:48)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.utils.context.CustomerContextUtil.outOfCustomerContext(CustomerContextUtil.scala)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.outOfCustomerContext(CustomerContextServiceImpl.java:24)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.outOfCustomerContext(CustomerContextSettingFilter.java:164)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:120)
[INFO] [talledLocalContainer] at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:112)
[INFO] [talledLocalContainer] ... 55 filtered
[INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[INFO] [talledLocalContainer] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
[INFO] [talledLocalContainer] at java.lang.Thread.run(Thread.java:745)
Sorry for the stupid question, what am I doing wrong?
After weeks of searching the web and lot's of trial an error, I finally got the official Active Objects tutorial to work with the latest version of Jira (7.1.2) and spring-scanner 2.0 support.
You can find the full code sample on GitHub, but here is the gist of it:
Declare your depenencies correctly
<!-- Active Objects -->
<dependency>
<groupId>com.atlassian.activeobjects</groupId>
<artifactId>activeobjects-plugin</artifactId>
<version>${ao.version}</version>
<scope>provided</scope>
</dependency>
<!-- SAL, the Active Objects plugin uses SAL's API for transactions -->
<dependency>
<groupId>com.atlassian.sal</groupId>
<artifactId>sal-api</artifactId>
<version>${sal.version}</version>
<scope>provided</scope>
</dependency>
<!-- Dependency Injection -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-annotation</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<scope>compile</scope>
</dependency>
Configure the spring scanner
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-jira-plugin</artifactId>
<version>${amps.version}</version>
<extensions>true</extensions>
<configuration>
<productVersion>${jira.version}</productVersion>
<productDataVersion>${jira.version}</productDataVersion>
<enableQuickReload>true</enableQuickReload>
<enableFastdev>false</enableFastdev>
<instructions>
<Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
<!-- Add package to export here -->
<Export-Package>com.atlassian.tutorial.ao.todo.api,</Export-Package>
<!-- Add package import here -->
<Import-Package>
org.springframework.osgi.*;resolution:="optional",
org.eclipse.gemini.blueprint.*;resolution:="optional",
*
</Import-Package>
<!-- Ensure plugin is spring powered -->
<Spring-Context>*</Spring-Context>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<executions>
<execution>
<goals>
<goal>atlassian-spring-scanner</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
<configuration>
<verbose>false</verbose>
</configuration>
</plugin>
</plugins>
</build>
Properties
<properties>
<!--
This key is used to keep the consistency between the key in atlassian-plugin.xml
and the key to generate bundle.
-->
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
<jira.version>7.2.1</jira.version>
<!--
For correct versions to use with your Atlassian product see target folder, i.e.
/target/container/tomcat8x/cargo-jira-home/webapps/jira/WEB-INF/lib
-->
<amps.version>6.2.4</amps.version>
<ao.version>1.0.0</ao.version>
<sal.version>2.6.0</sal.version>
<slf4j.version>1.7.9</slf4j.version>
<testkit.version>6.3.11</testkit.version>
<plugin.testrunner.version>1.2.3</plugin.testrunner.version>
<spring.version>4.1.6.RELEASE</spring.version>
<!-- See https://bitbucket.org/atlassian/atlassian-spring-scanner -->
<atlassian.spring.scanner.version>1.2.6</atlassian.spring.scanner.version>
<!--Determined by JEE compliant container-->
<servlet.version>3.1.0</servlet.version>
</properties>
** Spring Context**
You also need to configure spring with an /resources/META-INF/spring/plugin-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:atlassian-scanner="http://www.atlassian.com/schema/atlassian-scanner/2"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.atlassian.com/schema/atlassian-scanner/2
http://www.atlassian.com/schema/atlassian-scanner/2/atlassian-scanner.xsd">
<atlassian-scanner:scan-indexes autowire="constructor" />
</beans>
Java Beans
Then you can use #Component to mark your java class for dependency injection.
Since we put autowire="constructor" in our plugin-context.xml, we don't need #Autowired or #Inject annotations for constructor injection anymore.
Your own beans will be injected automatically, external beans have to be market with #ComponentImport:
#Component
public final class TodoServlet extends HttpServlet {
private final TodoService todoService;
private final UserManager userManager;
public TodoServlet(TodoService todoService, #ComponentImport UserManager userManager) {
this.todoService = todoService;
this.userManager = userManager;
}
Hence, you can import Active Objects as follows:
public TodoServiceImpl(#ComponentImport ActiveObjects ao) {
this.ao = ao;
}
Make sure not to do anything with ao in the constructor, since its not ready jet!
Hope that helps

JIRA Active object Exception

I am newbie in jira active object implementation.
I found the error when implementing active object using jTrick
http://www.j-tricks.com/tutorials/active-objects-injection
"Unable to create new reference LazyLoadedServletReference{descriptor=com.atlassian.jira.demo.aoDemo:address-list (A servlet to add and list Address), servletContext=org.apache.catalina.core.ApplicationContextFacade#3a0a701}
[INFO] [talledLocalContainer] com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException: Plugin container accessor is null. Plugin: com.atlassian.jira.demo.aoDemo. Module name: com.atlassian.jira.demo.Servlet.AddressServlet."
Code for IAOService.java
public interface IAOService {
public ActiveObjects getActiveObjects();}
Code for IAOServiceImpl
public class IAOServiceImpl implements IAOService {
private final ActiveObjects ao;
public IAOServiceImpl(ActiveObjects ao) {
System.out.println("Initializing constructor impl");
System.out.println("IAOServiceImpl constructor found active object ::"+ao);
this.ao=ao;
}
public ActiveObjects getActiveObjects() {
return this.ao;
}}
I Inject the dependency in servlet constructor
Dependency code
public AddressServlet(IAOService aoService){
if(aoService!=null) {
this.aoService=aoService; else
this.aoService=null; }
I disable the atlassian-plugin-scanner functionality in my plugin.
Please help me out to solve this issue.
I also mention ao module in plugin descriptor file.
Plugin Descriptor code :
<ao key="ao-module">
<description>Configuration of active object service</description>
<entity>sample.AddressEntity</entity>
<component-import key="ao" name="Active Objects service" interface="com.atlassian.activeobjects.external.ActiveObjects">
<description>Component to access Active Objects functionality from the plugin</description></component-import>
Pom code
<pluginArtifact>
<groupId>com.atlassian.activeobjects</groupId>
<artifactId>activeobjects-plugin</artifactId>
<version>${ao.version}</version>
</pluginArtifact>
<pluginArtifact>
<groupId>com.atlassian.activeobjects</groupId>
<artifactId>activeobjects-jira-spi</artifactId>
<version>${ao.version}</version>
</pluginArtifact>
Ao.version is 0.18
Exception stack
[INFO] [talledLocalContainer] 2016-09-14 11:26:37,451
http-nio-2990-exec-2 DEBUG admin 686x211x1 1x1imyf 172.17.20.51
/rest/plugins/1.0/com.atlassian.jira.demo.aoDemo-key
[c.a.activeobjects.osgi.OsgiServiceUtilsImpl] Registering service
net.java.ao.atlassian.AtlassianTableNameConverter#677b0082 with
interface net.java.ao.schema.TableNameConverter and properties
{com.atlassian.plugin.key=com.atlassian.jira.demo.aoDemo} [INFO]
[talledLocalContainer] 2016-09-14 11:26:37,453 http-nio-2990-exec-2
DEBUG admin 686x211x1 1x1imyf 172.17.20.51
/rest/plugins/1.0/com.atlassian.jira.demo.aoDemo-key
[c.a.activeobjects.osgi.OsgiServiceUtilsImpl] Registering service
com.atlassian.activeobjects.config.internal.DefaultActiveObjectsConfiguration#7e886a2b
with interface
com.atlassian.activeobjects.config.ActiveObjectsConfiguration and
properties {com.atlassian.plugin.key=com.atlassian.jira.demo.aoDemo}
[INFO] [talledLocalContainer] 2016-09-14 11:26:37,457
http-nio-2990-exec-2 DEBUG admin 686x211x1 1x1imyf 172.17.20.51
/rest/plugins/1.0/com.atlassian.jira.demo.aoDemo-key
[c.a.activeobjects.osgi.ActiveObjectsServiceFactory]
onPluginModuleEnabledEvent storing unattached configuration
module for [com.atlassian.jira.demo.aoDemo] [INFO]
[talledLocalContainer] 2016-09-14 11:26:37,463 http-nio-2990-exec-2
DEBUG admin 686x211x1 1x1imyf 172.17.20.51
/rest/plugins/1.0/com.atlassian.jira.demo.aoDemo-key
[c.a.activeobjects.osgi.ActiveObjectsServiceFactory]
onPluginEnabledEvent attaching unbound to
[com.atlassian.jira.demo.aoDemo] [INFO] [talledLocalContainer]
2016-09-14 11:26:37,463 http-nio-2990-exec-2 DEBUG admin 686x211x1
1x1imyf 172.17.20.51
/rest/plugins/1.0/com.atlassian.jira.demo.aoDemo-key
[c.a.activeobjects.osgi.TenantAwareActiveObjects] init bundle
[com.atlassian.jira.demo.aoDemo] [INFO] [talledLocalContainer]
2016-09-14 11:26:37,464 http-nio-2990-exec-2 DEBUG admin 686x211x1
1x1imyf 172.17.20.51
/rest/plugins/1.0/com.atlassian.jira.demo.aoDemo-key
[c.a.activeobjects.osgi.TenantAwareActiveObjects] bundle
[com.atlassian.jira.demo.aoDemo] loading new AO promise for
JiraTenantImpl{id='system'} [INFO] [talledLocalContainer] 2016-09-14
11:26:37,464 http-nio-2990-exec-2 DEBUG admin 686x211x1 1x1imyf
172.17.20.51 /rest/plugins/1.0/com.atlassian.jira.demo.aoDemo-key [c.a.activeobjects.osgi.TenantAwareActiveObjects] setAoConfiguration
[com.atlassian.jira.demo.aoDemo] [INFO] [talledLocalContainer]
2016-09-14 11:26:37,464 http-nio-2990-exec-2 DEBUG admin 686x211x1
1x1imyf 172.17.20.51
/rest/plugins/1.0/com.atlassian.jira.demo.aoDemo-key
[c.a.activeobjects.osgi.TenantAwareActiveObjects] bundle
[com.atlassian.jira.demo.aoDemo] got ActiveObjectsConfiguration [INFO]
[talledLocalContainer] 2016-09-14 11:26:37,474
active-objects-init-JiraTenantImpl{id='system'}-0 DEBUG admin
[c.a.activeobjects.osgi.TenantAwareActiveObjects] bundle
[com.atlassian.jira.demo.aoDemo] creating ActiveObjects [INFO]
[talledLocalContainer] 2016-09-14 11:26:37,488
active-objects-init-JiraTenantImpl{id='system'}-0 DEBUG admin
[c.a.activeobjects.osgi.TenantAwareActiveObjects] bundle
[com.atlassian.jira.demo.aoDemo] created ActiveObjects [INFO]
[talledLocalContainer] 2016-09-14 11:26:47,872 http-nio-2990-exec-9
ERROR admin 686x226x1 1x1imyf 172.17.20.51
/plugins/servlet/addressservlet
[c.a.plugin.servlet.DefaultServletModuleManager] Unable to create new
reference
LazyLoadedServletReference{descriptor=com.atlassian.jira.demo.aoDemo:address-list
(A servlet to add and list Address),
servletContext=org.apache.catalina.core.ApplicationContextFacade#3a0a701}
[INFO] [talledLocalContainer]
com.atlassian.util.concurrent.LazyReference$InitializationException:
java.lang.NullPointerException: Plugin container accessor is null.
Plugin: com.atlassian.jira.demo.aoDemo. Module name:
com.atlassian.jira.demo.Servlet.AddressServlet. [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.plugin.servlet.DefaultServletModuleManager.getInstance(DefaultServletModuleManager.java:374)
[INFO] [talledLocalContainer] at
com.atlassian.plugin.servlet.DefaultServletModuleManager.getServlet(DefaultServletModuleManager.java:353)
[INFO] [talledLocalContainer] at
com.atlassian.plugin.servlet.DefaultServletModuleManager.getServlet(DefaultServletModuleManager.java:171)
[INFO] [talledLocalContainer] at
com.atlassian.plugin.servlet.ServletModuleContainerServlet.service(ServletModuleContainerServlet.java:36)
[INFO] [talledLocalContainer] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:725) [INFO]
[talledLocalContainer] ... 70 filtered [INFO] [talledLocalContainer]
at
com.atlassian.labs.httpservice.resource.ResourceFilter.doFilter(ResourceFilter.java:59)
[INFO] [talledLocalContainer] ... 38 filtered [INFO]
[talledLocalContainer] at
com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:70)
[INFO] [talledLocalContainer] ... 91 filtered [INFO]
[talledLocalContainer] at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[INFO] [talledLocalContainer] at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[INFO] [talledLocalContainer] at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
[INFO] [talledLocalContainer] at
java.lang.Thread.run(Thread.java:745) [INFO] [talledLocalContainer]
Caused by: java.lang.NullPointerException: Plugin container accessor
is null. Plugin: com.atlassian.jira.demo.aoDemo. Module name:
com.atlassian.jira.demo.Servlet.AddressServlet. [INFO]
[talledLocalContainer] at
com.google.common.base.Preconditions.checkNotNull(Preconditions.java:250)
[INFO] [talledLocalContainer] at
com.atlassian.plugin.module.ClassPrefixModuleFactory.createModule(ClassPrefixModuleFactory.java:32)
[INFO] [talledLocalContainer] at
com.atlassian.plugin.module.PrefixDelegatingModuleFactory.createModule(PrefixDelegatingModuleFactory.java:88)
[INFO] [talledLocalContainer] at
com.atlassian.plugin.servlet.descriptors.ServletModuleDescriptor.getModule(ServletModuleDescriptor.java:43)
[INFO] [talledLocalContainer] at
com.atlassian.plugin.servlet.DelegatingPluginServlet.(DelegatingPluginServlet.java:30)
[INFO] [talledLocalContainer] at
com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedServletReference.create(DefaultServletModuleManager.java:456)
[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] ... 211 more
Instead of calling ComponentAccessor.getOSGIComponentInstanceOfType, you should instead inject ActiveObjects into the constructor of your servlet. This is the recommended design pattern anyway, and at least one source suggests that accessing AO without using injection will break in a manner similar to what you have described above.
I believe this occurs because the GetOSGIComponentInstanceOfType is returning a single AO context from the main JIRA (Pico) container which does not know about your plugin, whereas you want the AO that is configured for your plugin's own entities.
Note that servlets are already auto-wired, so you do not need to bother creating a separate <component> like shown in the link above--just add ActiveObjects as a constructor argument to your servlet and save it within your class for later use.

Grails Neo4j - missing "org.grails.datastore.mapping.query.api.BuildableCriteria" integration test fails

Just been trying the Neo4j Grails plugin and had some problems.
Fixed the first myself - it could find the ne04j-jdbc dependency. Added the mavenRepo http://m2.neo4j.org/releases to repositories and it fixed that.
I then created a domain class and integration test. Ran the test but it failed with warning about session etc, so I removed the hibernate plugin and db-migration plugin.
I now get an error like this
....Caused by: java.lang.ClassNotFoundException: org.grails.datastore.mapping.query.api.BuildableCriteria
So where is this class and why would it be missing?
If I add the hibernate plugin back in and re-run, I get an error like this. Either way my test won't work. Any Idea? I don't need the hibernate but I want to try and use neo4j
Error running forked test-app: No bean named 'sessionFactory' is defined
In BuildConfig.groovy I have following plugin installed:
plugins {...
compile ":neo4j:2.0.0-M02"
}
Stacktrace with hibernate still in the build looks like:
Loading Grails 2.4.4
|Configuring classpath
.
|Environment set to test
...................................
|Running without daemon...
............................................Error
|
Fatal error running tests: No bean named 'sessionFactory' is defined (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'sessionFactory' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:641)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1157)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:280)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:271)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.BeanFactory$getBean.call(Unknown Source)
at org.grails.datastore.gorm.plugin.support.PersistenceContextInterceptorAggregator.postProcessBeanFactory(PersistenceContextInterceptorAggregator.groovy:104)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:265)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:126)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:611)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
Error |
Fatal error running tests: No bean named 'sessionFactory' is defined
.Tests FAILED
|
- view reports in E:\workspace\ggts3.6.2-workspace\Neo4jTest\target\test-reports
Error |
Error running forked test-app: No bean named 'sessionFactory' is defined (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'sessionFactory' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:641)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1157)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:280)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:271)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.BeanFactory$getBean.call(Unknown Source)
at org.grails.datastore.gorm.plugin.support.PersistenceContextInterceptorAggregator.postProcessBeanFactory(PersistenceContextInterceptorAggregator.groovy:104)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:265)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:126)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:611)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
Error |
Error running forked test-app: No bean named 'sessionFactory' is defined
Error |
Forked Grails VM exited with error
`
if I disable the hibernate plugin and re run the test I get this
`
|Loading Grails 2.4.4
|Configuring classpath
.
|Environment set to test
..................................
|Running without daemon...
...........................................Error
|
Fatal error running tests: org/grails/datastore/mapping/query/api/BuildableCriteria (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NoClassDefFoundError: org/grails/datastore/mapping/query/api/BuildableCriteria
at org.springsource.loaded.ri.OriginalClassInvoker.createJavaMethod(OriginalClassInvoker.java:56)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlClassGetDeclaredMethods(ReflectiveInterceptor.java:151)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
Caused by: java.lang.ClassNotFoundException: org.grails.datastore.mapping.query.api.BuildableCriteria
... 3 more
Error |
Fatal error running tests: org/grails/datastore/mapping/query/api/BuildableCriteria
.Tests FAILED
|
- view reports in E:\workspace\ggts3.6.2-workspace\Neo4jTest\target\test-reports
Error |
Error running forked test-app: org/grails/datastore/mapping/query/api/BuildableCriteria (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NoClassDefFoundError: org/grails/datastore/mapping/query/api/BuildableCriteria
at org.springsource.loaded.ri.OriginalClassInvoker.createJavaMethod(OriginalClassInvoker.java:56)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlClassGetDeclaredMethods(ReflectiveInterceptor.java:151)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
Caused by: java.lang.ClassNotFoundException: org.grails.datastore.mapping.query.api.BuildableCriteria
... 3 more
Error |
Error running forked test-app: org/grails/datastore/mapping/query/api/BuildableCriteria
Error |
Forked Grails VM exited with error
And my integration test looks like this:
package com.softwood
import grails.test.spock.IntegrationSpec
class PersonIntegrationSpec extends IntegrationSpec {
def setup() {
}
def cleanup() {
}
void "test create"() {
given : "create a person"
def p = new Person (firstName: "william", lastName: "woodman", dateOfBirth : new Date())
when: "save him"
p.neo4j.save (failOnError : true)
then:
p.id
def res = Person.neo4j.get(p.id)
res.firstName == "william"
}
}

Resources