Bug 1114061 - (6.4.0) ejb-jar.xml interceptor-binding does not accept "*"
Summary: (6.4.0) ejb-jar.xml interceptor-binding does not accept "*"
Status: CLOSED NOTABUG
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: EE, EJB
Version: 6.2.4,6.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: EAP 6.4.0
Assignee: baranowb
QA Contact:
URL:
Whiteboard:
Keywords: Reopened
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-27 15:05 UTC by wfink
Modified: 2018-12-06 17:04 UTC (History)
9 users (show)

(edit)
In this release of JBoss EAP 6, due to too strict checks, default EJB interceptors require an 'interceptors' definition along with a declaration as part of 'assembly-descriptor'.
Clone Of:
(edit)
Last Closed: 2015-11-30 06:56:56 UTC


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker PRODMGT-1026 Major Open <ejb-name> tag in <interceptor-binding> should support regular expression usages. 2016-03-01 07:41 UTC
JBoss Issue Tracker WFLY-3554 Major Closed ejb-jar.xml interceptor-binding does not accept "*" 2016-03-01 07:41 UTC

Description wfink 2014-06-27 15:05:20 UTC
Description of problem:

From the ejb3.1 specification (JSR 318) chapter 12.7 Specification of Interceptors in the Deployment Descriptor:
""
In the interceptor-binding element, the target-name element must be the name of one of
the enterprise beans contained in the ejb-jar or the wildcard value “*”.
""

But the "*" as ejb-name is ignored, only a bean name will result in binding the interceptor during deployment.
Therefor it is not possible to apply an Interceptor to all beans in the application which is a lot of XML and error prone if the element must be repeated for each EJB



How reproducible:


Add a ejb-jar.xml to a simple ejb3 application with the following content:
<ejb-jar>
<assembly-descriptor>
<interceptor-binding>
<ejb-name>*</ejb-name>
<interceptor-class>wfink.Dummy</interceptor-class>
</interceptor-binding>
</assembly-descriptor>
</ejb-jar>

The Interceptor must not exist, it will cause a ClassNotFoundEx if "*" is replaced by a valid bean name


Actual results:
No error or invocation of the interceptor

Expected results:
The interceptor should be invoked for all EJB's in this application

Comment 2 JBoss JIRA Server 2014-07-31 09:35:19 UTC
Bartosz Baranowski <bbaranow@redhat.com> updated the status of jira WFLY-3554 to Coding In Progress

Comment 3 Stuart Douglas 2014-08-07 01:53:57 UTC
This behaviour is correct as per spec, from the interceptors 1.1 spec:

• The interceptor-class element specifies the interceptor class. The interceptor class contained
in an interceptor-class element must either be declared in the interceptor deployment
descriptor element or appear in at lesat one @Interceptor annotation on a target class. The
interceptor-order element is used as an optional alternative to specify a total ordering over the
interceptors defined for the given level and above.

Comment 5 Jan Martiska 2015-01-26 08:21:56 UTC
This seems to have been rejected. Closing.

Comment 6 wfink 2015-01-26 08:49:37 UTC
As WFLY-3554 state it has been changed in EJB3.2 specification and
EAP6 does not implement EJB3.2, it's EE6 and implement EJB3.1 spec.

Because of this it is necessary to have a fix in EAP6 for this issue.

Comment 8 Stuart Douglas 2015-01-26 08:58:19 UTC
You have mis-interpreted my comments on WFLY-3554, this violates both the 3.1 and 3.2 spec.

The sentence I am quoting is in the EJB 3.1 spec and the Interceptors 1.1 spec (which applies to EJB 3.2). The only change between 3.1 and 3.2 was that the place where this is specified changed.

Comment 11 wfink 2015-07-24 11:38:06 UTC
To Stuart ...
sorry, my understanding is different.

I configure it as followed in ejb-jar.xml to a simple ejb3 application with the following content:
<ejb-jar>
<assembly-descriptor>
<interceptor-binding>
<ejb-name>*</ejb-name>
<interceptor-class>wfink.Dummy</interceptor-class>
</interceptor-binding>
</assembly-descriptor>
</ejb-jar>

The Interceptors 1.1 spec state this a bullet before your excerpt.

The target-name element must identify the associated target class or the wildcard value "*" (which
is used to define interceptors that are bound to all target classes).

Also ejb_3.1 ch# 12.7 contains the same statement.

So from my point of view we should reopen https://issues.jboss.org/browse/WFLY-3554 and merge the PR

Comment 12 baranowb 2015-11-24 10:49:53 UTC
Bump? specs are kind of badly written it seems, ambiguous at best.
What is 'interceptor deployment descriptor'. Is binding equivalent to 'interceptor deployment descriptor' ? All I could find for WFLY is: https://docs.jboss.org/author/display/WFLY8/Container+interceptors

Which seems to ack this BZ as bug - not first entry.

Comment 13 Stuart Douglas 2015-11-25 01:51:59 UTC
The current behavior is spec compliant.
 
"The interceptor class contained in an interceptor-class element must either be declared in the interceptor deployment descriptor element or appear in at lesat  one @Interceptor annotation on a target class."

The spec does not say what should happen when this is not the case, but we ignore it rather than causing a deployment failure. It would make sense to print a warning I guess, but the language of the spec is pretty explicit here.


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