T-baby / MongoDB-Plugin

MongoDB Plugin for Java
Apache License 2.0
239 stars 102 forks source link

tomcat 启动报java.lang.UnsupportedClassVersionError #32

Closed zcqshine closed 7 years ago

zcqshine commented 7 years ago

严重: Exception starting filter jfinal java.lang.UnsupportedClassVersionError: com/cybermkd/mongo/plugin/MongoJFinalPlugin : Unsupported major.minor version 52.0 (unable to load class com.cybermkd.mongo.plugin.MongoJFinalPlugin)

tomcat 版本7.0.x jdk 版本1.7.0_80 mongoplugin 版本 1.0.8.0

jfinal里的配置 MongoJFinalPlugin jFinalPlugin = new MongoJFinalPlugin(); jFinalPlugin.add(PropKit.get("mongodb.host"), PropKit.getInt("mongodb.port")); jFinalPlugin.setDatabase(PropKit.get("mongodb.db")); jFinalPlugin.auth(PropKit.get("mongodb.user"), PropKit.get("mongodb.password")); jFinalPlugin.setDebug(true); plugins.add(jFinalPlugin);

完整错误信息 java.lang.UnsupportedClassVersionError: com/cybermkd/mongo/plugin/MongoJFinalPlugin : Unsupported major.minor version 52.0 (unable to load class com.cybermkd.mongo.plugin.MongoJFinalPlugin) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2963) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1212) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1692) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1573) at com.fxtcn.jfinal.GovLogSysConfig.configPlugin(GovLogSysConfig.java:42) at com.jfinal.core.Config.configJFinal(Config.java:53) at com.jfinal.core.JFinal.init(JFinal.java:63) at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49) at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4855) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5549) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1095) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1930) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)

zcqshine commented 7 years ago

已经找到问题所在了. mongodb plugin 的 jdk 版本最低要求为1.6, 而我编译的目标版本为1.5, 导致不支持.