[jira] Commented: (JDO-517) NPE on enhancement of classes with
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache JDO Project > [jira] Commented: (JDO-517) NPE on enhancement of classes with




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    [jira] Commented: (JDO-517) NPE on enhancement of classes with  
Andy Jefferson (JIRA)


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-15-07 12:11 PM


[ https://issues.apache.org/jira/brow...action_12519893 ]

Andy Jefferson commented on JDO-517:
------------------------------------

> If a class is persistence-capable, by default fields of a particular type 
are persistent.
> Therefore, to use properties, fields must be marked not persistent.

This is an imposition on the user IMHO. When a property is marked as persist
ent (and should have a field-name attribute defined according to the spec 18
.14 - which they don't in this case) then that should automatically make the
 associated field NotPersis
tent with no need for marking it. You can't persistent both the field and th
e property (jdoSetXXX enhanced methods have to handle field OR property.

I also don't see any NPE. I see
Class org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSInsurance has property fi
eldRepr declared in MetaData, but its setter method doesnt exist in the clas
s!

which is simply due to following JPA policy on persistent fields/properties 
- either all fields, or all properties. So if there is some property it find
s all un-annotated getters and marks those as persistent - but since JDO is 
going a different route it
needs different handling. Will take a while to allow for JDO rules on persis
tent props alongside catering for what we already cater for.


> NPE on enhancement of classes with persistent properties
> --------------------------------------------------------
>
>                 Key: JDO-517
>                 URL: https://issues.apache.org/jira/browse/JDO-517
>             Project: JDO
>          Issue Type: Bug
>          Components: tck2
>    Affects Versions: JDO 2 maintenance release 1
>            Reporter: Michelle Caisse
>            Assignee: Andy Jefferson
>
> To reproduce, edit project.propeties, go to the end of the file, and edit 
out the comment and blank lines so that the classes in the companyAnnotatedP
C package are included in the argument list to the enhancer.
> 11:39:16,031 (main) ERROR [JPOX.Enhancer] - An error was encountered reading t
he specified input files. Please consult the log for details. The following may help
 : Errors were encountered when loading the specified MetaData files and classes. Se
e the n
ested exceptions for details
> Errors were encountered when loading the specified MetaData files and clas
ses. See the nested exceptions for details
> org.jpox.exceptions.JPOXUserException: Errors were encountered when loadin
g the specified MetaData files and classes. See the nested exceptions for de
tails
> 	at org.jpox.metadata.MetaDataManager.initialise(MetaDataManager.java:299)
> 	at org.jpox.enhancer.JPOXEnhancer.getFileMetaDataForInput(JPOXEnhancer.ja
va:724)
> 	at org.jpox.enhancer.JPOXEnhancer.main(JPOXEnhancer.java:533)
> Caused by: java.lang.NullPointerException
> 	at org.jpox.metadata.annotations.JDOAnnotationReader.processFieldAnnotati
ons(JDOAnnotationReader.java:1594)
> 	at org.jpox.metadata.annotations.AbstractAnnotationReader.getMetaDataForC
lass(AbstractAnnotationReader.java:211)
> 	at org.jpox.metadata.annotations.AnnotationManagerImpl.getMetaDataForClas
s(AnnotationManagerImpl.java:133)
> 	at org.jpox.metadata.MetaDataManager.loadAnnotationsForClass(MetaDataMana
ger.java:1729)
> 	at org.jpox.metadata.MetaDataManager.initialise(MetaDataManager.java:265)
> 	... 2 more
> Nested Throwables StackTrace:
> java.lang.NullPointerException
> 	at org.jpox.metadata.annotations.JDOAnnotationReader.processFieldAnnotati
ons(JDOAnnotationReader.java:1594)
> 	at org.jpox.metadata.annotations.AbstractAnnotationReader.getMetaDataForC
lass(AbstractAnnotationReader.java:211)
> 	at org.jpox.metadata.annotations.AnnotationManagerImpl.getMetaDataForClas
s(AnnotationManagerImpl.java:133)
> 	at org.jpox.metadata.MetaDataManager.loadAnnotationsForClass(MetaDataMana
ger.java:1729)
> 	at org.jpox.metadata.MetaDataManager.initialise(MetaDataManager.java:265)
> 	at org.jpox.enhancer.JPOXEnhancer.getFileMetaDataForInput(JPOXEnhancer.ja
va:724)
> 	at org.jpox.enhancer.JPOXEnhancer.main(JPOXEnhancer.java:533)
> java.lang.NullPointerException
> 	at org.jpox.metadata.annotations.JDOAnnotationReader.processFieldAnnotati
ons(JDOAnnotationReader.java:1594)
> 	at org.jpox.metadata.annotations.AbstractAnnotationReader.getMetaDataForC
lass(AbstractAnnotationReader.java:211)
> 	at org.jpox.metadata.annotations.AnnotationManagerImpl.getMetaDataForClas
s(AnnotationManagerImpl.java:133)
> 	at org.jpox.metadata.MetaDataManager.loadAnnotationsForClass(MetaDataMana
ger.java:1729)
> 	at org.jpox.metadata.MetaDataManager.initialise(MetaDataManager.java:265)
> 	at org.jpox.enhancer.JPOXEnhancer.getFileMetaDataForInput(JPOXEnhancer.ja
va:724)
> 	at org.jpox.enhancer.JPOXEnhancer.main(JPOXEnhancer.java:533)

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







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:24 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register