- This topic has 2 replies, 2 voices, and was last updated 13 years, 7 months ago by Kenneth Lancaster.
-
AuthorPosts
-
Kenneth LancasterMemberHi,
I created a Spring Crud Web Application using using the “Scaffold Spring Crud App” Wizard of ME4s 9.0a. The app created fine. I am generating the web app using the Spring MVC template option. I am using MySQL as the DB with the Connector J and JDBC. I am pretty sure its not the database or my version of the MySQL JDBC driver. Several tutorials I did that leverage reverse engineering with Hibernate capabilities worked fine and the DB explorer seems fully functional for me.
When I go to deploy it to the included/embedded Tomcat server in ME I get an error log entry indicating that the JDBC driver cannot be loaded. I did read several other post talking about needing to include the mysql jdbc lib in the web-inf folder. This is strange because in version 8.6.1 I had done the same tutorial and I don’ recall having to do anything special to have the JDBC driver and all dependent libraries available to the tomcat deployment. In my project I do not see the JDBC libraries being referenced. I could of sworn this worked before in ME4s 8.6.1 without “human intervention” 🙂
Did something change or is my memory reaching senior status. Thanks for any help.
5,355 WARN [ContainerBackgroundProcessor[StandardEngine[Catalina]]] SettingsFactory – Could not obtain connection to query metadata
org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class ‘com.mysql.jdbc.Driver’
cconwayMemberIf you’re using MySQL, then you always needed to add the driver jar file A second option is to add the driver jar to the lib folder inside the Tomcat installation. Once you add the connector to the Tomcat lib folder, it’s easy to forget about it. Then when you install a new Tomcat instance it’s not there and you start seeing these messages again. Not sure if that’s what happened, but I know I’ve done that myself.
Kenneth LancasterMemberNow I remember what I had done. I had encountered the problem and had added the MySQL Connector/J jar to the project build path. It seems MyEclipse’s deployment to Tomcat will look at all the dependent libraries in the project build path and deploy those also. So to recap, there are many options for development and testing.
1) As mentioned above by ME staff you can add the connector to the Tomcat lib folder. Where this is I have no idea. Someone chime in 🙂
2) You can add the Connector/J to the Embedded Tomcat Classpath. Navigate to Preferences->MyEclipse->Servers->Integrated Sandbox->MyEclipse Tomcat->Paths, and Add the MySQL Connector/J to the classpath. I guess prepend or append will work equally well.
3) Also you can adjust the project build path setting. Right Click on the web project->Properties->Java Build Path->Libraries Tab->Add External Jars Button, and add the MySQL Connector/J jar to your build path. The MyEclipse deployment utility by default also deploys any dependent libs specified in the build path.
Hope I got this right and it helps someone else. If I have erred please correct.
-
AuthorPosts