Hi Patrick,

Here's the NPE from the maven openjpa plugin. Again, the way to avoid
this is to specify at least one property in the POM xml for the
plugin.

As to the other bug being in the @PreUpdate code, I am not so sure. As
another mailing list user has also attested, I think that Updates are
occuring where they should not be. In that case, @PreUpdate is working
as expected but the even that triggers an Update lifecycle event may
be firing unexpectedly

-Marc


[INFO] [openjpa:enhance]
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] null
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.NullPointerException
        at 
org.codehaus.mojo.openjpa.OpenJpaEnhancerMojo.enhance(OpenJpaEnhancerMojo.java:200)
        at 
org.codehaus.mojo.openjpa.OpenJpaEnhancerMojo.execute(OpenJpaEnhancerMojo.java:105)
        at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
        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:585)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

On 11/1/07, Patrick Linskey <[EMAIL PROTECTED]> wrote:
> What's the npe? Maybe we can get them to fix that.
>
> Sounds like a bug in our preupdate code.
>
> -Patrick
>
> On 11/1/07, Marc Siegel <[EMAIL PROTECTED]> wrote:
> > Ok, here's what I've tried:
> >
> > 1.  Tried the maven openjpa:enhance plugin. It bombed with an NPE
> > 2.  Changed everything to property access
> >      - Lazy fetching works, but @PreUpdate is still running on all
> > objects seen during the transaction
> > 3.  Got maven plugin to work - secret is you need to provide at least
> > one property
> >      - much faster execution, but the @PreUpdate problem still there
> >
> > What's even wierder, is that the @PreUpdate appears to be running
> > after every persist in a transaction. This turns a loop persisting N
> > objects into an almost N^2 loop.
> >
> > What gives with that?
> >
> > -Marc
> >
> >
> > On 11/1/07, Patrick Linskey <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > > To my knowledge, the Maven plugin works. But I'm not an expert with
> > > it. You can also directly call the ant enhance task from Maven
> > > somehow. Again, sadly, I'm no Maven expert.
> > >
> > > Property access is a bit intrusive into your model IMO, so some
> > > alternative that doesn't require that sort of change seems like it'd
> > > be better.
> > >
> > > Meanwhile, we should also beef up our support for lazy fields one way
> > > or another in that environment.
> > >
> > > -Patrick
> > >
> > > On Nov 1, 2007 3:06 PM, Marc Siegel <[EMAIL PROTECTED]> wrote:
> > > > Hi Patrick,
> > > >
> > > > This is the second time you've responded just immediately after I
> > > > uncovered the source of the OpenJPA issue.
> > > >
> > > > I assume you are referring to
> > > >
> > file:///Developer/Java/docs-apache-openjpa-1.0.0/manual/ref_guide_pc_enhance.html#ref_guide_pc_enhance_unenhanced_types
> > > >
> > > > I am using
> > > >   - Java 5
> > > >   - field access
> > > >   - no java agent specified
> > > >   - building w/ Maven
> > > >
> > > > What is the best way to resolve this?
> > > >   - should I move to property-based access?
> > > >   - Is the maven plugin for build-time enhancement working?
> > > >   - something else?
> > > >
> > > > Thanks in advance,
> > > > -Marc
> > > >
> > > >
> > > >
> > > > On 11/1/07, Patrick Linskey <[EMAIL PROTECTED]> wrote:
> > > > > Hi,
> > > > >
> > > > > Are you using the OpenJPA enhancer? If not, are you using field or
> > > > > property access?
> > > > >
> > > > > -Patrick
> > > > >
> > > > > On Nov 1, 2007 2:56 PM, Marc Siegel <[EMAIL PROTECTED]> wrote:
> > > > > > Hi guys,
> > > > > >
> > > > > > Has anybody else ever encountered the problem where
> > > > > > @OneToMany(fetch=FetchType.LAZY) is returning null when the
> > collection
> > > > > > is retrieved, but works correctly after an explicit LEFT FETCH JOIN
> > > > > > query?
> > > > > >
> > > > > > The fact that the LEFT FETCH JOIN works means that my setup can't be
> > > > > > too badly messed up... I am at a loss as to how to proceed here.
> > > > > >
> > > > > > Thanks in advance for any help,
> > > > > > -Marc
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Patrick Linskey
> > > > > 202 669 5907
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Patrick Linskey
> > > 202 669 5907
> > >
> >
>
>
> --
> Patrick Linskey
> 202 669 5907
>

Reply via email to