I try to do an Active Objects module but got NoSuchBeanDefinitionException when trying to execute my servlet

I try to do an Active Objects module but got NoSuchBeanDefinitionException when trying to execute my servlet.

Here is the servlet xml on atlassian-plugin-xml:

<servlet name="Load and add Custom Gantt Charts" i18n-name-key="load-add-gantt-charts.name" key="load-add-gantt-servlet" class="com.i4ware.plugin.timesheet.GanttChartListServlet">
    <description key="load-add-gantt-charts.description">Load and add Custom Gantt Charts Servlet Plugin</description>
    <url-pattern>/timesheet/load-add-gantt</url-pattern>
  </servlet>

And the Java-code goes like this:

package com.i4ware.plugin.timesheet;

import com.atlassian.plugin.spring.scanner.annotation.component.Scanned;
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;

import com.atlassian.jira.project.Project;
import com.atlassian.jira.project.ProjectManager;
import org.ofbiz.core.entity.DelegatorInterface;
import org.ofbiz.core.entity.EntityExpr;
import org.ofbiz.core.entity.EntityOperator;
import org.ofbiz.core.entity.GenericEntityException;
import org.ofbiz.core.entity.GenericValue;
import org.ofbiz.core.util.UtilMisc;
import org.apache.commons.lang.StringEscapeUtils;
import com.atlassian.jira.user.ApplicationUser;
import com.atlassian.jira.security.JiraAuthenticationContext;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.upm.api.license.PluginLicenseManager;
import com.atlassian.upm.api.license.entity.LicenseError;
import com.atlassian.upm.api.license.entity.PluginLicense;

import com.atlassian.plugin.webresource.WebResourceManager;
import com.atlassian.templaterenderer.TemplateRenderer;

import javax.inject.Inject;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

import com.atlassian.jira.util.json.JSONObject;
import com.atlassian.jira.util.json.JSONException;
import com.atlassian.jira.util.json.JSONArray;
import java.lang.reflect.Type;
import com.i4ware.plugin.util.Pageable;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.util.List;
import java.util.Date;
import java.sql.Timestamp;
import org.apache.log4j.Category;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.text.ParseException;

import static com.google.common.base.Preconditions.*;

@Scanned
public final class GanttChartListServlet extends HttpServlet
{
	private static final Category log = Category.getInstance(GanttChartListServlet.class);
    /** value is made for JSON {"success":true} or {"success":false}. */
    private Boolean value;
    /** tasks Object. i.e tasks = arr; */
    private Object issues;
    
	private final GanttChartListService ganttChartListService;	
	private ProjectManager projectManager;
	private JiraAuthenticationContext authenticationContext;
	private final PluginLicenseManager licenseManager;
	private WebResourceManager webResourceManager;
	private final TemplateRenderer renderer;
	private IssueManager issueManager;
	
	private String json;
    private JSONObject obj;
    private int pages;
	private int page;
	private Date startDate;
	private Date endDate;
	
	@Inject
    public GanttChartListServlet(GanttChartListService ganttChartListService, 
    				   PluginLicenseManager licenseManager,
    				   WebResourceManager webResourceManager,
    				   TemplateRenderer renderer,
    				   IssueManager issueManager, 
    				   ProjectManager projectManager,  
    				   JiraAuthenticationContext authenticationContext)
    {
        this.ganttChartListService = checkNotNull(ganttChartListService);
        this.licenseManager = licenseManager;
        this.webResourceManager = webResourceManager;
        this.renderer = renderer;
		this.issueManager = issueManager;
		this.projectManager = projectManager;
		this.authenticationContext = authenticationContext;        
    }

	
	@Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
    {
		resp.setContentType("application/json");
        
		ApplicationUser targetUser = authenticationContext.getLoggedInUser();
        
        String user = "";
        
        if (targetUser==null) {
        	
        	user = "anonymous";
        	
        } else {
        	
        	user = targetUser.getName();
        	
        }
        
		int startReq = Integer.valueOf(req.getParameter("start")).intValue();
        int limitReq = Integer.valueOf(req.getParameter("limit")).intValue();
		int pageRange = Integer.valueOf(req.getParameter("page")).intValue();
		
		JSONArray arr = new JSONArray();
		
		for (GanttChartList ganttChartList : ganttChartListService.all())
        {
			try {
				
				JSONObject obj = new JSONObject()
	    		        .put("id", ganttChartList.getId())
	    		        .put("description", ganttChartList.getDescription());
				
			} catch (JSONException err) {
	        	err.printStackTrace();
	        	System.out.println("Got an JSONException: " + err.getCause());
	        }
        }
		
		int projectcount = arr.length();
	    
		Gson gson = new Gson();
		
		Type type = new TypeToken<List<Object>>() {}.getType();
		List<Object> list = gson.fromJson(arr.toString(), type);
		
		Pageable<List> pageable = new Pageable(list);
		
		pageable.setPageSize(limitReq);
		pageable.setPage(pageRange);
				
		List pagelist = pageable.getListForPage();
		
		String jsonOutput = gson.toJson(pagelist);
		
        try {
			
			JSONArray arrfinal = new JSONArray(jsonOutput);
	        
	        pages = projectcount;
			issues = arrfinal;
			
		} catch (JSONException err) {
        	err.printStackTrace();
        	System.out.println("Got an JSONException: " + err.getCause());
        }
        
         try {
	        
	        json = new JSONObject()
	        .put("ganttcharts", issues)
	        .put("totalCount", pages)
	        .put("success", value)
	        .toString();
        
        } catch (JSONException err) {
        	err.printStackTrace();
        	System.out.println("Got an JSONException: " + err.getCause());
        }
    }
	
