Plugin to create custom tab on project page

Using teamcity 4.0.2:

I'm following the guides in the developer kit for creating plugins.  I created the samples without an issue.  Now I am attempting to create my own plugin.
I'd like to add a custom tab on the project page.  I am able to do this if i use the SimpleCustomTab class, however, when I switch over to using the ProjectTab class my bean will not deploy.

My bean is configured as follows:

    <bean id="sampleConfigTab"
          
          init-method="register">
        <property name="title" value="Promotion Configs"/>
        <property name="tabCode" value="999"/>
    </bean>  

I'm sure it's due to the properties I am setting.   I assume I only need to set the ones which are present in the constructor.   Any point in the right direction would be appreciated.


When deploying I see this warning:

[2009-04-22 16:02:58,666]   INFO - .spring.SpringPluginLoader$1$1 - Bean factory for application context [jetbrains.buildServer.web.plugins.spring.SpringPluginLoader$1$1@1301061]: org.springframework.beans.factory.support.DefaultListableBeanFactory@8353f6
[2009-04-22 16:02:58,713]   WARN - ildServer.util.EventDispatcher - org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sampleConfigTab' defined in URL [file:/C:/TeamCity2/temp/samplePlugin50007spring.config.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.lang.String]: No unique bean of type [java.lang.String] is defined: Unsatisfied dependency of type [class java.lang.String]: expected at least 1 matching bean
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sampleConfigTab' defined in URL [file:/C:/TeamCity2/temp/samplePlugin50007spring.config.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.lang.String]: No unique bean of type [java.lang.String] is defined: Unsatisfied dependency of type [class java.lang.String]: expected at least 1 matching bean
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:570)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:190)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:923)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:833)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:217)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
    at jetbrains.buildServer.web.plugins.spring.SpringPluginLoader$1.configsExtracted(SpringPluginLoader.java:10)
    at jetbrains.buildServer.web.plugins.spring.SpringPluginConfigExtracter.start(SpringPluginConfigExtracter.java:21)
    at jetbrains.buildServer.web.plugins.spring.SpringPluginLoader.pluginClassesLoaded(SpringPluginLoader.java:2)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at jetbrains.buildServer.util.EventDispatcher.dispatch(EventDispatcher.java:69)
    at jetbrains.buildServer.util.EventDispatcher$1.invoke(EventDispatcher.java:36)
    at $Proxy7.pluginClassesLoaded(Unknown Source)
    at jetbrains.buildServer.web.plugins.classLoaders.OneClassLoader.pluginInfoFound(OneClassLoader.java:9)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at jetbrains.buildServer.util.EventDispatcher.dispatch(EventDispatcher.java:69)
    at jetbrains.buildServer.util.EventDispatcher$1.invoke(EventDispatcher.java:36)
    at $Proxy8.pluginInfoFound(Unknown Source)
    at jetbrains.buildServer.web.plugins.loaders.PluginInfoLoaderImpl.load(PluginInfoLoaderImpl.java:21)
    at jetbrains.buildServer.web.plugins.loaders.PluginInfoLoaderImpl.access$000(PluginInfoLoaderImpl.java:32)
    at jetbrains.buildServer.web.plugins.loaders.PluginInfoLoaderImpl$1.pluginJarsFound(PluginInfoLoaderImpl.java:2)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at jetbrains.buildServer.util.EventDispatcher.dispatch(EventDispatcher.java:69)
    at jetbrains.buildServer.util.EventDispatcher$1.invoke(EventDispatcher.java:36)
    at $Proxy9.pluginJarsFound(Unknown Source)
    at jetbrains.buildServer.web.plugins.files.PluginJarSearcher.processPluginDirectory(PluginJarSearcher.java:3)
    at jetbrains.buildServer.web.plugins.files.PluginJarSearcher.loadPluginsFrom(PluginJarSearcher.java:12)
    at jetbrains.buildServer.web.plugins.files.UnpackingPluginJarSearcher.loadPluginsFrom(UnpackingPluginJarSearcher.java:18)
    at jetbrains.buildServer.web.plugins.PluginManagerImpl.loadPlugins(PluginManagerImpl.java:1)
    at jetbrains.buildServer.web.impl.BuildServerConfigurator.loadPlugins(BuildServerConfigurator.java:43)
    at jetbrains.buildServer.web.impl.BuildServerConfigurator.loadConfiguration(BuildServerConfigurator.java:9)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1412)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1373)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1333)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:471)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:217)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:354)
    at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:292)
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:262)
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
    at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    at jetbrains.spring.web.TeamCityDispatcherServlet.init(TeamCityDispatcherServlet.java:10)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
    at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

1 comment
Comment actions Permalink

Solved.  

  <bean id="sampleExtensionHeader"
          
          init-method="register">
        <property name="placeId" value="PROJECT_TAB"/>
        <property name="pluginName" value="samplePlugin"/>
        <property name="includeUrl" value="ruel.jsp"/>
    </bean>


The correct way for me to do this was to extend SimplePageExtension and then call that class.

0

Please sign in to leave a comment.