TeamcityDockerCloudPlugin icon indicating copy to clipboard operation
TeamcityDockerCloudPlugin copied to clipboard

Spring complains about non-public constructors being used

Open Vampire opened this issue 7 years ago • 1 comments

On TeamCity server startup the following is logged:

[2018-10-30 15:42:56,282]   WARN - .InstantiationStrategySelector - Spring selected non-public constructor to create instance: run.var.teamcity.cloud.docker.web.DefaultContainerTestManager(jetbrains.buildServer.serverSide.SBuildServer,jetbrains.buildServer.serverSide.WebLinks)
[2018-10-30 15:42:56,291]   WARN - .InstantiationStrategySelector - Spring selected non-public class to create instance: class run.var.teamcity.cloud.docker.web.DefaultContainerTestManager
[2018-10-30 15:42:56,358]   WARN - .InstantiationStrategySelector - Spring selected non-public constructor to create instance: run.var.teamcity.cloud.docker.web.ContainerTestController(jetbrains.buildServer.serverSide.SBuildServer,jetbrains.buildServer.web.openapi.PluginDescriptor,jetbrains.buildServer.web.openapi.WebControllerManager,run.var.teamcity.cloud.docker.web.ContainerTestManager)

Actually I wonder whether these classes should be shipped at all, as their name contains "test".

Vampire avatar Nov 02 '18 20:11 Vampire

Hi @Vampire, those warnings can be safely ignored. For some beans, the package-private constructors are indeed expected to be used by Spring to perform auto-wiring, while public constructors are used to initialize dependencies externally (eg. for testing). The spring framework is unsure if this is really wanted, and prints a warning accordingly. Although harmless, those warnings may certainly be disconcerting, so I'll keep that in the backlog.

The classes you mentioned contain "test" in their name, because they are related to the container testing facility, which is a productive feature, so nothing wrong here :-)

JeanRev avatar Nov 03 '18 06:11 JeanRev