Tomcat - java.lang.UnsupportedClassVersionError:Unsupported major.minor version 51.0 (unable to load class com.microsoft.sqlserver.jdbc.SQLS

來源:互聯網
上載者:User

標籤:

今天使用Tomcat串連sql Server 2008 enterprise的時候,報錯:

HTTP Status 500 - Servlet execution threw an exceptiontype Exception reportmessage Servlet execution threw an exceptiondescription The server encountered an internal error that prevented it from fulfilling this request.exceptionjavax.servlet.ServletException: Servlet execution threw an exceptionspt.servlet.filter.EncodingFilter.doFilter(EncodingFilter.java:24)root causejava.lang.UnsupportedClassVersionError: com/microsoft/sqlserver/jdbc/SQLServerDriver : Unsupported major.minor version 51.0 (unable to load class com.microsoft.sqlserver.jdbc.SQLServerDriver)org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2961)org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1210)org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1690)org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)java.lang.Class.forName0(Native Method)java.lang.Class.forName(Class.java:169)spt.server.jdbc.db.BasicDB.getConnection(BasicDB.java:260)spt.server.jdbc.db.BasicDB.getPreparedStatement(BasicDB.java:268)spt.server.jdbc.db.BasicDB.getAQIDayByCityCodeAndDate(BasicDB.java:136)spt.service.AQIDayService.getAQIDay(AQIDayService.java:33)spt.servlet.JsonServlet.doPost(JsonServlet.java:34)spt.servlet.JsonServlet.doGet(JsonServlet.java:53)javax.servlet.http.HttpServlet.service(HttpServlet.java:620)javax.servlet.http.HttpServlet.service(HttpServlet.java:727)spt.servlet.filter.EncodingFilter.doFilter(EncodingFilter.java:24)note The full stack trace of the root cause is available in the Apache Tomcat/7.0.57 logs.Apache Tomcat/7.0.57

 JDK的版本號碼對應:

J2SE 7 = 51 (0x33 hex),

J2SE 6.0 = 50 (0x32 hex),

J2SE 5.0 = 49 (0x31 hex),

JDK 1.4 = 48 (0x30 hex),

JDK 1.3 = 47 (0x2F hex),

JDK 1.2 = 46 (0x2E hex),

JDK 1.1 = 45 (0x2D hex).

由此可知,上述錯誤是由於jTDS需要jdk7,而你使用的JDK版本不是jdk7。

ref: http://shalousoft.com/go_newsForum.action?op=d3a91dac-6b7c-11e3-8e31-5254001578d1

Tomcat - java.lang.UnsupportedClassVersionError:Unsupported major.minor version 51.0 (unable to load class com.microsoft.sqlserver.jdbc.SQLS

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.