You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Laird Nelson <lj...@gmail.com> on 2011/09/05 02:40:32 UTC
Running PCEnhancer on a pile of classes that are not all entities
I wanted to verify that this ominous PCEnhancer warning:
3294 weaving WARN [main] openjpa.Enhance - Type "class
> com.foobar.FoobarPropertyEditor" loaded by
> org.apache.openjpa.lib.util.TemporaryClassLoader@5fd1358f has no metadata;
> enhancing as persistence aware. If you intended for "class
> com.FoobarPropertyEditor" to be persistence-capable, then this means that
> OpenJPA could not find any metadata for "class
> com.foobar.FoobarPropertyEditor". This can happen if the directory
> containing your metadata is not in your CLASSPATH, or if your metadata files
> are not named properly. See the documentation on metadata placement for more
> information.
>
...simply means that the OpenJPA PCEnhancer effectively took no action on
the class in question.
I am running the PCEnhancer through Ant as invoked by the
maven-antrun-plugin; I have opted to run it over a directory tree (via Ant's
<fileset> element) rather than specifying the <class> files in the
persistence.xml. For various reasons, this means that among the many
.classfiles in the directory tree are classes that are not entities.
I want to
make sure that they are not being modified in any way. I looked at the
.class file in emacs and didn't see anything obvious.
Best,
Laird
--
http://about.me/lairdnelson
Re: Running PCEnhancer on a pile of classes that are not all entities
Posted by Michael Dick <mi...@gmail.com>.
This should be explained in our user manual. It'd be nice to reduce the
number of warning messages, and make them a little more friendly too.
I've opened a JIRA :
OPENJPA-2047<https://issues.apache.org/jira/browse/OPENJPA-2047>to
address the documentation, and look into a better way to log this
condition.
-mike
On Tue, Sep 6, 2011 at 11:45 AM, ljnelson <lj...@gmail.com> wrote:
> On Tue, Sep 6, 2011 at 12:24 PM, Michael Dick [via OpenJPA] <
> ml-node+6764535-652757152-155969@n2.nabble.com> wrote:
>
> > Typical applications will interact with entities (PersistenceCapable
> > classes) through the accessor and mutator methods anyway, so any
> > modifications should be a no-op. But the potential for modification is
> > there.
>
>
> Thanks.
>
> Best,
> Laird
>
> --
> http://about.me/lairdnelson
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/Running-PCEnhancer-on-a-pile-of-classes-that-are-not-all-entities-tp6759518p6764636.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: Running PCEnhancer on a pile of classes that are not all
entities
Posted by ljnelson <lj...@gmail.com>.
On Tue, Sep 6, 2011 at 12:24 PM, Michael Dick [via OpenJPA] <
ml-node+6764535-652757152-155969@n2.nabble.com> wrote:
> Typical applications will interact with entities (PersistenceCapable
> classes) through the accessor and mutator methods anyway, so any
> modifications should be a no-op. But the potential for modification is
> there.
Thanks.
Best,
Laird
--
http://about.me/lairdnelson
--
View this message in context: http://openjpa.208410.n2.nabble.com/Running-PCEnhancer-on-a-pile-of-classes-that-are-not-all-entities-tp6759518p6764636.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: Running PCEnhancer on a pile of classes that are not all entities
Posted by Michael Dick <mi...@gmail.com>.
The PCEnhancer has its roots in the Kodo (the JDO provider that OpenJPA is
based on). The answer to your question comes from the JDO spec :
Enhancement makes the following changes to persistence aware classes:
• modifies executable code that accesses fields of PersistenceCapable
classes
not known to be not managed, replacing getfield and putfield calls with
calls to the generated accessor and mutator methods.
Typical applications will interact with entities (PersistenceCapable
classes) through the accessor and mutator methods anyway, so any
modifications should be a no-op. But the potential for modification is
there.
Hope this helps,
-mike
On Sun, Sep 4, 2011 at 7:40 PM, Laird Nelson <lj...@gmail.com> wrote:
> I wanted to verify that this ominous PCEnhancer warning:
>
> 3294 weaving WARN [main] openjpa.Enhance - Type "class
> > com.foobar.FoobarPropertyEditor" loaded by
> > org.apache.openjpa.lib.util.TemporaryClassLoader@5fd1358f has no
> metadata;
> > enhancing as persistence aware. If you intended for "class
> > com.FoobarPropertyEditor" to be persistence-capable, then this means that
> > OpenJPA could not find any metadata for "class
> > com.foobar.FoobarPropertyEditor". This can happen if the directory
> > containing your metadata is not in your CLASSPATH, or if your metadata
> files
> > are not named properly. See the documentation on metadata placement for
> more
> > information.
> >
>
> ...simply means that the OpenJPA PCEnhancer effectively took no action on
> the class in question.
>
> I am running the PCEnhancer through Ant as invoked by the
> maven-antrun-plugin; I have opted to run it over a directory tree (via
> Ant's
> <fileset> element) rather than specifying the <class> files in the
> persistence.xml. For various reasons, this means that among the many
> .classfiles in the directory tree are classes that are not entities.
> I want to
> make sure that they are not being modified in any way. I looked at the
> .class file in emacs and didn't see anything obvious.
>
> Best,
> Laird
>
> --
> http://about.me/lairdnelson
>