tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Panzer (JIRA)" <>
Subject [jira] [Created] (OPENEJB-2115) Asynchronous EJB method invocation fails with Asynchronous.QueueType=PRIORITY
Date Mon, 25 May 2015 15:50:17 GMT
Robert Panzer created OPENEJB-2115:

             Summary: Asynchronous EJB method invocation fails with Asynchronous.QueueType=PRIORITY
                 Key: OPENEJB-2115
             Project: OpenEJB
          Issue Type: Bug
          Components: ejb31
    Affects Versions: 4.7.2
         Environment: TomEE 1.7.2
            Reporter: Robert Panzer
            Priority: Minor

When setting the option {{Asynchronous.QueueType=PRIORITY}} TomEE will set a {{java.util.concurrent.PriorityQueue}}
as work queue on the ThreadPoolExecutor.
A PriorityQueue expects that objects added to it are {{java.lang.Comparable}}.
As {{ThreadPoolExecutor}} adds a {{java.util.concurrent.RunnableFuture}} that wraps the {{Callable}}
created by TomEE the invocation fails with a ClassCastException:

java.lang.ClassCastException: java.util.concurrent.FutureTask cannot be cast to java.lang.Comparable
	at java.util.concurrent.PriorityBlockingQueue.siftUpComparable(
	at java.util.concurrent.PriorityBlockingQueue.offer(
	at java.util.concurrent.ThreadPoolExecutor.execute(
	at java.util.concurrent.AbstractExecutorService.submit(
	at org.apache.openejb.async.AsynchronousPool.invoke(
	at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(
	at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(
	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(

Therefore I think that offering the option {{AsynchronousPool.QueueType=PRIORITY}} does not
make any sense at all and could be completely removed.

This message was sent by Atlassian JIRA

View raw message