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 tried this
"-Aeclipselink.persistencexml=website/WebContent/META-INF/persistence.xml"
and got this message:

    [javac] Note: Found Option : eclipselink.persistencexml, with value:
website/WebContent/META-INF/persistence.xml
    [javac] Note: The persistence xml file
[website/WebContent/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.
    [javac] Round 2:
    [javac] 	input files: {}
    [javac] 	annotations: []
    [javac] 	last round: true
    [javac] warning: The following options were not recognized by any
processor: '[eclipselink.persistencexml]'

Which is strange as the persistence.xml for my project IS under
WebContent/META-INF/ folder so I don't know why I got the above message.

I also tried your second suggestion
"-Aeclipselink.persistencexml=file://D:/Project/website/WebContent/META-INF/persistence.xml"
and got this error message:

    [javac] Caused by: java.lang.IllegalArgumentException: relativeName is
invalid
    [javac] 	at
com.sun.tools.javac.util.DefaultFileManager.getFileForOutput(DefaultFileManager.java:1030)
    [javac] 	at
com.sun.tools.javac.processing.JavacFiler.getResource(JavacFiler.java:434)
    [javac] 	at
org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnitReader.getFileObject(PersistenceUnitReader.java:93)
    [javac] 	at
org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnitReader.getInputStream(PersistenceUnitReader.java:104)
    [javac] 	at
org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnitReader.initPersistenceUnits(PersistenceUnitReader.java:169)
    [javac] 	at
org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnitReader.<init>(PersistenceUnitReader.java:71)
    [javac] 	at
org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:376)
    [javac] 	... 31 more

My project directory path is: D:\project\website\ and then the project
folders META-INF, resources, templates, WEB-INF under D:\project\website\. I
don't think it's a problem with the project structure as I am able to use
ANT and build my project successfully without EclipseLink model generator
directives. As soon as I use EclipseLink model generator, I get problems.

Do you have any other suggestions? If not, I'll log a bug with the
EclipseLink team for investigation.


Cronemberger, Constantino wrote:
> 
> For me it worked like this:
> 
> <compilerarg
> value="-Aeclipselink.persistencexml=file://D:/Project/website/WebContent/META-INF/persistence.xml"/>
> 
> It also works with relative path, like
> "website/WebContent/META-INF/persistence.xml" considering build.xml is in
> the D:/Project directory.
> 

-- 
View this message in context: http://old.nabble.com/EclipseLink-2%3A-ANT-Task-Error-tp31475388p31602075.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top