Hi everybody
I have a BIG problem with my
ANT buildfile. I'm trying to run a simple
Test to connect to my app's database, but after it succesfully COMPILES and JARS itself, when it gets to EXECUTE I get the following message:
[
java] org.dotcom.contab.proceso.DAOException: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
[java] at org.dotcom.contab.proceso.impl.MySQLDAOFactory.<init>(Unknown Source)
[java] at org.dotcom.contab.proceso.DAOFactory.getDAOFactory(Unknown Source)
[java] at org.dotcom.contab.salida.Main.main(Unknown Source)
[java] Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
[java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
[java] at java.lang.Class.forName0(Native Method)
[java] at java.lang.Class.forName(Class.java:164)
[java] at org.dotcom.contab.proceso.impl.MySQLDAOFactory.loadDriver(Unknown Source)
I know I probably have a problem with the CLASSPATH, since I'm running the app directly from the jar archive: here's the code:
I'm really really stuck, I've tried a bunch of things and I don't know what to do anymore. I read somewhere that when running a program from the jar it ignores user classpath settings, is it true??? I NEED to run it from the jar since it's one of the projects requirements...
PLEASE HELP!!!
Thanks in advance
Hector