Re: cayenne-ANT : package org.apache.cayenne does not exist

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Sep 13 2010 - 20:38:34 UTC

  • Next message: Eric Lazarus: "Re: Using Cayenne in two different webapps in the same TomCat instance"

    Hi,

    Your Ant file probably doesn't have the right classpath, specifically the Cayenne jars.

    I am curios though why are you not using Maven as tutorial is Maven based and provides all the setup steps to get you going?

    Andrus

    On Sep 9, 2010, at 12:43 PM, bogdan_voloshincu wrote:

    >
    > hello! i have a problem when i'm trying to compile the Main class of the
    > Cayenne Getting Started tutorial with ANT. ant can't find the
    > org.apache.cayenne package that is imported in :
    >
    > ------------------------------------------------------------
    >
    > package org.example.cayenne.persistent.auto;
    >
    > import org.apache.cayenne.CayenneDataObject;
    >
    > /**
    > * Class _Artist was generated by Cayenne.
    > * It is probably a good idea to avoid changing this class manually,
    > * since it may be overwritten next time code is regenerated.
    > * If you need to make any customizations, please use subclass.
    > */
    > public abstract class _Artist extends CayenneDataObject {
    >
    > public static final String NUM_PROPERTY = "num";
    > public static final String NUME_PROPERTY = "nume";
    >
    > public static final String ID_PK_COLUMN = "id";
    >
    > public void setNum(String num) {
    > writeProperty("num", num);
    > }
    > public String getNum() {
    > return (String)readProperty("num");
    > }
    >
    > public void setNume(String nume) {
    > writeProperty("nume", nume);
    > }
    > public String getNume() {
    > return (String)readProperty("nume");
    > }
    >
    > }
    >
    > -----------------------------------------------------
    > I added the cayenne/lib jars in the buildpath and also i included the
    > classpath of cayenne/lib jars in the build.xml and doesn't work .
    >
    > Thank's
    >
    > -----------------------------------------------------
    >
    > Buildfile: C:\Users\abc\wCayenne\tutorial\build.xml
    > getp:
    > [echo] classpath setup
    > gen:
    > [echo] task inited
    > [delete] Deleting directory C:\Users\abc\wCayenne\tutorial\src\com
    > [mkdir] Created dir: C:\Users\abc\wCayenne\tutorial\src\com
    > [cgen] Generating class file:
    > C:\Users\abc\wCayenne\tutorial\src\com\Artist.java
    > [cgen] Generating class file:
    > C:\Users\abc\wCayenne\tutorial\src\com\Ruby.java
    > compile:
    > [javac] Compiling 7 source files to C:\Users\abc\wCayenne\tutorial\build
    > [javac]
    > C:\Users\abc\wCayenne\tutorial\src\main\java\org\example\cayenne\persistent\auto\_Artist.java:3:
    > package org.apache.cayenne does not exist
    > [javac] import org.apache.cayenne.CayenneDataObject;
    > [javac] ^
    > [javac]
    > C:\Users\abc\wCayenne\tutorial\src\main\java\org\example\cayenne\persistent\auto\_Artist.java:11:
    > cannot find symbol
    > [javac] symbol: class CayenneDataObject
    > [javac] public abstract class _Artist extends CayenneDataObject {
    > [javac] ^
    > [javac]
    > C:\Users\abc\wCayenne\tutorial\src\main\java\org\example\cayenne\persistent\Main.java:4:
    > package org.apache.cayenne does not exist
    > [javac] import org.apache.cayenne.ObjectContext;
    > [javac] ^
    > [javac]
    > C:\Users\abc\wCayenne\tutorial\src\main\java\org\example\cayenne\persistent\Main.java:5:
    > package org.apache.cayenne.access does not exist
    > [javac] import org.apache.cayenne.access.DataContext;
    > [javac] ^
    > [javac]
    > C:\Users\abc\wCayenne\tutorial\src\main\java\org\example\cayenne\persistent\auto\_Ruby.java:3:
    > package org.apache.cayenne does not exist
    > [javac] import org.apache.cayenne.CayenneDataObject;
    > [javac] ^
    > [javac]
    > C:\Users\abc\wCayenne\tutorial\src\main\java\org\example\cayenne\persistent\auto\_Ruby.java:11:
    > cannot find symbol
    > [javac] symbol: class CayenneDataObject
    > [javac] public abstract class _Ruby extends CayenneDataObject {
    > [javac] ^
    > [javac]
    > C:\Users\abc\wCayenne\tutorial\src\main\java\org\example\cayenne\persistent\auto\_Artist.java:19:
    > cannot find symbol
    > [javac] symbol : method
    > writeProperty(java.lang.String,java.lang.String)
    > [javac] location: class org.example.cayenne.persistent.auto._Artist
    > [javac] writeProperty("num", num);
    > [javac] ^
    > [javac]
    > C:\Users\abc\wCayenne\tutorial\src\main\java\org\example\cayenne\persistent\auto\_Artist.java:22:
    > cannot find symbol
    > [javac] symbol : method readProperty(java.lang.String)
    > [javac] location: class org.example.cayenne.persistent.auto._Artist
    > [javac] return (String)readProperty("num");
    > [javac] ^
    > [javac]
    > C:\Users\abc\wCayenne\tutorial\src\main\java\org\example\cayenne\persistent\auto\_Artist.java:26:
    > cannot find symbol
    > [javac] symbol : method
    > writeProperty(java.lang.String,java.lang.String)
    > [javac] location: class org.example.cayenne.persistent.auto._Artist
    > [javac] writeProperty("nume", nume);
    > [javac] ^
    > [javac]
    > C:\Users\abc\wCayenne\tutorial\src\main\java\org\example\cayenne\persistent\auto\_Artist.java:29:
    > cannot find symbol
    > [javac] symbol : method readProperty(java.lang.String)
    > [javac] location: class org.example.cayenne.persistent.auto._Artist
    > [javac] return (String)readProperty("nume");
    > [javac] ^
    > [javac]
    > C:\Users\abc\wCayenne\tutorial\src\main\java\org\example\cayenne\persistent\Main.java:10:
    > cannot find symbol
    > [javac] symbol : class ObjectContext
    > [javac] location: class org.example.cayenne.persistent.Main
    > [javac] ObjectContext context = DataContext.createDataContext();
    > [javac] ^
    > [javac]
    > C:\Users\abc\wCayenne\tutorial\src\main\java\org\example\cayenne\persistent\Main.java:10:
    > cannot find symbol
    > [javac] symbol : variable DataContext
    > [javac] location: class org.example.cayenne.persistent.Main
    > [javac] ObjectContext context = DataContext.createDataContext();
    > [javac] ^
    > [javac] 12 errors
    >
    > BUILD FAILED
    > C:\Users\abc\wCayenne\tutorial\build.xml:82: Compile failed; see the
    > compiler error output for details.
    >
    > Total time: 1 second
    >
    > --
    > View this message in context: http://cayenne.195.n3.nabble.com/cayenne-ANT-package-org-apache-cayenne-does-not-exist-tp1447117p1447117.html
    > Sent from the Cayenne - User mailing list archive at Nabble.com.
    >



    This archive was generated by hypermail 2.0.0 : Mon Sep 13 2010 - 20:39:08 UTC