Hi, Just to close on this discussion... Krishnaprasad and I were discussing this issue offline. He eventually debugged the issue and tracked it down to some errant orm.xml files. Since an NPE is still not good regardless of how he got to this situation, I have created a JIRA to track the issue:
https://issues.apache.org/jira/browse/OPENJPA-2331 Krishnaprasad, if you can append any additional details, they would be appreciated. Thanks, Kevin On Fri, Feb 8, 2013 at 2:57 PM, James Carman <ja...@carmanconsulting.com>wrote: > Of course, but openjpa shouldn't need it. > > On Friday, February 8, 2013, Kevin Sutter wrote: > > > If property access is desired, then appropriate getter/setter methods > need > > to be defined for the Entity. > > > > On Thu, Feb 7, 2013 at 7:46 PM, James Carman <ja...@carmanconsulting.com > <javascript:;> > > >wrote: > > > > > Can't you map entities with no getters/setters? > > > > > > On Thursday, February 7, 2013, Kevin Sutter wrote: > > > > > > > Hi, > > > > The NPE is happening in the code where OpenJPA is attempting to > > enhance a > > > > getter method. It looks like OpenJPA is assuming that the metadata > > > > associated with a field (attribute) is available, but for some reason > > it > > > is > > > > not. So, either the POJO doesn't contain all of the required > > > getter/setter > > > > methods. Or, some field is being marked as being persistent, but > > doesn't > > > > have the required getter/setter methods. > > > > > > > > Granted, an NPE is not good. But, we would need to understand the > > > scenario > > > > a bit more before resolving that issue. My guess is that even if we > > > > resolved the NPE, there is something else wrong with the environment, > > > POJO, > > > > or configuration that will prevent the enhancement from completing as > > > > expected. > > > > > > > > If you can re-create this issue with a simple junit, then that would > > help > > > > with deciphering the real error and hopefully figure out proper > > > resolution. > > > > > > > > Just curious... What version of Java are you using? Java 7 threw in > > > some > > > > wrinkles that didn't get resolved until OpenJPA 2.2.x. But, you > > claimed > > > > this also didn't work with 2.2.x, so maybe Java 7 is not in the > > picture. > > > > > > > > Thanks, > > > > Kevin > > > > > > > > On Thu, Feb 7, 2013 at 7:31 AM, Krishnaprasad Subbarao < > > > > krishnapras...@in.ibm.com> wrote: > > > > > > > > > Hello, > > > > > > > > > > I am using OpenJPA 2.0.1 in a project and trying to enhance the > POJO > > > > > classes during build time. Following is the error I am getting from > > > > > enhancer. > > > > > > > > > > [openjpac] <openjpa-2.0.1-r422266:989424 nonfatal general error> > > > > > org.apache.openjpa.util.GeneralException: An error occurred while > > > > > enhancing test.NewParty. Exception message: null > > > > > [openjpac] at > > > > > org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:549) > > > > > [openjpac] at > > > > > org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4654) > > > > > [openjpac] at > > > > > > > org.apache.openjpa.ant.PCEnhancerTask.executeOn(PCEnhancerTask.java:89) > > > > > [openjpac] at > > > > > > > org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:171) > > > > > [openjpac] at > > > > > > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) > > > > > [openjpac] at > > sun.reflect.GeneratedMethodAccessor3.invoke(Unknown > > > > > Source) > > > > > [openjpac] at > > > > > > > > > > > > > > > > > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) > > > > > [openjpac] at java.lang.reflect.Method.invoke(Method.java:611) > > > > > [openjpac] at > > > > > > > > > > > > > > > org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) > > > > > [openjpac] at org.apache.tools.ant.Task.perform(Task.java:348) > > > > > [openjpac] at > > org.apache.tools.ant.Target.execute(Target.java:357) > > > > > [openjpac] at > > > > > org.apache.tools.ant.Target.performTasks(Target.java:385) > > > > > [openjpac] at > > > > > > org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337) > > > > > [openjpac] at > > > > > > > > > > > > > > > > > > > > org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38) > > > > > [openjpac] at > > > > > org.apache.tools.ant.Project.executeTargets(Project.java:1189) > > > > > [openjpac] at > > > > org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416) > > > > > [openjpac] at > > > > > org.apach >