Re: +1 outdated info?
Pedro Salgado wrote: In the documentation: I'll change that. I didn't realize there was a project-blank to startup with :(. Sorry for the wasted time. No problem, that there is a ojb-blank has become clearer with the new documentation. Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: +1 outdated info?
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. >> >> >> >> >> >> In the documentation: > > 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]
Re: +1 outdated info?
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. 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 am reasonably acquainted with Torque (done severall repository and transfer object generations would minor settings/problems that I was able to solve by my own) and this Xdoclet approach is better but, this OJB-Torque integration still needs a whole lot of testing and documentation :(. Some of the Torque recently changed and the doc on the website is not yet up-to-date (as you correctly pointed out). However, the usage of Torque within OJB is limited and will likely be replaced with something more usable in the the near future (after the 1.0) because using Torque's build file is complicated. Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: +1 outdated info?
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. 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). 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 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. I am reasonably acquainted with Torque (done severall repository and transfer object generations would minor settings/problems that I was able to solve by my own) and this Xdoclet approach is better but, this OJB-Torque integration still needs a whole lot of testing and documentation :(. Thank you for your help and sorry for the long email, Pedro Salgado > > http://cvs.apache.org/viewcvs.cgi/db-ojb/src/ojb-blank/build.xml?rev=1.2&view= > markup > http://cvs.apache.org/viewcvs.cgi/db-ojb/src/ojb-blank/build.properties?rev=1. > 2&view=markup > > Tom > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: +1 outdated info?
[EMAIL PROTECTED] wrote: Thanks Tom but now I am having another problem :( When using this task I am receiving a " The 'project-sql' target is deprecated. Please use the 'sql' target instead. " Velocity continues anyway but after some instructions it gives me a: " build-torque.xml:214: Exception thrown by 'properties.load'. For more information consult the velocity log, or invoke ant with the -debug flag. " (the error is the same if I use the undeprecate sql target) The velocity report last logs 2004-06-18 16:00:27,459 - Velocimacro : initialization complete. 2004-06-18 16:00:27,459 - Velocity successfully started. 2004-06-18 16:00:27,912 - ResourceManager : found sql/base/Control.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader 2004-06-18 16:00:27,927 - Method load threw exception for reference $properties in template sql/base/Control.vm at [2,19] I have been looking for the sql/base/Control.vm and found it inside the Torque jar (this was different from the previous versions of Torque :( ) I think it is this line... #set ( $dbprops = $properties.load("sql/base/$targetDatabase/db.props") ) I checked the OJB documentation and I verified that these statements were on my build.xml. These were included... next I tried adding the properties directly to the target ... didn't work either Tried uncommenting the mysql.profile line on the build.properties and that didnt work either. I am really making an effort here to solve this one by my own but I am becoming out of ideas. Yesterday, I enhanced the ojb-blank build file with an xdoclet and torque target which you'll might find useful. You can view it here: http://cvs.apache.org/viewcvs.cgi/db-ojb/src/ojb-blank/build.xml?rev=1.2&view=markup http://cvs.apache.org/viewcvs.cgi/db-ojb/src/ojb-blank/build.properties?rev=1.2&view=markup Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]