	@Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
    {
		final String title = req.getParameter("title");
		final String description = req.getParameter("description");
        String projectIdreq = req.getParameter("project");
        Project project = projectManager.getProjectObjByKey(projectIdreq);
        long projectId = project.getId();
        String sDate = req.getParameter("startdate"); 
        sDate = sDate.replaceAll("T"," ");
        String eDate = req.getParameter("enddate"); 
        eDate = eDate.replaceAll("T"," ");
        
        value = Boolean.valueOf(!"false"
				.equalsIgnoreCase((String) "true"));
		
		  try {
			  
		      SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
			  startDate = dateFormat.parse(sDate);
			  
		  } catch (ParseException e) {
			  value = Boolean.valueOf(!"false" 
                .equalsIgnoreCase((String) "false")); 
              System.out.println("Got a ParseException: " + e.getCause()); 
		  }
		  
          try {
			  
		      SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
			  endDate = dateFormat.parse(eDate);
			  
		  } catch (ParseException e) {
			  value = Boolean.valueOf(!"false" 
                .equalsIgnoreCase((String) "false")); 
              System.out.println("Got a ParseException: " + e.getCause()); 
		  }
          
          ganttChartListService.add(title, description, startDate, endDate, projectId);
          
          try {
  			
  			json = new JSONObject()
  			.put("success", value)
  			.toString();
  			
  			} catch (JSONException err) {
  				err.printStackTrace();
  				System.out.println("Got an JSONException: " + err.getCause());
  			}
    }
	
}

Servlet in my Firefox Webdeveloper Tools seams to go error 404.

There’s nothing in that code block that references activeobjects. Can you paste the full error?

Here is full Stack Trace Error:

