well well well. even more stupid queries dont help. more strangeness: from a jsp file: try { Class.forName("org.gjt.mm.mysql.Driver"); } catch(ClassNotFoundException ex){ out.println("JDBC-Treiber nicht gefunden! " + ex.getMessage()); }
try { Connection oConnection = DriverManager.getConnection("jdbc:mysql://localhost:3306/db_mobileform", "prj1358", "passwd"); ... works fine! same web-app in a class file (no servlet): try { Class.forName("org.gjt.mm.mysql.Driver"); } catch(ClassNotFoundException ex){ System.out.println("JDBC-Treiber nicht gefunden! " + ex.getMessage()); } try{ Connection oConnection; oConnection = DriverManager.getConnection("jdbc:mysql://localhost:3306/db_mobileform", "prj1358", "7650"); _conn = oConnection; throws a "java.sql.SQLException: No suitable driver" Exception. But the Driver is in the classpath (both $CLASSPATH and /tomcat4/common/lib). why can a jsp use the driver and a class in the same web-app cant??? thanks for any tips :) op -----Original Message----- From: "Gerlinde Fischer" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Date: Mon, 10 Mar 2003 09:41:46 +0100 Subject: AW: tomcat 4.1.18 on linux not loading mysql-driver for a connection-pool? Hi, I think the ";" in the query is wrong. Be sure that the query is excute and you get one row back. If you get no row back you have a problem. Regards Gerlinde > -----Ursprüngliche Nachricht----- > Von: ossipetz [mailto:[EMAIL PROTECTED] > Gesendet: Freitag, 7. März 2003 18:21 > An: [EMAIL PROTECTED] > Betreff: tomcat 4.1.18 on linux not loading mysql-driver for a > connection-pool? > > > greetings > > i am just the next beginner so be patient :-) > > i started with a small jsp/servlet application that connects to a mysql > database. the connection pool is configured in a context.xml. > running the app under windwos (xp) with tomcat 4.1.18 the thing > works fine! > > copying/installing the war file to tomcat 4.1.18 on a linux > machine it seems > as the mysql driver is not loaded. (exceptions all over) > > using the windows version and connectiong to the linux-database works! so > its not a mysql problem. > > in the /admin servlet the connection pool is present in the application > context. only the class-name (mysql driver) is surronded in a yellow box. > that means its a problem i guess? > > so after reading the > http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-ex amples-how to.html and other sites everything is supposed to work. but well mr linux doesnt want to agree! i attached context.xml and web.xml. in web.xml i had to comment the part out: <!-- <resource-ref> <description>MySQL Database for POST Parameters</description> <res-ref-name>jdbc/NokiaDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> --> for some org.xml.sax.SAXParseException: /// ContextListener.init(): here we go! :-) 07.03.2003 18:13:42 org.apache.commons.digester.Digester error SCHWERWIEGEND: Parse Error at line 27 column 11: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,fil ter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mappin g*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,se curity-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-loca l-ref*)". in ch.fhso.formgenerator.httpserver.ContextListener the database is initialized and closed. but as "resource-ref*" is a valid tag i dont get why. the lines come from the mentioned howto. i am using a ant-built script to install the .war file into tomcat. the version of JConnector is 3.06 but the version 2.x didnt show any difference. so if someone could come-up with a miracle :) i just dont see why the application runs under windows and not under linux (same .war file, same versions) HELP! thanks a lot! op --------------------------------------------------------------------- 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]