pwielgolaski / teamcity-oauth

teamcity oauth2 authentication plugin
Apache License 2.0
42 stars 25 forks source link

Error creating bean with name loginController defined in class path on upgrade to 1.1.9 #37

Open ianseyer opened 2 years ago

ianseyer commented 2 years ago

After rebuilding + uploading the newest version of the teamcity-oauth-plugin, we are now seeing this error:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginController' defined in class path resource [jetbrains/buildServer/auth/oauth/PluginConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [jetbrains.buildServer.auth.oauth.LoginViaOAuthController]: Factory method 'loginController' threw exception; nested exception is java.lang.IllegalStateException: Cannot map handler of type [class jetbrains.buildServer.auth.oauth.LoginViaOAuthController] to URL path [/oauthLogin.html]: There is already handler of type [class jetbrains.buildServer.auth.oauth.LoginViaOAuthController] mapped.
at 
[...]
Caused by: java.lang.IllegalStateException: Cannot map handler of type [class jetbrains.buildServer.auth.oauth.LoginViaOAuthController] to URL path [/oauthLogin.html]: There is already handler of type [class jetbrains.buildServer.auth.oauth.LoginViaOAuthController] mapped.
at jetbrains.spring.web.TeamCitySimpleUrlHandlerMapping.registerHandler(TeamCitySimpleUrlHandlerMapping.java:51)
at jetbrains.spring.web.UrlMapping.registerHandler(UrlMapping.java:4)
at jetbrains.spring.web.UrlMapping.addHandler(UrlMapping.java:64)
at jetbrains.buildServer.web.impl.WebControllerManagerImpl.registerController(WebControllerManagerImpl.java:13)
at jetbrains.buildServer.web.impl.WebControllerManagerImpl$WebControllerPluginWrapper.registerController(WebControllerManagerImpl.java:41)
at jetbrains.buildServer.auth.oauth.LoginViaOAuthController.<init>(LoginViaOAuthController.java:24)
at jetbrains.buildServer.auth.oauth.PluginConfiguration.loginController(PluginConfiguration.java:36)
at jetbrains.buildServer.auth.oauth.PluginConfiguration$$EnhancerBySpringCGLIB$$6c895469.CGLIB$loginController$5(<generated>)
at jetbrains.buildServer.auth.oauth.PluginConfiguration$$EnhancerBySpringCGLIB$$6c895469$$FastClassBySpringCGLIB$$ecef6c0e.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358)
at jetbrains.buildServer.auth.oauth.PluginConfiguration$$EnhancerBySpringCGLIB$$6c895469.loginController(<generated>)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 29 more

It was working fine before. Even stranger, it is still working fine just now, despite throwing this error.