Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Dynamic FetchGroup usage

The error seems to indicate that you have the same persistence.xml file on
your classpath twice.  You should remove the src directory from your
classpath.  The error should probably be a warning though, so you could log
a bug for it, I'm surprised JPA works at all with your classpath as I would
expect the same error later without weaving.

Instead of dynamic weaving you could also use static weaving, or implement
the FetchGroupTracker interface yourself directly in your Entity class (or a
common superclass).

MarcNuri wrote:
> Thanks for your reply James.
> I spent a while investigating the problem and I found out that my problem
> was (is) what you're saying, you need weaving enabled to be able to use
> FetchGroups. By the way, that is clearly explained in the javadoc (my
> fault not reading thoroughly).
> The problem is that I'm not using weaving. I came to FetchGroups in first
> place because of the deprecation alert in the "addPartialAttribute(...)"
> method in org.​eclipse.​persistence.​queries.​ObjectLevelReadQuery. The
> api clearly states the following: "Deprecated. since EclipseLink 2.1,
> partial attributes replaced by fetch groups.".
> The thing is that you can use partial attributes without weaving but
> that's not the case with the replacement approach via FetchGroups.
> So my question now is if this means that if I update to future versions of
> EclipseLink I'm going to loose functionality or in the other hand there is
> something else I can do (apart from enabling weaving).
> To answer why I'm not using weaving: Weaving is really easy to enable, you
> just have to add " -javaagent:(path to eclipselink.jar)", unfortunately in
> my development environment (Netbeans), this is the exception I get when
> turning on the feature:
> ++++++++++++++++++++++++++++++++++++++++++
> Exception Description: Persistence unit $puName is defined in both
> URL:file:/F:/$path/build/classes/ and URL:file:/F:/$path/src/. Cannot have
> several persistence units with the same name loaded by the same
> classloader.
> ++++++++++++++++++++++++++++++++++++++++++
> I've found no easy way of correcting this error and waving is not a real
> priority in my projects (for now).
> Regards
> P.S. If anyone knows a way I can bypass any of the prior issues, help is
> appreciated.
> --
> Marc Nuri

----- James Sutherland
 EclipseLink ,
Wiki: EclipseLink , TopLink 
Forums: TopLink , EclipseLink 
Book: Java Persistence 
Blog: Java Persistence
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

Back to the top