Re: Maven2 cgen task problem

From: Gary Jarrel (garyjarre..mail.com)
Date: Mon May 24 2010 - 08:44:29 UTC

  • Next message: Steve Wells: "Re: OutOfMemory with large number of inserts"

    >
    > Aha, the Maven task is naive assuming all XML files in a given folder are
    > DataMaps... I guess we may make it smarter by and check for map.xml
    > extensions. For now the fix is to delete the backup file
    > "ssistMap.map.xml~".
    >

    Ouch, how did I miss that... I removed the files and ran it again the
    the problem persisted!

    Then I removed the .svn directory from that folder and am now getting
    a new error:

    [DEBUG] Configuring mojo
    'org.apache.cayenne.plugins:maven-cayenne-plugin:3.0:cgen' -->
    [DEBUG] (f) additionalMaps =
    /home/garyj/dev/workspace/com1-projects/projects/core-site/src/main/webapp/WEB-INF/conf/cayenne
    [DEBUG] (f) client = false
    [DEBUG] (f) destDir =
    /home/garyj/dev/workspace/com1-projects/projects/core-site/src/main/java
    [DEBUG] (f) makePairs = true
    [DEBUG] (f) map =
    /home/garyj/dev/workspace/com1-projects/projects/core-site/src/main/webapp/WEB-INF/conf/cayenne/comoneMap.map.xml
    [DEBUG] (f) mode = entity
    [DEBUG] (f) outputPattern = *.java
    [DEBUG] (f) overwrite = false
    [DEBUG] (f) project = MavenProject:
    au.com.jarrel.comone:com1-website:1.0 @
    /home/garyj/dev/workspace/com1-projects/projects/core-site/pom.xml
    [DEBUG] (f) superPkg = au.com.jarrel.comone.site.db.entity.auto
    [DEBUG] (f) superTemplate =
    /home/garyj/dev/workspace/com1-projects/projects/core-site/src/bootstrap/superclass.vm
    [DEBUG] (f) usePkgPath = true
    [DEBUG] -- end configuration --
    [INFO] [cayenne:cgen {execution: default-cli}]
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Error generating classes:

    Embedded error: [v.3.0 Apr 30 2010 11:29:33] Error loading DataMap,
    last processed tag: <null>
    /home/garyj/dev/workspace/com1-projects/projects/core-site/cayenne.xml
    (No such file or directory)
    [INFO] ------------------------------------------------------------------------
    [DEBUG] Trace
    org.apache.maven.lifecycle.LifecycleExecutionException: Error
    generating classes:
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
            at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
            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:597)
            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)
    Caused by: org.apache.maven.plugin.MojoExecutionException: Error
    generating classes:
            at org.apache.cayenne.tools.CayenneGeneratorMojo.execute(CayenneGeneratorMojo.java:249)
            at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
            ... 17 more
    Caused by: org.apache.cayenne.CayenneRuntimeException: [v.3.0 Apr 30
    2010 11:29:33] Error loading DataMap, last processed tag: <null>
            at org.apache.cayenne.map.MapLoader.loadDataMap(MapLoader.java:732)
            at org.apache.cayenne.tools.CayenneGeneratorMapLoaderAction.loadDataMap(CayenneGeneratorMapLoaderAction.java:69)
            at org.apache.cayenne.tools.CayenneGeneratorMapLoaderAction.getMainDataMap(CayenneGeneratorMapLoaderAction.java:54)
            at org.apache.cayenne.tools.CayenneGeneratorMojo.execute(CayenneGeneratorMojo.java:238)
            ... 19 more
    Caused by: java.io.FileNotFoundException:
    /home/garyj/dev/workspace/com1-projects/projects/core-site/cayenne.xml
    (No such file or directory)
            at java.io.FileInputStream.open(Native Method)
            at java.io.FileInputStream.<init>(FileInputStream.java:106)
            at java.io.FileInputStream.<init>(FileInputStream.java:66)
            at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
            at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
            at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:653)
            at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
            at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
            at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
            at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
            at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
            at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
            at org.apache.cayenne.map.MapLoader.loadDataMap(MapLoader.java:721)
            ... 22 more

    Notice how in the configuration options all the paths are correct:

    /home/garyj/dev/workspace/com1-projects/projects/core-site/src/main/webapp/WEB-INF/conf/cayenne

    However FileNotFoundException says:

     /home/garyj/dev/workspace/com1-projects/projects/core-site/cayenne.xml

    Furthermore if I remove cayenne.xml from the conf directory I get the
    same error but the file name changes to the extra data map that I have
    in that directory.

    Any further thoughts?

    Cheers,

    Gary



    This archive was generated by hypermail 2.0.0 : Mon May 24 2010 - 08:45:04 UTC