首页 > 代码库 > Unsupported major.minor version

Unsupported major.minor version

Caused by: java.lang.UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupported major.minor version 52.0 (unable to load class com.mysql.jdbc.Driver)

at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2544)

at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:858)

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1301)

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1166)

at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:559)

at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:642)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1711)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1650)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579)

... 21 more



原因:  JDK版本跟数据库驱动的版本不对应   我的JDK是1.7.0_79的  数据库驱动是最新的6.0版本

            导致出现该问题

            把驱动的版本降低就可以了 换成6.0.2版本以下的就可以了 经测试过5.1.40版本都可以的

            可以自己看下数据驱动包的版本信息 

            http://mvnrepository.com/artifact/mysql/mysql-connector-java


Unsupported major.minor version