dev@glassfish.java.net

Re: EJB annotation processing changes

From: Bill Shannon <bill.shannon_at_oracle.com>
Date: Sun, 12 Dec 2010 00:34:05 -0800

Annotations can appear on web classes and EJB classes, although since
they're all mixed together in WEB-INF/classes, it's hard to tell which
is which. Resources can be declared in web.xml and ejb-jar.xml.
Think about what needs to override what, how information appearing in
different locations needs to merge or override. Think about detecting
conflicts.

The simple cases worked, but lots of corner cases were broken. Even
with my fixes, there are still lots of cases that are broken, just because
the entire structure of our JNDI naming support isn't properly designed to
handle these cases. The original designer had (in my opinion) the wrong
mental model of resources in Java EE, and that's reflected in the classes,
making it very difficult to solve some of these problems.

I filed issues for several cases I ran into that are still not fixed.
For example:

http://java.net/jira/browse/GLASSFISH-15104
http://java.net/jira/browse/GLASSFISH-15102
http://java.net/jira/browse/GLASSFISH-15101

In addition to some of the structural issues I fixed, there were lots
of cases where code doing similar things in different places was different,
for no apparent reason. I suspect there are still lots of latent bugs.

This code is *so* complex that it took me weeks to figure out enough
to make these fixes, and that only with lots of help from Hong,
Shing Wai, and Mahesh.

The root cause of many of the bugs I fixed was that resource information
was being stored per-EJB, which is appropriate when the EJB is in the
EJB container, but is incorrect when the EJB is in the web container.
This fundamental difference between the web container and the EJB container
was not reflected in the code. That's what I changed.


Sahoo wrote on 12/10/2010 07:53 PM:
> Would you mind telling a bit more about the bugs?
>
> Thanks,
> Sahoo
> On Saturday 11 December 2010 05:58 AM, Bill Shannon wrote:
>> I'm about to commit some changes to EJB annotation processing to fix
>> a bunch of bugs related to support for EJBs in war files. The tests
>> pass quicklook, EJB devtests, and deployment devtests, but if you see
>> any problems that might be related to this, let me know.
>>
>> In particular, I'm worried about the behavior in the embedded case,
>> so if you see problems there please tell me what embedded devtests
>> I should be running.
>