Bug 1193119

Summary: EJBs Can't Inherit a Java 8 Default Method
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Jan Martiska <jmartisk>
Component: EJBAssignee: David M. Lloyd <david.lloyd>
Status: CLOSED ERRATA QA Contact: Jan Martiska <jmartisk>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3.3CC: david.lloyd, emajorsi, fnasser, jawilson
Target Milestone: ---   
Target Release: One-off release   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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
Story Points: ---
Clone Of: 1193109 Environment:
Last Closed: 2015-03-10 18:15:33 UTC Type: Support Patch
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1193109    
Bug Blocks: 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:

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

and an implementation:

@Stateless
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.

https://rhn.redhat.com/errata/RHBA-2015-0673.html