Use mm.mysql-2.0.8-bin.jar (in this time window) If I have mm.mysql-2.0.4-bin.jar in my classpath I get the ouput from the mapping file and then :-
[test] SQL for loading myapp.Category: SELECT category.name FROM category WHERE category.id=? [test] Begin transaction [test] Product Id [test] SELECT prod.id,prod.name,prod.price,prod.group_id,prod_detail.id FROM pro d LEFT OUTER JOIN prod_detail ON prod.id=prod_detail.prod_id WHERE (prod.id = ?) [test] org.exolab.castor.jdo.PersistenceException: Nested error: org.gjt.mm.mysq l.jdbc2.NotImplemented [test] org.gjt.mm.mysql.jdbc2.NotImplemented [test] at org.gjt.mm.mysql.jdbc2.ResultSet.getBigDecimal(ResultSet.java:198) [test] at org.exolab.castor.jdo.engine.SQLTypes.getObject(SQLTypes.java:319) [test] at org.exolab.castor.jdo.engine.SQLEngine$SQLQuery.loadSingleField(SQLEn gine.java:1708) [test] at org.exolab.castor.jdo.engine.SQLEngine$SQLQuery.loadRow(SQLEngine.jav a:1774) [test] at org.exolab.castor.jdo.engine.SQLEngine$SQLQuery.fetchRaw(SQLEngine.ja va:1847) [test] at org.exolab.castor.jdo.engine.SQLEngine$SQLQuery.nextIdentity(SQLEngin e.java:1655) [test] at org.exolab.castor.persist.QueryResults.nextIdentity(QueryResults.java :173) [test] at org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQ ueryImpl.java:571) [test] at org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQ ueryImpl.java:557) [test] at jdo.Test.run(Test.java:101) [test] at jdo.Test.main(Test.java:54) *************************** If I put mm.mysql-2.0.6.1.jar in my class path I get:- E:\Castor\castor-0.9.3.9\examples>java jdo.Test [test] Loading mapping descriptors from file:/E:/Castor/castor-0.9.3.9/examples/ jdo/mapping.xml [test] org.exolab.castor.jdo.DatabaseNotFoundException: Nested error: java.lang. ClassNotFoundException: org.gjt.mm.mysql.jdbc2.optional.MysqlDataSource [test] java.lang.ClassNotFoundException: org.gjt.mm.mysql.jdbc2.optional.MysqlDa taSource [test] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) [test] at java.security.AccessController.doPrivileged(Native Method) [test] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) [test] at java.lang.ClassLoader.loadClass(ClassLoader.java:297) [test] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286) [test] at java.lang.ClassLoader.loadClass(ClassLoader.java:253) [test] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313) [test] at java.lang.Class.forName0(Native Method) [test] at java.lang.Class.forName(Class.java:120) [test] at org.exolab.castor.jdo.engine.DatabaseRegistry.loadDatabase(DatabaseRe gistry.java:275) [test] at org.exolab.castor.jdo.JDO.getDatabase(JDO.java:559) [test] at jdo.Test.run(Test.java:90) [test] at jdo.Test.main(Test.java:54) If I place mm.mysql-2.0.8-bin.jar in my class then, remarkably, everything works!! Next, pooling!! Well, this one has kept me up to 5 a.m. If I don't ask a question I may record a comment that someone else finds useful. For the record database.xml is :- <database name="test" engine="mysql" > <driver url="jdbc:mysql://localhost/test" class-name="org.gjt.mm.mysql.Driver"> <param name="user" value="dba" /> <param name="password" value="***" /> </driver> <mapping href="mapping.xml" /> </database> -----Original Message----- From: Brad Cox [mailto:[EMAIL PROTECTED]] Sent: 19 February 2002 01:40 To: [EMAIL PROTECTED] Subject: Re: [castor-dev] Problems getting oriented... Thanks. Getting closer but not quite there. Exactly did you put in your src/examples/jdo/database.xml to get it to work? I guessed it wanted the jdbc driver class but that's apparently not it. PS: Might I suggest adding a readme with the instructions you sent me? <!DOCTYPE databases PUBLIC "-//EXOLAB/Castor JDO Configuration DTD Version 1.0//EN" "http://castor.exolab.org/jdo-conf.dtd"> <database name="test" engine="mysql" > <data-source class-name="org.gjt.mm.mysql.Driver"> <params user="xxxx" password="xxxxx" port-number="3306" server-name="localhost" /> </data-source> <mapping href="mapping.xml" /> </database> [bcox@linux:/usr/local/castor-0.9.3.9]$ example.sh jdo [test] Loading mapping descriptors from file:/usr/local/castor-0.9.3.9/build/examples/jdo/mapping.xml java.lang.IllegalStateException: Data source class name does not extend javax.sql.DataSource [test] org.exolab.castor.jdo.DatabaseNotFoundException: Nested error: java.lang.IllegalStateException: Data source class name does not extend javax.sql.DataSource{file: file:/usr/local/castor-0.9.3.9/build/examples/jdo/database.xml; line: 10; column: 5} [test] java.lang.IllegalStateException: Data source class name does not extend javax.sql.DataSource [test] at org.exolab.castor.jdo.conf.DataSource.createParams(DataSource.java:131) [test] at org.exolab.castor.jdo.conf.DataSourceDescriptor$2.newInstance(DataSourceDesc riptor.java:130) [test] at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:10 23) [test] at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1340) [test] at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidat or.java:1197) [test] at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanne r.java:1862) [test] at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM LDocumentScanner.java:1238) [test] at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner. java:381) [test] at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1035) [test] at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:338) [test] at org.exolab.castor.jdo.engine.DatabaseRegistry.loadDatabase(DatabaseRegistry. java:241) [test] at org.exolab.castor.jdo.JDO.getDatabase(JDO.java:559) [test] at jdo.Test.run(Test.java:98) [test] at jdo.Test.main(Test.java:62) At 5:46 PM -0700 2/18/02, Bruce Snyder wrote: >This one time, at band camp, Brad Cox said: > >BC>No, belay that. Tests work but examples still don't. >BC> >BC>I've tried >BC> sh build.sh all >BC> sh build.sh tests >BC> sh build.sh examples >BC> >BC> sh text.sh xml # this works >BC> sh examples.sh # this doesn't; xml/Test not found >BC> >BC>Might have small typos in the above; I'm typing this from memory from >BC>my other machine. > >Brad, > >I'm not exactly sure what's going on in your situation, but I just >got everything working in about 10 minutes time. Here are the steps >I took to run the examples using MySQL: > >1) wget ftp://ftp.exolab.org/pub/castor/castor_0.9.3.9/castor-0.9.3.9-src.tgz > (The other alternative is to get the source from the CVS tree. > See http://castor.exolab.org/cvs.html) > >2) tar zxvf ./castor-0.9.3.9-src.tgz >3) cd castor-0.9.3.9 >4) chmod +x ./*.sh >5) for i in ./*.sh; do dos2unix $i $i; done >6) echo $JAVA_HOME (just to be sure it's properly set) >7) edit src/examples/jdo/database.xml appropriately >8) create database tables using src/examples/jdo/create.sql >9) ./build.sh examples (builds everything because of dependencies in >the build descriptor) >10) add mm.mysql-2.0.8-bin.jar to the CLASSPATH >11) ./example.sh jdo > >I hope this helps. > >Bruce >-- > >perl -e 'print >unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");' > >----------------------------------------------------------- >If you wish to unsubscribe from this mailing, send mail to >[EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev -- Brad Cox, PhD; [EMAIL PROTECTED] 703 361 4751 o For industrial age goods there were checks and credit cards. For everything else there is http://virtualschool.edu/mybank o Java Interactive Learning Environment http://virtualschool.edu/jile o Java Web Application Architecture: http://virtualschool.edu/jwaa ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
