Create JIRA [8.2.4] custom field plugin module - SDK: 8.0.16 - UnsatisfiedDependencyException

Hello.

For two days I have been trying to solve the problem with my plugin. Unfortunately, no results.

After creating the plugin according to the tutorials at developer.atlassian.com and running it on JIRA, I get an error:

io.atlassian.util.concurrent.LazyReference$InitializationException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pl.jira.project.customfields.messageResponseField': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.atlassian.jira.issue.customfields.persistence.CustomFieldValuePersister' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport(value=)}

Link to full error text:

Java class:

package pl.jira.project.customfields;

import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.customfields.impl.TextCFType;
import com.atlassian.jira.issue.customfields.manager.GenericConfigManager;
import com.atlassian.jira.issue.customfields.persistence.CustomFieldValuePersister;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.fields.config.FieldConfig;
import com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem;
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import javax.inject.Named;
import java.util.Map;


@Named
public class MessageResponseField extends TextCFType {
    private static final Logger log = LoggerFactory.getLogger(MessageResponseField.class);
    @Autowired
    public MessageResponseField(@ComponentImport CustomFieldValuePersister customFieldValuePersister,
                              @ComponentImport GenericConfigManager genericConfigManager) {
    super(customFieldValuePersister, genericConfigManager);
}
    
    @Override
    public Map<String, Object> getVelocityParameters(final Issue issue,
                                                     final CustomField field,
                                                     final FieldLayoutItem fieldLayoutItem) {
        final Map<String, Object> map = super.getVelocityParameters(issue, field, fieldLayoutItem);

        // This method is also called to get the default value, in
        // which case issue is null so we can't use it to add currencyLocale
        if (issue == null) {
            return map;
        }

         FieldConfig fieldConfig = field.getRelevantConfig(issue);
         //add what you need to the map here

        return map;
    }
}

Project tree from src:

└───main
    ├───java
    │   └───pl
    │       └───jira
    │           └───project
    │               ├───api
    │               │       MyPluginComponent.java
    │               │
    │               ├───customfields
    │               │       MessageResponseField.java
    │               │
    │               └───impl
    │                       MyPluginComponentImpl.java
    │
    └───resources
        │   atlassian-plugin.xml
        │   service.properties
        │
        ├───css
        │       service.css
        │
        ├───images
        │       pluginIcon.png
        │       pluginLogo.png
        │
        ├───js
        │       service.js
        │
        ├───META-INF
        │   └───spring
        │           plugin-context.xml
        │
        └───templates
            └───customfields
                └───message-response-field
                        edit.vm
                        view.vm

I would be very grateful for your help.

Summary

This text will be hidden

Your code is practically identical to mine, the only problem I can see is you are using old versions.

My Jira server is 8.22.2 and SDK is 8.2.7.