No matching bean of type [jetbrains.buildServer.ExtensionHolder]
Try to write a plugin to add a couple of new system parameters for the build. The class is look like
public class NewSysParams {syspa
public NewSysParams (@NotNull ServerPaths serverPaths,
@NotNull ExtensionHolder extensionHolder,
@NotNull PluginDescriptor pluginDescriptor) {
String configDirPath = serverPaths.getConfigDir();
myVersion = "pre 6.5 EAP";
System.out.println(
Thread.currentThread().getStackTrace()[1].getMethodName());
LOG.warn(
Thread.currentThread().getStackTrace()[1].getMethodName() + "configDIRPath - " + configDirPath + "myVersion = " + myVersion);
if (init(configDirPath)) {
SystemParamProvider extension = new SystemParamProvider(this);
myExtensionsHolder = extensionHolder;
myExtensionsHolder.registerExtension(BuildParametersProvider.class, SystemParamProvider.class.getName(), extension);
}
}
The build-server-plugin-sysparam-plugin.xml looks like,
<?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:lang="http://www.springframework.org/schema/lang" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd" default-autowire="constructor">
<bean />
</beans>
when the plugin is loaded, the server reports error,
[2013-06-16 09:08:15,914] ERROR - gins.spring.SpringPluginLoader - Failed to initialize spring context for plugin sysparam-plugin
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name NewSysParams
Unsatisfied dependency expressed through constructor argument with index 1 of type [jetbrains.buildServer.ExtensionHolder]: : No matching bean of type [jetbrains.buildServer.ExtensionHolder] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [jetbrains.buildServer.ExtensionHolder] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations
Any clue on the error and the fix? Thanks
Please sign in to leave a comment.