2019-12-24 16:55:48,575+0000 plugin-transaction-0 INFO      [c.a.jira.plugin.PluginTransactionListener] [plugin-transaction] numberStartEvents:752, numberEndEvents:752, numberSendEvents:411, numberEventsInTransactions:16566, numberOfPluginEnableEvents:313
2019-12-24 16:58:14,530+0000 http-nio-8181-exec-12 ERROR admin 1018x2099x1 1uay76s 109.240.54.87,127.0.0.1 /plugins/servlet/timesheet/load-add-gantt [c.a.plugin.module.PrefixDelegatingModuleFactory] Detected an error instantiating the module via Spring. This usually means that you haven't created a <component-import> for the interface you're trying to use. https://developer.atlassian.com/x/TAEr  for more details.
2019-12-24 16:58:14,530+0000 http-nio-8181-exec-12 ERROR admin 1018x2099x1 1uay76s 109.240.54.87,127.0.0.1 /plugins/servlet/timesheet/load-add-gantt [c.a.plugin.servlet.DefaultServletModuleManager] Unable to create new reference LazyLoadedServletReference{descriptor=com.i4ware.plugin.timesheet.timesheet:load-add-gantt-servlet (Load and add Custom Gantt Charts Servlet Plugin), servletContext=org.apache.catalina.core.ApplicationContextFacade@35325870}
io.atlassian.util.concurrent.LazyReference$InitializationException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.i4ware.plugin.timesheet.GanttChartListServlet': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.i4ware.plugin.timesheet.GanttChartListService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:156)
	at io.atlassian.util.concurrent.LazyReference.get(LazyReference.java:116)
	at com.atlassian.plugin.servlet.DefaultServletModuleManager.getInstance(DefaultServletModuleManager.java:430)
	at com.atlassian.plugin.servlet.DefaultServletModuleManager.getServlet(DefaultServletModuleManager.java:409)
	at com.atlassian.plugin.servlet.DefaultServletModuleManager.getServlet(DefaultServletModuleManager.java:229)
	at com.atlassian.plugin.servlet.ServletModuleContainerServlet.service(ServletModuleContainerServlet.java:37)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	... 44 filtered
	at com.atlassian.servicedesk.internal.web.ExternalCustomerLockoutFilter.doFilter(ExternalCustomerLockoutFilter.java:55)
	... 8 filtered
	at com.atlassian.jira.plugin.mobile.web.filter.MobileAppRequestFilter.doFilter(MobileAppRequestFilter.java:37)
	... 4 filtered
	at com.atlassian.jira.plugin.mobile.login.MobileLoginSuccessFilter.doFilter(MobileLoginSuccessFilter.java:54)
	... 3 filtered
	at com.atlassian.diagnostics.internal.platform.monitor.http.HttpRequestMonitoringFilter.doFilter(HttpRequestMonitoringFilter.java:55)
	... 8 filtered
	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
	... 62 filtered
	at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66)
	... 1 filtered
	at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64)
	... 40 filtered
	at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
	... 5 filtered
	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.lambda$invokeFilterChain$0(CustomerContextSettingFilter.java:212)
	at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.rteInvoke(ReentrantThreadLocalBasedCodeContext.java:136)
	at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.runOutOfContext(ReentrantThreadLocalBasedCodeContext.java:89)
	at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.runOutOfCustomerContext(CustomerContextServiceImpl.java:47)
	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.outOfCustomerContext(CustomerContextSettingFilter.java:203)
	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:134)
	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:123)
	... 4 filtered
	at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:37)
	... 8 filtered
	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
	... 4 filtered
	at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
	... 29 filtered
	at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
	... 25 filtered
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.i4ware.plugin.timesheet.GanttChartListServlet': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.i4ware.plugin.timesheet.GanttChartListService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:733)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:198)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1266)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1123)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:535)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:353)
	... 2 filtered
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.atlassian.plugin.osgi.spring.DefaultSpringContainerAccessor.createBean(DefaultSpringContainerAccessor.java:99)
	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:42)
	at com.atlassian.plugin.servlet.DelegatingPluginServlet.<init>(DelegatingPluginServlet.java:30)
	at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedServletReference.create(DefaultServletModuleManager.java:528)
	at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedServletReference.create(DefaultServletModuleManager.java:512)
	at io.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:332)
	at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:150)
	... 274 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.i4ware.plugin.timesheet.GanttChartListService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1506)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1101)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1062)
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:819)
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:725)
2019-12-24 17:00:48,575+0000 plugin-transaction-0 INFO      [c.a.jira.plugin.PluginTransactionListener] [plugin-transaction] numberStartEvents:752, numberEndEvents:752, numberSendEvents:411, numberEventsInTransactions:16566, numberOfPluginEnableEvents:313
2019-12-24 17:05:48,575+0000 plugin-transaction-0 INFO      [c.a.jira.plugin.PluginTransactionListener] [plugin-transaction] numberStartEvents:752, numberEndEvents:752, numberSendEvents:411, numberEventsInTransactions:16566, numberOfPluginEnableEvents:313
2019-12-24 17:10:48,575+0000 plugin-transaction-0 INFO      [c.a.jira.plugin.PluginTransactionListener] [plugin-transaction] numberStartEvents:752, numberEndEvents:752, numberSendEvents:411, numberEventsInTransactions:16566, numberOfPluginEnableEvents:313
2019-12-24 17:12:33,203+0000 http-nio-8181-exec-16 WARN admin 1032x2189x2 vdhzpy 109.240.54.87,127.0.0.1 /rest/plugins/1.0/installed-marketplace [c.a.upm.pac.PacClientImpl] The request to check for add-on updates may take longer than expected because 202 user-installed add-ons are installed. This may impact the performance of loading the Manage Add-ons page.
2019-12-24 17:13:18,568+0000 UpmAsynchronousTaskManager:thread-3 INFO admin 689x638x1 1t31wpk 109.240.54.87,127.0.0.1 /rest/plugins/1.0/ [c.a.plugin.loaders.ScanningPluginLoader] No plugins found to be installed
2019-12-24 17:13:24,334+0000 UpmAsynchronousTaskManager:thread-3 INFO admin 689x638x1 1t31wpk 109.240.54.87,127.0.0.1 /rest/plugins/1.0/ [c.a.plugin.manager.DefaultPluginManager] Updating plugin 'com.i4ware.plugin.timesheet.timesheet' from version '11.6.1' to version '11.6.1'
2019-12-24 17:13:24,334+0000 UpmAsynchronousTaskManager:thread-3 INFO admin 689x638x1 1t31wpk 109.240.54.87,127.0.0.1 /rest/plugins/1.0/ [c.a.plugin.manager.DefaultPluginManager] Disabling com.i4ware.plugin.timesheet.timesheet
2019-12-24 17:13:24,523+0000 UpmAsynchronousTaskManager:thread-3 DEBUG admin 689x638x1 1t31wpk 109.240.54.87,127.0.0.1 /rest/plugins/1.0/ [c.a.activeobjects.osgi.ActiveObjectsServiceFactory] onPluginDisabledEvent removing delegate for [com.i4ware.plugin.timesheet.timesheet]
2019-12-24 17:13:24,536+0000 UpmAsynchronousTaskManager:thread-3 INFO admin 689x638x1 1t31wpk 109.240.54.87,127.0.0.1 /rest/plugins/1.0/ [c.a.plugin.loaders.ScanningPluginLoader] Removed plugin 'com.i4ware.plugin.timesheet.timesheet'
2019-12-24 17:13:24,625+0000 UpmAsynchronousTaskManager:thread-3 INFO admin 689x638x1 1t31wpk 109.240.54.87,127.0.0.1 /rest/plugins/1.0/ [c.a.plugin.util.WaitUntil] Plugins that have yet to be enabled: (1): [com.i4ware.plugin.timesheet.timesheet], 300 seconds remaining
2019-12-24 17:13:25,795+0000 UpmAsynchronousTaskManager:thread-3 DEBUG admin 689x638x1 1t31wpk 109.240.54.87,127.0.0.1 /rest/plugins/1.0/ [c.a.activeobjects.osgi.OsgiServiceUtilsImpl] Registering service net.java.ao.atlassian.AtlassianTableNameConverter@25b09f16 with interface net.java.ao.schema.TableNameConverter and properties {com.atlassian.plugin.key=com.i4ware.plugin.timesheet.timesheet}
2019-12-24 17:13:25,799+0000 UpmAsynchronousTaskManager:thread-3 DEBUG admin 689x638x1 1t31wpk 109.240.54.87,127.0.0.1 /rest/plugins/1.0/ [c.a.activeobjects.osgi.OsgiServiceUtilsImpl] Registering service com.atlassian.activeobjects.config.internal.DefaultActiveObjectsConfiguration@5711fe36 with interface com.atlassian.activeobjects.config.ActiveObjectsConfiguration and properties {com.atlassian.plugin.key=com.i4ware.plugin.timesheet.timesheet}
2019-12-24 17:13:25,801+0000 UpmAsynchronousTaskManager:thread-3 DEBUG admin 689x638x1 1t31wpk 109.240.54.87,127.0.0.1 /rest/plugins/1.0/ [c.a.activeobjects.osgi.ActiveObjectsServiceFactory] onPluginModuleEnabledEvent storing unattached <ao> configuration module for [com.i4ware.plugin.timesheet.timesheet]
2019-12-24 17:13:25,818+0000 UpmAsynchronousTaskManager:thread-3 DEBUG admin 689x638x1 1t31wpk 109.240.54.87,127.0.0.1 /rest/plugins/1.0/ [c.a.activeobjects.osgi.ActiveObjectsServiceFactory] onPluginEnabledEvent attaching unbound <ao> to [com.i4ware.plugin.timesheet.timesheet]
2019-12-24 17:13:25,818+0000 UpmAsynchronousTaskManager:thread-3 DEBUG admin 689x638x1 1t31wpk 109.240.54.87,127.0.0.1 /rest/plugins/1.0/ [c.a.activeobjects.osgi.TenantAwareActiveObjects] init bundle [com.i4ware.plugin.timesheet.timesheet]
2019-12-24 17:13:25,818+0000 UpmAsynchronousTaskManager:thread-3 DEBUG admin 689x638x1 1t31wpk 109.240.54.87,127.0.0.1 /rest/plugins/1.0/ [c.a.activeobjects.osgi.TenantAwareActiveObjects] bundle [com.i4ware.plugin.timesheet.timesheet] loading new AO promise for JiraTenantImpl{id='system'}
2019-12-24 17:13:25,819+0000 UpmAsynchronousTaskManager:thread-3 DEBUG admin 689x638x1 1t31wpk 109.240.54.87,127.0.0.1 /rest/plugins/1.0/ [c.a.activeobjects.osgi.TenantAwareActiveObjects] setAoConfiguration [com.i4ware.plugin.timesheet.timesheet]
2019-12-24 17:13:25,819+0000 UpmAsynchronousTaskManager:thread-3 DEBUG admin 689x638x1 1t31wpk 109.240.54.87,127.0.0.1 /rest/plugins/1.0/ [c.a.activeobjects.osgi.TenantAwareActiveObjects] bundle [com.i4ware.plugin.timesheet.timesheet] got ActiveObjectsConfiguration
2019-12-24 17:13:25,819+0000 active-objects-init-JiraTenantImpl{id='system'}-0 DEBUG admin     [c.a.activeobjects.osgi.TenantAwareActiveObjects] bundle [com.i4ware.plugin.timesheet.timesheet] creating ActiveObjects
2019-12-24 17:13:25,848+0000 active-objects-init-JiraTenantImpl{id='system'}-0 DEBUG admin     [c.a.activeobjects.osgi.TenantAwareActiveObjects] bundle [com.i4ware.plugin.timesheet.timesheet] created ActiveObjects
2019-12-24 17:13:26,653+0000 UpmScheduler:thread-2 WARN admin     [c.a.upm.pac.PacClientImpl] The request to check for add-on updates may take longer than expected because 202 user-installed add-ons are installed. This may impact the performance of loading the Manage Add-ons page.
2019-12-24 17:13:27,972+0000 http-nio-8181-exec-5 WARN admin 1033x2251x1 vdhzpy 109.240.54.87,127.0.0.1 /rest/plugins/1.0/installed-marketplace [c.a.upm.pac.PacClientImpl] The request to check for add-on updates may take longer than expected because 202 user-installed add-ons are installed. This may impact the performance of loading the Manage Add-ons page.
2019-12-24 17:14:18,289+0000 http-nio-8181-exec-10 ERROR admin 1034x2276x1 vdhzpy 109.240.54.87,127.0.0.1 /plugins/servlet/timesheet/load-add-gantt [c.a.plugin.module.PrefixDelegatingModuleFactory] Detected an error instantiating the module via Spring. This usually means that you haven't created a <component-import> for the interface you're trying to use. https://developer.atlassian.com/x/TAEr  for more details.
2019-12-24 17:14:18,289+0000 http-nio-8181-exec-10 ERROR admin 1034x2276x1 vdhzpy 109.240.54.87,127.0.0.1 /plugins/servlet/timesheet/load-add-gantt [c.a.plugin.servlet.DefaultServletModuleManager] Unable to create new reference LazyLoadedServletReference{descriptor=com.i4ware.plugin.timesheet.timesheet:load-add-gantt-servlet (Load and add Custom Gantt Charts Servlet Plugin), servletContext=org.apache.catalina.core.ApplicationContextFacade@35325870}
io.atlassian.util.concurrent.LazyReference$InitializationException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.i4ware.plugin.timesheet.GanttChartListServlet': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.i4ware.plugin.timesheet.GanttChartListService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:156)
	at io.atlassian.util.concurrent.LazyReference.get(LazyReference.java:116)
	at com.atlassian.plugin.servlet.DefaultServletModuleManager.getInstance(DefaultServletModuleManager.java:430)
	at com.atlassian.plugin.servlet.DefaultServletModuleManager.getServlet(DefaultServletModuleManager.java:409)
	at com.atlassian.plugin.servlet.DefaultServletModuleManager.getServlet(DefaultServletModuleManager.java:229)
	at com.atlassian.plugin.servlet.ServletModuleContainerServlet.service(ServletModuleContainerServlet.java:37)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	... 44 filtered
	at com.atlassian.servicedesk.internal.web.ExternalCustomerLockoutFilter.doFilter(ExternalCustomerLockoutFilter.java:55)
	... 8 filtered
	at com.atlassian.jira.plugin.mobile.web.filter.MobileAppRequestFilter.doFilter(MobileAppRequestFilter.java:37)
	... 4 filtered
	at com.atlassian.jira.plugin.mobile.login.MobileLoginSuccessFilter.doFilter(MobileLoginSuccessFilter.java:54)
	... 3 filtered
	at com.atlassian.diagnostics.internal.platform.monitor.http.HttpRequestMonitoringFilter.doFilter(HttpRequestMonitoringFilter.java:55)
	... 8 filtered
	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
	... 62 filtered
	at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66)
	... 1 filtered
	at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64)
	... 40 filtered
	at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
	... 5 filtered
	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.lambda$invokeFilterChain$0(CustomerContextSettingFilter.java:212)
	at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.rteInvoke(ReentrantThreadLocalBasedCodeContext.java:136)
	at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.runOutOfContext(ReentrantThreadLocalBasedCodeContext.java:89)
	at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.runOutOfCustomerContext(CustomerContextServiceImpl.java:47)
	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.outOfCustomerContext(CustomerContextSettingFilter.java:203)
	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:134)
	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:123)
	... 4 filtered
	at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:37)
	... 8 filtered
	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
	... 4 filtered
	at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
	... 29 filtered
	at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
	... 25 filtered
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.i4ware.plugin.timesheet.GanttChartListServlet': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.i4ware.plugin.timesheet.GanttChartListService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:733)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:198)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1266)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1123)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:535)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:353)
	... 2 filtered
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.atlassian.plugin.osgi.spring.DefaultSpringContainerAccessor.createBean(DefaultSpringContainerAccessor.java:99)
	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:42)
	at com.atlassian.plugin.servlet.DelegatingPluginServlet.<init>(DelegatingPluginServlet.java:30)
	at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedServletReference.create(DefaultServletModuleManager.java:528)
	at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedServletReference.create(DefaultServletModuleManager.java:512)
	at io.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:332)
	at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:150)
	... 274 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.i4ware.plugin.timesheet.GanttChartListService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1506)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1101)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1062)
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:819)
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:725)

