Bug 1193119 - EJBs Can't Inherit a Java 8 Default Method
Summary: EJBs Can't Inherit a Java 8 Default Method
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: EJB
Version: 6.3.3
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: One-off release
Assignee: David M. Lloyd
QA Contact: Jan Martiska
Depends On: 1193109
Blocks: 1195283
TreeView+ depends on / blocked
Reported: 2015-02-16 15:34 UTC by Jan Martiska
Modified: 2015-03-10 18:15 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
EJBs can not inherit a Java 8 default method [1]. Use of an interface with a default method in combination with EJBs will result in a CannotProceed exception at runtime. With this fix, Java 8 default methods can safely be used in the interfaces that EJB implementations will utilize. [1] http://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html
Clone Of: 1193109
Last Closed: 2015-03-10 18:15:33 UTC
Type: Support Patch

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1195283 1 None None None 2021-01-20 06:05:38 UTC
Red Hat Issue Tracker WFLY-4354 0 Major Closed EJBs can't inherit a JDK8 default method 2019-03-27 12:25:54 UTC
Red Hat Product Errata RHBA-2015:0673 0 normal SHIPPED_LIVE Red Hat JBoss Enterprise Application Platform 6.3.3 bug fix update 2015-03-10 22:14:55 UTC

Internal Links: 1195283

Description Jan Martiska 2015-02-16 15:34:43 UTC
+++ This bug was initially created as a clone of Bug #1193109 +++

Have Local interface:

public interface DogeEJBLocal {
    default public String sayWow() {
        return "wow";

and an implementation:

public class DogeEJBImpl implements DogeEJBLocal {


get an instance of the bean through the local interface and try to call sayWow. It will fail with:
org.jboss.invocation.CannotProceedException: INV000002: Invocation cannot proceed (end of interceptor chain has been hit)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:293)
	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
	at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)
	at com.redhat.qe.jdkspecifics.jdk8.defaultmethods.direct.DogeEJBLocal$$$view2.sayWow(Unknown Source)
	at com.redhat.qe.jdkspecifics.jdk8.defaultmethods.DefaultMethodTest.testEJB(DefaultMethodTest.java:52)

It doesn't work either if the EJB inherits the method through an intermediary interface which is not marked as an EJB interface.
This is quite obviously not discussed in the 3.1 spec, but if it does work when inheriting from superclasses, I think it should work with interfaces as well.
Also, I tried this on GlassFish and it works there.

--- Additional comment from David M. Lloyd on 2015-02-16 10:20:11 EST ---

This is a real bug and definitely will require an upstream JIRA.

Comment 7 Jan Martiska 2015-03-06 09:11:55 UTC
This is fixed via individual patch in BZ 1195283. For details see that bugzilla.

Comment 9 errata-xmlrpc 2015-03-10 18:15:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.