You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Michael Vorburger (JIRA)" <ji...@apache.org> on 2008/05/14 11:51:55 UTC

[jira] Created: (OPENJPA-602) NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map

NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map
-----------------------------------------------------------------------------------------------------

                 Key: OPENJPA-602
                 URL: https://issues.apache.org/jira/browse/OPENJPA-602
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc
    Affects Versions: 1.1.0
            Reporter: Michael Vorburger
            Priority: Minor


The example I'll attach crashes with an NPE when running the mappingtool.

Caused by: java.lang.NullPointerException
	at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map(RelationToManyInverseKeyFieldStrategy.java:136)
	at org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy.map(RelationCollectionInverseKeyFieldStrategy.java:95)
	at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:120)
	at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)
	at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:438)
	at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:403)
	at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:812)

The goal of this JIRA is not (neccessarily) to support the kind of mapping that would be required for this (which may be hard), but to at least print a clear error and not an NPE...


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-602) NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map

Posted by "Michael Vorburger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597408#action_12597408 ] 

Michael Vorburger commented on OPENJPA-602:
-------------------------------------------

-----Original Message-----
From: Fay Wang [mailto:fyw300@yahoo.com] 
Sent: jeudi, 15. mai 2008 00:52
To: users@openjpa.apache.org; dev@openjpa.apache.org
Subject: RE: NPE at RelationToManyInverseKeyFieldStrategy when using mappedBy inverse

Here is my finding: The NPE problem is the combination of (1) abstract class, (2) inheritance strategy of TABLE_PER_CLASS, and (3) toMany relationship. When you have (1) and (2), or (1) and (3), or (2) and (3), you will be fine.  However, when the three things are put together, the class strategy of this entity class becomes NoneClassStrategy (since abstract class with inheritance strategy of TABLE_PER_CLASS will not have a corresponding database table). With NoneClassStrategy, the foreign key required for the toMany relationship will not be constructed, resulting in NPE. I am not clear whether JPA spec ever mentioned that no relation fields in the abstract class when inheritance strategy is table per concrete class. If not, this seems to be a bug in OpenJPA.

@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public abstract class EntityA { 

    @Id
    @GeneratedValue
    private Long id;
    
    @Version
    private Long version;

    @OneToMany(cascade=CascadeType.PERSIST,
          mappedBy="entityA")
    private java.util.Set<EntityB> entityBs;

    public java.util.Set<EntiytB> getEntityBs() {
          return entityBs;
    }

    public void setEntityBs(java.util.Set<EntityB> entityBs) {
	  this.entityBs = entityBs;
    }  
  }
}

If you only have (1) and (2), you will be fine because 


-----Original Message-----
From: Fay Wang [mailto:fyw300@yahoo.com] 
Sent: mercredi, 14. mai 2008 18:45
To: users@openjpa.apache.org; dev@openjpa.apache.org
Subject: RE: NPE at RelationToManyInverseKeyFieldStrategy when using mappedBy inverse

I take it back. I found that when I put the fields and methods in EntityBase class directly in the Translatable class instead of having Translatable inherit from EntityBase class, I still get NPE. This problem seems having nothing to do with MappedSuperclass annotation.

-Fay

-----Original Message-----
From: Fay Wang [mailto:fyw300@yahoo.com] 
Sent: mercredi, 14. mai 2008 18:23
To: users@openjpa.apache.org; dev@openjpa.apache.org
Subject: RE: NPE at RelationToManyInverseKeyFieldStrategy when using mappedBy inverse

Hi Mike,
    Your super class EntityBase is annotated as @MappedSuperclass. Your Translatable class which inherits from EntityBase has inheritance strategy of TABLE_PER_CLASS. Since MappedSuperclass itself is not a persistence class and can not act in the capacity of an entity, it does not have a corresponding table in the database. I think this is why openjpa got confused and could not find foreign key between the parent class and the child class. When I removed Inheritance strategy annotation from Translatable class, your test case went through. Having said that, I think the NPE should be fixed and proper error message should be thrown.

-Fay

> NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map
> -----------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-602
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-602
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.1.0
>            Reporter: Michael Vorburger
>            Priority: Minor
>         Attachments: FullStackTrace-OPENJPA-602.txt, OneToMany-test.zip
>
>
> The example I'll attach crashes with an NPE when running the mappingtool.
> Caused by: java.lang.NullPointerException
> 	at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map(RelationToManyInverseKeyFieldStrategy.java:136)
> 	at org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy.map(RelationCollectionInverseKeyFieldStrategy.java:95)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:120)
> 	at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:438)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:403)
> 	at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:812)
> The goal of this JIRA is not (neccessarily) to support the kind of mapping that would be required for this (which may be hard), but to at least print a clear error and not an NPE...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-602) NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map

