【发布时间】:2013-09-18 21:45:38
【问题描述】:
我有一个可以通过 jconsole/Visual VM 访问的服务。
@ManagedResource
public class MyService
{
private String foo;
@ManagedAttribute
public void setFoo(String newVal) { this.foo = newVal; }
@ManagedAttribute
public String getFoo() { return this.foo; }
//some other things here that access foo
}
但看起来 web 应用程序控制器收到的 foo 的值并不总是与我在 jconsle 或可视 VM 中单击 getFoo() 时获得的值匹配。
此外,调试器显示我的控制器获得的值不是我在 jconsole 中看到的。
有什么想法吗?
【问题讨论】:
标签: java spring jmx managed-bean visualvm