This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
dev build 200409091800 I've placed the MySQL driver under C:\Program Files\netbeans-4.0dev\nb4.0\jakarta-tomcat-5.0.28\common\lib and I refer to MySQL as a datastore in my webapp configuration file (web/meta-inf/context.xml) but at runtime, I get the following exception from the tomcat server: Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:766) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59) at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:278) ... 36 more Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:854) at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:721) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:760) ... 39 more This used to work a few revision ago in Netbeans and I have double checked my configuration and this should be working. How does one get MySQL to work as a datastore under the integrated Tomcat server? This works fine in a standalone Tomcat server I've got installed.
Ok, this turned out to be a particularily evil bug in my code using Hibernate. Sorry for yet another bad bug report :( Before we close this issue though, can you please clarify if there is a way to include the MySQL driver in a webapp-specific manner under Netbeans instead of copying it into the common/lib directory?
Gili, when running the standalone Tomcat, do you run it using the catalina.bat script or the catalina.50.bat ? Thanks.
Sorry, I didn't readl last Gili's comment, disregard my previous comment. Stepan, can you please verify what Gili is asking about?
Closing as invalid. You can add the mysql driver to your web application using the "project properties/compiling sources" dialog. This will put your driver under the WEB-INF\lib directory of your web application.
Sherold, That won't work. Specifically, every time I place MySQL drivers in web-inf/lib and try creating the datastore from within my webapp XML configuration for Tomcat, it complains about not finding the driver. If I place it in tomcat/common/lib it works. Gili
I'm sorry, I was wrong. According to Tomcat's documentation is putting the driver into the $CATALINA_HOME/common/lib directory the only option.
Sherold, Thank you, now we know for sure. This does, however, bring up the issue that users now have to dump JARs into the c:/program files/netbeans-4.0/ directory. Is there a way to ameliorate the problem?
Currently not. Feel free, however, to file an enhancement that IDE should provide a support for this to easy this procedure.
Gili and Stepan, maybe you want something like enhancement 49346 ?
Yes, this might be a solution.