Why did you edit your post to remove the <context:component-scan/>
? That is required to find your @Component
.
I just tested and all worked fine for me...
@Component
@ManagedResource
public class Foo {
@ManagedAttribute
public int getIt() {
return 42;
}
}
and
<context:mbean-server/>
<context:component-scan base-package="foo" />
<context:mbean-export/>
I tried it with your style of MBean server and that worked too.