Steve,

 

I had a similar problem. Try deleting airline-prefs.properties, in samples/src before going running middlegen again. That should help.

 


Y.

 

-----Original Message-----
From: Steve [mailto:[EMAIL PROTECTED]
Sent:
Tuesday, March 11, 2003 1:41 PM
To:
[EMAIL PROTECTED]
Subject: [Middlegen-user] Sample App on Jboss 3.0 and MySQL

 

Hello all:

 

I have seen my question posted earlier in the archive, but I cannot seem to resolve this issue.

 

Following the excellent instructions on the website, I setup middlegen to use mysql on my local machine. I also created a build.properties pointing jboss.home to my jboss 3.0 directory. jboss 3.0 has been configured to use mysql as its default datasource.

 

From the samples folder, I run ant create-tables. Build Successful.

I run ant hsqldb-gui. I connect to database airlines on my mysql server. 3 tables with persons populated.

I run ant.

    There is a warning suggesting I set fkcmp to false (as suggested in the mail archives)

    Ignoring this fkcmp suggestion, I press Generate.

    When generate un-greys, I close the gui tool.

    There is much activity as xdoclets runs...Build successful

    Try to deploy the airlines.ear...I get documented "SQL Error Duplicate Column name."

 

So...

    I go back to the build.xml, set fkcmp="false"

    run ant. There are several warnings as follows:

 

[middlegen] (entitybean.CMP20Plugin              ?   ) WARNING: When fkcmp="fals
e", you will not be able to use compound primary keys where some of the columns
are also foreign keys. This is because all columns of a primary key must be CMP
fields. See EJB 2.0. spec section 10.8.2
[middlegen] No <table> elements specified. Reading all tables. This might take a
 while...
[middlegen] (entitybean.Server                   ?   ) WARNING (cmp20): The tabl
e reservations has a primary key where the following columns also are foreign ke
ys: person_id_fk,flight_id_fk. Having set fkcmp="false" this will most likely ca
use problems at run time because those columns will not be persisted, and theref
ore new instances will not set the key fields that correspond to foreign keys. T
he database might choke on this.
[middlegen] (entitybean.Server                   ?   ) WARNING (cmp20): The tabl
e reservations has a primary key where the following columns also are foreign ke
ys: person_id_fk,flight_id_fk. Having set fkcmp="false" this will most likely ca
use problems at run time because those columns will not be persisted, and theref
ore new instances will not set the key fields that correspond to foreign keys. T
he database might choke on this.
[middlegen] (entitybean.Entity20Column           ?   ) WARNING: The cmp20 is con
figured with readonly="true", but the prefs settings for the column reservations
.flight_id_fk indicates that a local setter for this column should be generated.
 Middlegen will use the prefs setting, so the generated airline.interfaces.Reser
vationLocal's setFlightIdFk method will exist, causing the bean NOT to be read o
nly.
[middlegen] (entitybean.Entity20Column           ?   ) WARNING: The cmp20 is con

figured with readonly="true", but the prefs settings for the column reservations
.reservation_id indicates that a local setter for this column should be generate
d. Middlegen will use the prefs setting, so the generated airline.interfaces.Res
ervationLocal's setReservationId method will exist, causing the bean NOT to be r
ead only.
[middlegen] (entitybean.Entity20Column           ?   ) WARNING: The cmp20 is con
figured with readonly="true", but the prefs settings for the column reservations
.person_id_fk indicates that a local setter for this column should be generated.
 Middlegen will use the prefs setting, so the generated airline.interfaces.Reser
vationLocal's setPersonIdFk method will exist, causing the bean NOT to be read o
nly.
[middlegen] ********************************************************
[middlegen] * CTRL-Click relations to modify their cardinality     *
[middlegen] * SHIFT-Click relations to modify their directionality *
[middlegen] ********************************************************

 

    Again press generate.

 

Now I get Build FAILURE with the following javac errors:

 

compile-web:
    [javac] Compiling 28 source files to C:\DEVELO~1\MIDDLE~1\samples\build\clas
ses
    [javac] C:\DEVELO~1\MIDDLE~1\samples\build\gen-src\airline\web\struts\Delete
ReservationAction.java:62: cannot resolve symbol
    [javac] symbol  : constructor ReservationPK (java.lang.Integer,java.lang.Int
eger,java.lang.Integer)
    [javac] location: class airline.interfaces.ReservationPK
    [javac]       airline.interfaces.ReservationPK reservation_PK = new airline.
interfaces.ReservationPK(reservationId, personIdFk, flightIdFk);
    [javac]                                                         ^
    [javac] C:\DEVELO~1\MIDDLE~1\samples\build\gen-src\airline\web\struts\EditRe
servationAction.java:65: cannot resolve symbol
    [javac] symbol  : constructor ReservationPK (java.lang.Integer,java.lang.Int
eger,java.lang.Integer)
    [javac] location: class airline.interfaces.ReservationPK
    [javac]       airline.interfaces.ReservationPK reservation_PK = new airline.
interfaces.ReservationPK(reservationId, personIdFk, flightIdFk);
    [javac]                                                         ^
    [javac] C:\DEVELO~1\MIDDLE~1\samples\build\gen-src\airline\web\struts\Reserv
ationForm.java:156: cannot resolve symbol
    [javac] symbol  : method getPersonIdFk ()
    [javac] location: interface airline.interfaces.ReservationLocal
    [javac]       setPersonIdFk(reservation.getPersonIdFk());
    [javac]                                ^

...and so on...

 

I have tried "ant clean" between steps, even re-downloading from cvs (today:2003-03-11).

 

Did I miss something in the instructions or the mail archive? Either I cannot deploy or I cannot compile. Any direction would be very much appreciated.

 

Steve

Reply via email to