我们进行了几次融合测试,但最近在@ManagedResource正在遇到一个问题:
Unable to register MBean [com.api.configuration.ApiConfiguration@63fde7ca] with key apiConfiguration ; nested exception is javax.management.InstanceAlreadyExistsException: api:name=ApiConfiguration
犯罪主人也喜欢:
@Component
@ManagedResource(objectName = "api:name=ApiConfiguration")
public class ApiConfiguration {
@ManagedOperation
public void reloadConfiguration() {
// do something
}
}
We have tried adding a @DirtiesContext
on every integration test without success.
The error only appears when running all tests from Maven or IntelliJ. If we run only one of the failing tests it works.