Welcome Guest  |  Register  |  Login
Login Name Password
  Search  
  Index  | Recent Threads  | Unanswered Threads  | Who's Online  | User List  | Help


Quick Go »

No member browsing this thread
Thread Status: Active
Total posts in this thread: 3
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 177 times and has 2 replies Next Thread
Male jhudson
Newbie



US
Joined: Feb 2, 2010
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
how to tell enhancer to ignore a "get(String)" method?

Hello,

I am using the Google App Engine Eclipse plugin and get an error when I save a Java class with a get(String) method.

The enhancer is throwing a NullPointerException. I have added the transient annotation and don't know what else I can do to avoid this issue. Can anyobody please give me some advice?

I am using datanucleus-jpa-1.1.5.jar

Thank you very much.


The referenced code is below:
@Entity
public class TestEntity implements Serializable {

private String dummyProperty;

public String getDummyProperty() {
return dummyProperty;
}

public void setDummyProperty(String dummyProperty) {
this.dummyProperty = dummyProperty;
}

@Transient
public Object get(String key) {
return null;
}
}




And, here is the stack trace:

DataNucleus Enhancer (version 1.1.4) : Enhancement of classes
Errors were encountered when loading the specified MetaData files and classes. See the nested exceptions for details
Feb 2, 2010 1:45:24 PM org.datanucleus.enhancer.DataNucleusEnhancer main
SEVERE: DataNucleus Enhancer completed with an error. Please review the enhancer log for full details. Some classes may have been enhanced but some caused errors
Errors were encountered when loading the specified MetaData files and classes. See the nested exceptions for details
org.datanucleus.exceptions.NucleusUserException: Errors were encountered when loading the specified MetaData files and classes. See the nested exceptions for details
at org.datanucleus.metadata.MetaDataManager.loadClasses(MetaDataManager.java:426)
at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:743)
at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:545)
at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1252)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:57)
at com.google.appengine.tools.enhancer.Enhance.<init>(Enhance.java:60)
at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:41)
Caused by: java.lang.NullPointerException
at org.datanucleus.jpa.metadata.JPAAnnotationReader.processMemberAnnotations(JPAAnnotationReader.java:8
53)
at org.datanucleus.metadata.annotations.AbstractAnnotationReader.getMetaDataForClass(AbstractAnnotation
Reader.java:159)
at org.datanucleus.metadata.annotations.AnnotationManagerImpl.getMetaDataForClass(AnnotationManagerImpl
.java:136)
at org.datanucleus.metadata.MetaDataManager.loadAnnotationsForClass(MetaDataManager.java:2278)
at org.datanucleus.metadata.MetaDataManager.loadClasses(MetaDataManager.java:385)
... 10 more
Nested Throwables StackTrace:
DataNucleus Enhancer completed with an error. Please review the enhancer log for full details. Some classes may have been enhanced but some caused errors
java.lang.NullPointerException
DataNucleus Enhancer completed and no classes were enhanced. Consult the log for full details
at org.datanucleus.jpa.metadata.JPAAnnotationReader.processMemberAnnotations(JPAAnnotationReader.java:8
53)
at org.datanucleus.metadata.annotations.AbstractAnnotationReader.getMetaDataForClass(AbstractAnnotation
Reader.java:159)
at org.datanucleus.metadata.annotations.AnnotationManagerImpl.getMetaDataForClass(AnnotationManagerImpl
.java:136)
at org.datanucleus.metadata.MetaDataManager.loadAnnotationsForClass(MetaDataManager.java:2278)
at org.datanucleus.metadata.MetaDataManager.loadClasses(MetaDataManager.java:385)
at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:743)
at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:545)
at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1252)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:57)
at com.google.appengine.tools.enhancer.Enhance.<init>(Enhance.java:60)
at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:41)
[Feb 2, 2010 7:52:25 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male andy
Expert
Member's Avatar

UK
Joined: Mar 13, 2004
Post Count: 5235
Status: Offline
Reply to this Post  Reply with Quote 
Re: how to tell enhancer to ignore a "get(String)" method?

Rename the method to be something else (e.g getXXX). Annotations code had some check on a method being a Java bean getter, checking if it started "get", but neglected to check if it was longer than that. SVN code works, but that won't help you until Google bother updating their plugin to use DN 2.0
----------------------------------------
-Andy smile

[Feb 2, 2010 8:58:06 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male jhudson
Newbie



US
Joined: Feb 2, 2010
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
Re: how to tell enhancer to ignore a "get(String)" method?

Thank you very much Andy.

I appreciate the response. Unfortunately I can't rename the method because I am implementing an external interface (GXT's ModelBean). Oh well, I'll just hope that GAE updates their plugin soon. Again, thanks.
[Feb 2, 2010 9:36:20 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread