[
https://issues.jboss.org/browse/WFLY-2800?page=com.atlassian.jira.plugin....
]
David Lloyd updated WFLY-2800:
------------------------------
Steps to Reproduce:
Deploy a session bean that requires a transaction and have it throw a
org.jboss.util.deadlock.ApplicationDeadlockException.
or
Add the following test case to org.jboss.invocation.test.ChainedInterceptorTestCase and
run mvn test on the jboss-invocation subproject.
{code}
/**
* What if again re-invokes a chained interceptor?
*/
@Test
public void testAgainWithChain() throws Exception {
Method method = ChainedInterceptorTestCase.class.getMethod("echo",
String.class);
InterceptorContext context = new InterceptorContext();
context.setMethod(method);
context.setTarget(this);
context.setParameters(new Object[] { "testAgain" });
Interceptor again = new Interceptor() {
private int num = 2;
@Override
public Object processInvocation(InterceptorContext context) throws Exception
{
StringBuilder result = new StringBuilder();
while ((num--) > 0)
result.append(context.proceed());
return result;
}
};
Interceptor interceptor1 =
Interceptors.getChainedInterceptor(createMyInterceptor("1"),
createMyInterceptor("2"), Interceptors.getInvokingInterceptor());
Interceptor interceptor2 =
Interceptors.getChainedInterceptor(createMyInterceptor("3"),
createMyInterceptor("4"), again, interceptor1);
String result = (String) interceptor2.processInvocation(context);
String expected = "3#4#1#2#Echo testAgain1#2#Echo testAgain";
assertEquals(expected, result);
}
}
{code}
was:
Deploy a session bean that requires a transaction and have it throw a
org.jboss.util.deadlock.ApplicationDeadlockException.
or
Add the following test case to org.jboss.invocation.test.ChainedInterceptorTestCase and
run mvn test on the jboss-invocation subproject.
/**
* What if again re-invokes a chained interceptor?
*/
@Test
public void testAgainWithChain() throws Exception {
Method method = ChainedInterceptorTestCase.class.getMethod("echo",
String.class);
InterceptorContext context = new InterceptorContext();
context.setMethod(method);
context.setTarget(this);
context.setParameters(new Object[] { "testAgain" });
Interceptor again = new Interceptor() {
private int num = 2;
@Override
public Object processInvocation(InterceptorContext context) throws Exception
{
StringBuilder result = new StringBuilder();
while ((num--) > 0)
result.append(context.proceed());
return result;
}
};
Interceptor interceptor1 =
Interceptors.getChainedInterceptor(createMyInterceptor("1"),
createMyInterceptor("2"), Interceptors.getInvokingInterceptor());
Interceptor interceptor2 =
Interceptors.getChainedInterceptor(createMyInterceptor("3"),
createMyInterceptor("4"), again, interceptor1);
String result = (String) interceptor2.processInvocation(context);
String expected = "3#4#1#2#Echo testAgain1#2#Echo testAgain";
assertEquals(expected, result);
}
}
Re-invoking InterceptorContext.proceed() throws
CannotProceedException
----------------------------------------------------------------------
Key: WFLY-2800
URL:
https://issues.jboss.org/browse/WFLY-2800
Project: WildFly
Issue Type: Bug
Security Level: Public(Everyone can see)
Reporter: Eric van der Maarel
When you invoke and re-invoke org.jboss.invocation.InterceptorContext.proceed() from an
interceptor in a chain of interceptors and the interceptor to be (re-)invoked is a
org.jboss.invocation.ChainedInterceptor or WeavedInterceptor, a CannotProceedException is
thrown.
This bug has been described and analysed in the context of the ejb3 container, on the
forum at
https://community.jboss.org/message/853547.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira