Bug 1193109 - [QE] (6.4.0) EJBs can't inherit a JDK8 default method
Summary: [QE] (6.4.0) EJBs can't inherit a JDK8 default method
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: EJB
Version: 6.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ER3
: EAP 6.4.0
Assignee: David M. Lloyd
QA Contact: Jan Martiska
URL:
Whiteboard:
Depends On:
Blocks: java8 1193119
TreeView+ depends on / blocked
 
Reported: 2015-02-16 15:12 UTC by Jan Martiska
Modified: 2019-08-19 12:44 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1193119 (view as bug list)
Environment:
Last Closed: 2019-08-19 12:44:18 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1194060 0 unspecified CLOSED RHEL6 RPMs: Upgrade jandex-eap6 to 1.0.4.Final-redhat-1 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1194061 0 unspecified CLOSED RHEL5 RPMs: Upgrade jandex-eap6 to 1.0.4.Final-redhat-1 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1194062 0 unspecified CLOSED RHEL7 RPMs: Upgrade eap6-jandex to 1.0.4.Final-redhat-1 2021-02-22 00:41:40 UTC
Red Hat Issue Tracker WFLY-4354 0 Major Closed EJBs can't inherit a JDK8 default method 2017-12-07 22:08:26 UTC

Internal Links: 1194060 1194061 1194062

Description Jan Martiska 2015-02-16 15:12:55 UTC
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.

Comment 1 David M. Lloyd 2015-02-16 15:20:11 UTC
This is a real bug and definitely will require an upstream JIRA.

Comment 2 David M. Lloyd 2015-02-17 12:17:14 UTC
We have an upstream fix underway.

Comment 7 Jan Martiska 2015-02-26 13:31:51 UTC
Verified in EAP 6.4.0.ER3.


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