Kind of guessing here, but since the error is looking for a class in a path that is a directory, it could be that ant isn't picking up the classname attribute of the java task properly.
jim On Tue, Nov 27, 2001 at 09:55:30AM +0100, Nigel Parker wrote: > > Thanks for your reply, Jim. > > In reply to your question, I am running the application via the <java> task. > I tried doing what you suggested and ran with fork=true. But for some reason > the application wont run this way. It gives me always: > > java.lang.NoClassDefFoundError: D:\Song\cwf\classes > Exception in thread "main" > > D:\Song\cwf\classes is the root directory of the application. This happens > already the first time I run the application. So it does sound as if class > loading is the area to investigate further. > > Nigel > > > > -----Opprinnelig melding----- > Fra: Doyle, Jim [mailto:[EMAIL PROTECTED]] > Sendt: 26. november 2001 22:10 > Til: Nigel Parker > Emne: RE: Cant access JDBC driver twice in same Ant run > > > Given that the driver lookup is based on the availability of drivers in > the classpath, and occasionally Ant has interesting class loading conflicts, > perhaps it's a class loading issue? You're running your application with > the "<java>" task, correct? The first thing I would try is to run it with > "<java fork="yes">", so that your application is run in an entirely separate > process. > > Jim > > > -----Original Message----- > > From: Nigel Parker [mailto:[EMAIL PROTECTED]] > > Sent: Sunday, November 25, 2001 4:38 PM > > To: [EMAIL PROTECTED] > > Subject: Cant access JDBC driver twice in same Ant run > > > > > > > > I have recently converted the administration of my Java JDBC > > application to > > Ant, and am very pleased with the new flexibility it gives > > me. One of the > > reasons for doing the conversion was to automate regression > > tests. I have > > however hit on the following problem which eludes all my > > attempts to get > > round: > > > > When I run the application once in a single <target> > > everything works fine. > > When I run the application twice in dependent targets, the second time > > always fails with: > > > > java.sql.SQLException: No suitable driver > > at java.sql.DriverManager.getConnection > > > > Ive tried all combinations for loading the driver I can think > > of, like: > > > > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") > > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance() > > java.sql.DriverManager.deregisterDriver() > > java.sql.DriverManager.registerDriver() > > > > I tried inserting the driver name as a system property: <sysproperty > > key="jdbc.drivers" value="sun.jdbc.odbc.JdbcOdbcDriver"/> > > > > I tried also > > java.sql.DriverManager.getDriver("jdbc:odbc:SongFase2") just > > before my call to getConnection with an identical URL. The > > correct driver is > > returned so it must be there, but getConnection() in the > > second application > > run still gives me the above exception. > > > > Can someone help me and tell me what am I doing wrong? > > > > thanks > > Nigel Parker > > > > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