Instead of @Scanned this should be using @Named yes?

@sfbehnke is probably on the right path. Are all of your services and imports annotated correctly with @Component and @ComponentImport ?

I am not set annotations of @Component and @ComponentImport to any files.

Btw, here is Database Schema to see what Java files is created and on Gantt_Chart_List table has a some reason non needed column Issues_On_Chart_Id by some unknown reason.

@matti.kiviharju Looks like an annotation such as @Component, @ComponentImport, @Service is missing.

The error says that your class cannot be instantiated because the first argument cannot be autowired. This refers to GanttChartListService. Try adding @Component or @Service to the class. If GanttChartListService is an interface, then add the annotation to the implementing class.

3 Likes

This is solution but in command line when I try to run atlass-package I get these errors:

They should not prevent compilation or building the package. At the top:

Found a type [com.i4ware.plugin.timesheet.GanttChartListService] annotated as a component, but the type is not a concrete class. NOT adding to index file!!

This reads to me as if you wrote something like

@Named
public interface GanttChartListService {
    /** stuff here **/
}

However… You should NOT be annotating Abstract Classes or Interfaces. You should ONLY Annotate Concrete Classes!

1 Like

I just still get it to work.

I added this atlassian-plugin.xml and not plugin can not be enabled:

<component key="ganttChartListService" class="com.i4ware.plugin.api.GanttChartListServiceImpl">
        <description>Provides gantt Chart List Services.</description>
        <interface>com.i4ware.plugin.api.GanttChartListService</interface>
  </component>

Error is like this:

2020-01-01 03:15:05,406+0000 ThreadPoolAsyncTaskExecutor::Thread 66 ERROR admin 689x617x2 1t31wpk 109.240.54.87,127.0.0.1 /rest/plugins/1.0/installed-marketplace [c.a.p.osgi.factory.OsgiPlugin] Unable to start the plugin container for plugin 'com.i4ware.plugin.timesheet.timesheet'
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ganttChartListService' defined in URL [bundle://320.0:0/META-INF/spring/atlassian-plugins-components.xml]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.atlassian.activeobjects.external.ActiveObjects' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}

Sorry this was missing…

<component-import key="ao" interface="com.atlassian.activeobjects.external.ActiveObjects"/>

Understood – You’re using the older XML based declaration. The @Service, @Component, @ComponentImport annotations are not necessary in the XML style declaration.