Posted by "Michael Vorburger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Vorburger updated OPENJPA-602:
--------------------------------------

    Attachment: FullStackTrace-OPENJPA-602.txt

> NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map
> -----------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-602
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-602
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.1.0
>            Reporter: Michael Vorburger
>            Priority: Minor
>         Attachments: FullStackTrace-OPENJPA-602.txt, OneToMany-test.zip
>
>
> The example I'll attach crashes with an NPE when running the mappingtool.
> Caused by: java.lang.NullPointerException
> 	at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map(RelationToManyInverseKeyFieldStrategy.java:136)
> 	at org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy.map(RelationCollectionInverseKeyFieldStrategy.java:95)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:120)
> 	at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:438)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:403)
> 	at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:812)
> The goal of this JIRA is not (neccessarily) to support the kind of mapping that would be required for this (which may be hard), but to at least print a clear error and not an NPE...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-602) NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map

Posted by "Tim Kaltenbrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602263#action_12602263 ] 

Tim Kaltenbrunner commented on OPENJPA-602:
-------------------------------------------

Hi,

I have the same problem at my current project. I have an existing database structure created with Kodo JDO. Now I want to use OpenJPA but keep the old database structure. Will someone fix this problem or will you only throw an exception. I am also not sure if the specification specifies that this case should be possible but JDO implementation do support it and therefore it would be nice to have it in OpenJPA . 

Cheers Tim


> NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map
> -----------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-602
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-602
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.1.0
>            Reporter: Michael Vorburger
>            Priority: Minor
>         Attachments: FullStackTrace-OPENJPA-602.txt, OneToMany-test.zip
>
>
> The example I'll attach crashes with an NPE when running the mappingtool.
> Caused by: java.lang.NullPointerException
> 	at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map(RelationToManyInverseKeyFieldStrategy.java:136)
> 	at org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy.map(RelationCollectionInverseKeyFieldStrategy.java:95)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:120)
> 	at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:438)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:403)
> 	at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:812)
> The goal of this JIRA is not (neccessarily) to support the kind of mapping that would be required for this (which may be hard), but to at least print a clear error and not an NPE...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-602) NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map

Posted by "Michael Vorburger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12596698#action_12596698 ] 

Michael Vorburger commented on OPENJPA-602:
-------------------------------------------

-----Original Message-----
From: Michael Vorburger [mailto:mvorburger@odyssey-group.com] 
Sent: mercredi, 30. avril 2008 17:07
To: users@openjpa.apache.org; dev@openjpa.apache.org
Subject: NPE at RelationToManyInverseKeyFieldStrategy when using mappedBy inverse

Hello,
 
I'm running into an NPE in RelationToManyInverseKeyFieldStrategy
(copy/pasted below) when using an OneToMany inverse relation with mappedBy and InheritanceType.TABLE_PER_CLASS in 1.1.0-SNAPSHOT...

Test summary: A common abstract superclass Translatable which has a @OneToManySet<Translation>, and many subclasses of that like e.g. a SomethingTranslatable, and many more.  The idea is that mapping should lead to a Translation table holding the items for SomethingTranslatable and all other superclasses.  Then SomethingTranslatable and many other tables (no physical Translatable table).  There shouldn't be a join table for each SomethingTranslatable, as it's a OneToManySet, it doesn't make sense, so the owning side is a @ManyToOne in Translation back to Translatable.  Granted a physical FK will not be possible in such a schema - accepted, but it should still be possible to map this?  It works until I use @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) on Translatable, with it - boum, NPE.

> NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map
> -----------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-602
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-602
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.1.0
>            Reporter: Michael Vorburger
>            Priority: Minor
>         Attachments: FullStackTrace-OPENJPA-602.txt, OneToMany-test.zip
>
>
> The example I'll attach crashes with an NPE when running the mappingtool.
> Caused by: java.lang.NullPointerException
> 	at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map(RelationToManyInverseKeyFieldStrategy.java:136)
> 	at org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy.map(RelationCollectionInverseKeyFieldStrategy.java:95)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:120)
> 	at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:438)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:403)
> 	at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:812)
> The goal of this JIRA is not (neccessarily) to support the kind of mapping that would be required for this (which may be hard), but to at least print a clear error and not an NPE...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-602) NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map

Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12604032#action_12604032 ] 

Pinaki Poddar commented on OPENJPA-602:
---------------------------------------

SVN Revision 666314 [1]  addresses this issue. Used a modified version the attached patch as the domain model in a test case. 
It will be helpful if the reporter can verify 
        a) whether the newly added test case reflects the intended domain model 
and b) whether the change resolves the original issue.

