0
votes

I am building a Project from github. When I build the project on eclipse.

After configuration with my database I get this error.

Error creating bean with name 'org.springframework.jdbc.core.JdbcTemplate#0' defined in ServletContext resource [/WEB-INF/application-context.xml]: Cannot create inner bean 'com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolData Source#82d210' of type [com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource] while setting bean property 'dataSource';
nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.mysql.jdbc. jdbc2.optional.MysqlConnectionPoolDataSource] for bean with name 'com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolData Source#82d210' defined in ServletContext resource [/WEB-INF/application-context.xml];
nested exception is java.lang. ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean (BeanDefinitionValueResolver.java:282)

Please help me to solve this issue.

1
Your pom.xml contains MySql connector, the error should not occur. How are you running in eclipse? - pmverma
Well it is there but with scope provided... Hence it isn't on the class path when running the application as it should be already there because, well provided. - M. Deinum
i am imported the maven project and configured the application context and context.xml. then run maven clean. then run on server. Thank you. it was the my sql connector issue. I added com.mysql.jdbc_5.1.5.jar dependency in the pom. now the issue is resolved. Thank you - Ansar Latif

1 Answers

0
votes

You are missing a jar. Please include this jar in your classpath: com.mysql.jdbc_5.1.5.jar