On 04/06/20 9:59, "Thomas Dudziak" <[EMAIL PROTECTED]> wrote:
> Pedro Salgado wrote: > >> Another problem: >> The classpath element should include all of the libs required to run >> xdoclet (not only the xdoclet*.jar, but also xjavadoc and the dependencies >> like commons-collections, etc)... Since I donąt really know the dependencies >> it is better to include all stuff on the ojb/lib directory. >> >> <path id="classpath.ojb"> >> <fileset dir="${tool.ojb}/lib"> >> <include name="**/*.jar"/> >> </fileset> >> </path> In the documentation: <path id="build-classpath"> <fileset dir="lib/xdoclet"><!-- HERE --> <include name="**/*.jar"/> </fileset> </path> > > Yes, but it does so in every build file in OJB ?! That's the common way > to specify the classpath with Ant. > >> The rest well... Your property file seems to have made wonders but... I >> think it bypassed the problems (this good... in a way). >> Still: >> >> - the database name that I insert on your cvs build.properties must exist >> because otherwise I get a SQLException on executing the target create-db, >> - the SQLException is also thrown if I donąt use the cvs build.properties >> (see below), >> - I needed to add torque.schema.dir and torque.sql.dir (schemaDir and >> outputDirectory didnąt work... ) to the torque ant calls. >> - Torque is using the driver and database connection settings that are >> specified on the mysql.profile that, of course are different from the ones I >> specified on the cvs build.properties. Question: why are these cvs >> build.properties settings: >> >> dbmsName=MySQL >> jdbcLevel=3.0 >> jdbcRuntimeDriver=com.mysql.jdbc.Driver >> urlProtocol=jdbc >> urlSubprotocol=mysql >> urlDbalias=//localhost/${databaseName} >> >> doing?). >> It seems that I need to setup my database settings on the mysql.profile >> (correct me if I am wrong). > > You're essentially mixing up two different things here. The two files > that I pointed you to, are the build files of the ojb-blank project > which is a skeleton project for users to get started with OJB. As such > this project only requires the configuration for one database which is > quite different from OJB whose unit tests shall run under every > supported database. Therefore, the build script for the ojb-blank > project only needs build.properties which contains among other stuff the > database settings. The OJB build file on the other hand also requires > profiles for the individual databases, and its build.properties file > only references the profile to use but otherwise doesn't contain any > database settings. My advise is that you're better off with the > ojb-blank build files as a starting point because most of the stuff in > OJB's build files shouldn't be relevant for you. > > The other problem that the setup-db target (in the ojb-blank build > script) solves, is that the Torque settings are not used by OJB, so we > have to setup the environment for Torque before using its build file to > create the database etc. This is essentially what the setup-db task > does. However, as I can see from your build file, you used the old stuff > from the XDoclet docs (which I changed in CVS) but not the changed stuff > from the ojb-blank build script (setup-db target). You should use the > latter because Torque now requires some more settings that we have to > supply prior to calling any targets in the Torque build file. > > >> There is no problem with this... I just wonder what does the cvs >> properties sets up after all? If I removed them then the following exception >> appears: >> >> Target create-db >> Task torque-data-model >> Task echo >> Task sql >> build-torque.xml:321: java.sql.SQLException: General error, message from >> server: "Unknown database 'ojb'" >> >> This shouldn't appear because: >> 1- I am not using a database yet... I want to create the required database >> if it doesnąt exist >> 2- anyway, the database name should come from the schema file > > In the ojb-blank file, you define the database name in the > build.properties file, and the build script will setup both the jdbc > connection descriptor and the schema file (via the xdoclet target) with > the correct name. > >> 3- I don't have an ojb value for any of the properties I set (not on my >> build.xml, not on my cvs build.properties, not even on the mysql.profile) >> where does this "ojb" come from? >> >> >> Below is my working build.xml file. >> It is still missing the repository.xml and repository_database.xml >> generation. > > Please use the ojb-blank build files as the basis for your project, not > OJB's build files. This will make it a lot easier for you. I didn't realize there was a project-blank to startup with :(. Sorry for the wasted time. Thank you Tom, Pedro Salgado --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]