Known limitation:
  As the root of persistent hierarchy is abstract and table-per-class strategy is being used, 
 aggregate JPQL query e.g. "SELECT COUNT(p) FROM Translatable p" will not be possible 
 because the concrete subclasses such as SomethingTranslatable or SomeOtherTranslatable are unjoined.


[1] http://svn.apache.org/viewvc?view=rev&revision=666314

> NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map
> -----------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-602
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-602
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.1.0
>            Reporter: Michael Vorburger
>            Priority: Minor
>         Attachments: FullStackTrace-OPENJPA-602.txt, OneToMany-test.zip
>
>
> The example I'll attach crashes with an NPE when running the mappingtool.
> Caused by: java.lang.NullPointerException
> 	at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map(RelationToManyInverseKeyFieldStrategy.java:136)
> 	at org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy.map(RelationCollectionInverseKeyFieldStrategy.java:95)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:120)
> 	at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:438)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:403)
> 	at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:812)
> The goal of this JIRA is not (neccessarily) to support the kind of mapping that would be required for this (which may be hard), but to at least print a clear error and not an NPE...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (OPENJPA-602) NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map

Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pinaki Poddar reassigned OPENJPA-602:
-------------------------------------

    Assignee: Pinaki Poddar

> NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map
> -----------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-602
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-602
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.1.0
>            Reporter: Michael Vorburger
>            Assignee: Pinaki Poddar
>            Priority: Minor
>         Attachments: FullStackTrace-OPENJPA-602.txt, OneToMany-test.zip
>
>
> The example I'll attach crashes with an NPE when running the mappingtool.
> Caused by: java.lang.NullPointerException
> 	at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map(RelationToManyInverseKeyFieldStrategy.java:136)
> 	at org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy.map(RelationCollectionInverseKeyFieldStrategy.java:95)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:120)
> 	at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:438)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:403)
> 	at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:812)
> The goal of this JIRA is not (neccessarily) to support the kind of mapping that would be required for this (which may be hard), but to at least print a clear error and not an NPE...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-602) NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map

Posted by "Michael Vorburger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Vorburger updated OPENJPA-602:
--------------------------------------

    Attachment: OneToMany-test.zip

> NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map
> -----------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-602
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-602
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.1.0
>            Reporter: Michael Vorburger
>            Priority: Minor
>         Attachments: FullStackTrace-OPENJPA-602.txt, OneToMany-test.zip
>
>
> The example I'll attach crashes with an NPE when running the mappingtool.
> Caused by: java.lang.NullPointerException
> 	at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map(RelationToManyInverseKeyFieldStrategy.java:136)
> 	at org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy.map(RelationCollectionInverseKeyFieldStrategy.java:95)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:120)
> 	at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:438)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:403)
> 	at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:812)
> The goal of this JIRA is not (neccessarily) to support the kind of mapping that would be required for this (which may be hard), but to at least print a clear error and not an NPE...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-602) NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map

Posted by "Michael Dick (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dick updated OPENJPA-602:
---------------------------------

    Fix Version/s: 1.2.0

> NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map
> -----------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-602
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-602
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.1.0
>            Reporter: Michael Vorburger
>            Assignee: Pinaki Poddar
>            Priority: Minor
>             Fix For: 1.2.0
>
>         Attachments: FullStackTrace-OPENJPA-602.txt, OneToMany-test.zip
>
>
> The example I'll attach crashes with an NPE when running the mappingtool.
> Caused by: java.lang.NullPointerException
> 	at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map(RelationToManyInverseKeyFieldStrategy.java:136)
> 	at org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy.map(RelationCollectionInverseKeyFieldStrategy.java:95)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:120)
> 	at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:438)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:403)
> 	at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:812)
> The goal of this JIRA is not (neccessarily) to support the kind of mapping that would be required for this (which may be hard), but to at least print a clear error and not an NPE...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OPENJPA-602) NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map

Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pinaki Poddar resolved OPENJPA-602.
-----------------------------------

    Resolution: Fixed

SVN revision 666314.


> NullPointerException at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map
> -----------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-602
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-602
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.1.0
>            Reporter: Michael Vorburger
>            Assignee: Pinaki Poddar
>            Priority: Minor
>         Attachments: FullStackTrace-OPENJPA-602.txt, OneToMany-test.zip
>
>
> The example I'll attach crashes with an NPE when running the mappingtool.
> Caused by: java.lang.NullPointerException
> 	at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map(RelationToManyInverseKeyFieldStrategy.java:136)
> 	at org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy.map(RelationCollectionInverseKeyFieldStrategy.java:95)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:120)
> 	at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:438)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:403)
> 	at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:812)
> The goal of this JIRA is not (neccessarily) to support the kind of mapping that would be required for this (which may be hard), but to at least print a clear error and not an NPE...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.