[jboss-jira] [JBoss JIRA] (AS7-2513) Infinispan Subsystem cannot use ScheduledExecutor from Threads subsystem
Martin Gencur (Created) (JIRA)
jira-events at lists.jboss.org
Fri Nov 4 09:18:45 EDT 2011
Infinispan Subsystem cannot use ScheduledExecutor from Threads subsystem
------------------------------------------------------------------------
Key: AS7-2513
URL: https://issues.jboss.org/browse/AS7-2513
Project: Application Server 7
Issue Type: Bug
Components: Clustering
Reporter: Martin Gencur
Assignee: Paul Ferraro
Affects JBossAS 7.1.0.Alpha2-SNAPSHOT (with HEAD == 5058aab).
Currently it is not possible to specify e.g. eviction-executor attribute on <cache-container> element since it needs a scheduled executor to be defined in Threads susbystem like this
<scheduled-thread-pool name="infinispan-eviction">
<max-threads count="1" per-cpu="0"/>
<thread-factory name="infinispan-factory"/>
</scheduled-thread-pool>
When I define this and start EDG (based on the JBossAS above), I get the following error:
{code}
12:46:05,265 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.infinispan.default: org.jboss.msc.service.StartException in service jboss.infinispan.default: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1780) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_21]
at java.lang.Thread.run(Thread.java:619) [:1.6.0_21]
Caused by: org.jboss.msc.inject.InjectionException: Injecting the wrong type (expected interface java.util.concurrent.ScheduledExecutorService, got class org.jboss.as.threads.ManagedScheduledExecutorService)
at org.jboss.msc.inject.CastingInjector.inject(CastingInjector.java:53) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl.doInject(ServiceControllerImpl.java:1562) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl.access$1900(ServiceControllerImpl.java:49) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.performInjections(ServiceControllerImpl.java:1793) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1754) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
... 3 more
Caused by: java.lang.ClassCastException
at java.lang.Class.cast(Class.java:2990) [:1.6.0_21]
at org.jboss.msc.inject.CastingInjector.inject(CastingInjector.java:51) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
... 7 more
12:46:05,779 INFO [org.jboss.as.controller] (Controller Boot Thread) Service status report
Services which failed to start:
service jboss.infinispan.default: org.jboss.msc.service.StartException in service jboss.infinispan.default: Failed to start service
{code}
The problem is that CacheContainerAdd.java is trying to add a Scheduled Executor dependency which is supposed to be of type ScheduledExecutorService.class. However, the Threads subsystem has recently changed and it creates a service builder of type ServiceBuilder<ManagedScheduledExecutorService> (see jboss-as/threads/src/main/java/org/jboss/as/threads/ScheduledThreadPoolAdd.java)
So I think it might be enough just to change the CacheContainerAdd.java to ask for ManagerScheduledExecutorService.class.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list