DBScheduleProvider - stopProviding() error?
tms Sep 19, 2007 10:14 AMHi, I just found some strange behavior of the method stopProviding() on DBScheduleProvider. If I call this piece of code
ObjectName mbean = new ObjectName("jboss:service=PortalDBScheduleProvider"); MBeanServer server = MBeanServerLocator.locateJBoss(); server.invoke(mbean, "stopProviding", new Object[0], new String[0]); server.invoke(mbean, "startProviding", new Object[0], new String[0]);
it works without problems for the first time, but if it's called more times, then it throws following exceptions
2007-09-19 16:02:48,500 ERROR [search.IndexServlet] Timer configuration from web administration failed.:class javax.management.RuntimeMBeanException:null 2007-09-19 16:02:48,515 ERROR [STDERR] javax.management.RuntimeMBeanException 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.handleInvocationExceptions(ReflectedDispatcher.java:176) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:163) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 2007-09-19 16:02:48,515 ERROR [STDERR] at search.IndexServlet.doGet(IndexServlet.java:79) 2007-09-19 16:02:48,515 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:697) 2007-09-19 16:02:48,515 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) 2007-09-19 16:02:48,515 ERROR [STDERR] at com.tecsidel.portal.system.web.filters.ConfigFilter.doFilter(ConfigFilter.java:25) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) 2007-09-19 16:02:48,515 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595) 2007-09-19 16:02:48,515 ERROR [STDERR] Caused by: javax.management.RuntimeMBeanException 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.handleInvocationExceptions(ReflectedDispatcher.java:176) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:163) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.varia.scheduler.AbstractScheduleProvider.removeSchedule(AbstractScheduleProvider.java:163) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.varia.scheduler.DBScheduleProvider.stopProviding(DBScheduleProvider.java:207) 2007-09-19 16:02:48,515 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2007-09-19 16:02:48,515 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 2007-09-19 16:02:48,515 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 2007-09-19 16:02:48,515 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 2007-09-19 16:02:48,515 ERROR [STDERR] ... 30 more 2007-09-19 16:02:48,515 ERROR [STDERR] Caused by: java.lang.NullPointerException 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.varia.scheduler.ScheduleManager.removeSchedule(ScheduleManager.java:332) 2007-09-19 16:02:48,515 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2007-09-19 16:02:48,515 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 2007-09-19 16:02:48,515 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 2007-09-19 16:02:48,515 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585) 2007-09-19 16:02:48,515 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 2007-09-19 16:02:48,515 ERROR [STDERR] ... 41 more
When I looked on the source code of the stopProviding() method, I found that the schedulers are removed from the ScheduleManager through the removeSchedule() method, but they still stays in the list of schedulers inside of the DBScheduleProvider. So if this method is than called again, it tries to remove them again. And this ends with the NullPointerException shown above.
Whats wrong? The way I am using these methods or their behavior?
Thanks