The problem is relatively simple:
I have a web based application, that, among other things, needs to check for status of a remote service. This remote service has JMX based mbeans exposed. However, the remote service might be not running all the time. What I need is:
- Setup Spring to connect to remote JMX server
- When the remote is not running, present this information in the web ui
The problem with this is that if I setup the JMX cli开发者_JAVA技巧ent bean in springContext.xml and the service is not running, the webapp won't even start with exceptions like ConnectionRefused and so on.
So the question is: is there a way I can tell spring to ignore the fact that it cannot connect to remote mbean server and try it later?
I am assuming you are using the MBeanServerConnectionFactoryBean
? Set the connectOnStartup
property to false
.
精彩评论