Radoslav Husar created ARQ-2166:
-----------------------------------
Summary: IllegalArgumentException when accessing @Inject-ed instances from a
different thread
Key: ARQ-2166
URL:
https://issues.jboss.org/browse/ARQ-2166
Project: Arquillian
Issue Type: Task
Components: Base Implementation
Affects Versions: 1.1.15.Final
Reporter: Radoslav Husar
The use case for using multiple threads is to for instance start containers or deployments
concurrently, which could be employed to speed up a testsuites using multiple containers.
This is because ARQ is using ThreadLocal for storing the context. An example call stack
would be the following:
{noformat}
org.jboss.arquillian.core.spi.context.AbstractContext#activeStore
org.jboss.arquillian.core.impl.ManagerImpl#resolveActiveContexts
org.jboss.arquillian.core.impl.ManagerImpl#resolve
org.jboss.arquillian.core.impl.InstanceImpl#get
org.jboss.arquillian.container.test.impl.client.container.ClientContainerController#start(java.lang.String)
{noformat}
and example stack trace, trying to use container controller would be:
{noformat}
java.lang.IllegalArgumentException: No container registry in context
at
org.jboss.arquillian.container.test.impl.client.container.ClientContainerController.isStarted(ClientContainerController.java:216)
at org.jboss.as.test.clustering.NodeUtil.start(NodeUtil.java:104)
at org.jboss.as.test.clustering.NodeUtil.lambda$start$1(NodeUtil.java:85)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
{noformat}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)