Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] EclipseLink 2: ANT Task Error

I'm suggesting copying the META-INF/persistence.xml to another level. Based on previous emails you have something like:
D:/Project/website/WebContent/META-INF/persistence.xml

So copy META-INF/persistence.xml at different directory levels, e.g.

D:/Project/website/META-INF/persistence.xml

Where is your build.xml/ant task defined? Try adding META-INF/persistence.xml off that directory. Basically, see if the generator can find the file automatically from some other level (other then where you have it now)

Cheers,
Guy

On 14/05/2011 8:16 AM, Chuong Pham wrote:
My persistence.xml is already in META-INF directory. Do I need to copy
another persistence.xml file into the META-INF directory and overwrite the
existing file? Sorry, but I'm confused by what you suggest. :confused:

If I removed the "-Aeclipselink.persistencexml" directive, the project
builds fine but it will not generate any classes to be used with the
CriteriaBuilder. I have already tried this scenario before and had seen the
following messages:

 [javac] Note: The persistence xml file [META-INF/persistence.xml] was not
found. NO GENERATION will occur!! Please ensure a persistence xml file is
available either from the CLASS_OUTPUT directory [META-INF/persistence.xml]
or using the eclipselink.persistencexml property to specify its location. 
    [javac] Processor
org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor
matches [javax.persistence.PersistenceContext, javax.persistence.Access,
javax.persistence.NamedNativeQueries, javax.persistence.Column,
javax.persistence.Table, javax.persistence.Id, javax.persistence.Entity,
javax.persistence.Lob, javax.persistence.GeneratedValue] and returns false.
 
I have tried every possible combinations of referencing the persistence.xml 
file during ANT's build process without success. I think the EclipseLink
development team need to investigate this issue. Searching google for
similar issues with EclipseLink revealed that this problem has also been
encountered in the past. Perhaps, the issue was forgotten... or was never
resolved. I don't know. Someone would know the answer.


Guy Pelletier wrote:
  To aid in debugging, try removing the -Aeclipselink.persistencexml 
altogether and from the directory where you kick off the ant task copy 
your persistence.xml to META-INF/persistence.xml.


    

Back to the top