[
https://issues.apache.org/jira/browse/OPENEJB-2042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13793997#comment-13793997
]
Patrick Pfeifer commented on OPENEJB-2042:
------------------------------------------
Hi Andy
Thank you very much for responding on the issue so quickly.
As said, I discovered the bug by studying the code. I haven't got a test
case. The other NPE I experienced actually happened on a different line
- so I can't test this.
Talking about that "other NPE": It surfaced when I tried to use
One-to-One EJB 2.1 relations (CMR). Weblogic somehow understands the
"ejbgen" generated deployment descriptors and correctly puts the cmr
field AND the foreign key attribute on the source Entity (and TABLE).
But when I try to translate that (weblogic-...cmr...-jar.xml, defining
cmr-field names etc.) descriptor to an openejb-jar.xml, openejb
currently chokes on it (NPE). It would probably need a
<foreign-key-on-source/> annotation or the like. Although by studying
the code I doubt that this would cut it because the NPE happens just
around 10 lines *above* the "isPrimaryKeyOnSource()" if-condition. One
day I will really try to make a small test and shed more light on it.
Maybe there already a test in the source tree that I could build on as
well. (?) It might be just me doing a bad xml translation (using python,
lxml.de :-)). ... It's just that I currently need to focus on other things.
Best Regards
Patrick
BTW: What are all those "final" keywords good for? As I read on
stackoverflow, they prevent reassignment to the iteration variable which
sounds ok for loops with 10+ lines, but for single-statement loops I
feel they just add unnecessary noise. :-)
> Possible null pointer dereference in OpenEjb2Conversion
> -------------------------------------------------------
>
> Key: OPENEJB-2042
> URL: https://issues.apache.org/jira/browse/OPENEJB-2042
> Project: OpenEJB
> Issue Type: Bug
> Affects Versions: (trunk/tomee)
> Reporter: Patrick Pfeifer
> Assignee: Andy Gumbrecht
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> I experienced an NPE on a different line in the same source file while trying
> to get EJB 2.1 One-to-One Relations with <foreign-key-column-on-source> to
> work for a customer project.
> I have not achieved this yet and haven't got a small test case either.
> What I can already say for sure however, after studying the code, is that
> there is a bug on line 440/441 of
> tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OpenEjb2Conversion.java@1529473
> ---
> if (left == null) {
> RelationField right = left.getRelatedField();
> ---
--
This message was sent by Atlassian JIRA
(v6.1#6144)