가넷
10
2019-11-09 01:33:28
1
107

mssql과 jsp 연결이 안 돼요



org.apache.jasper.JasperException: 행 [53]에서 [/mobilejsp/jsp/10/mobile1/join.jsp]을(를) 처리하는 중 예외 발생

50: 			<%
51: 			// DB Open: MS SQL Server
52: 			// JDBC Driver 로딩
53: 			Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
54: 			// DB Open 
55: 			conn = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databasename=myDB;user=jsp;password=1234;"); 
56: 			%>   	


javax.servlet.ServletException: java.lang.UnsupportedClassVersionError: com/microsoft/sqlserver/jdbc/SQLServerDriver has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:909)
	org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:838)
	org.apache.jsp.mobilejsp.jsp._10.mobile1.join_jsp._jspService(join_jsp.java:296)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)


근본 원인 (root cause)


java.lang.UnsupportedClassVersionError: com/microsoft/sqlserver/jdbc/SQLServerDriver has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	java.lang.ClassLoader.defineClass1(Native Method)
	java.lang.ClassLoader.defineClass(Unknown Source)
	java.security.SecureClassLoader.defineClass(Unknown Source)
	java.net.URLClassLoader.defineClass(Unknown Source)
	java.net.URLClassLoader.access$100(Unknown Source)
	java.net.URLClassLoader$1.run(Unknown Source)
	java.net.URLClassLoader$1.run(Unknown Source)
	java.security.AccessController.doPrivileged(Native Method)
	java.net.URLClassLoader.findClass(Unknown Source)
	java.lang.ClassLoader.loadClass(Unknown Source)
	java.lang.ClassLoader.loadClass(Unknown Source)
	org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1279)
	org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1182)
	org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:122)
	org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:59)
	java.lang.Class.forName0(Native Method)
	java.lang.Class.forName(Unknown Source)
	org.apache.jsp.mobilejsp.jsp._10.mobile1.join_jsp._jspService(join_jsp.java:185)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)


근본 원인 (root cause)


Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); 이부분이 오류가 나서 java버전 8까지 다시 깔았는데 무슨 문제일까요.... JDBC Driver6.0깔고 sql41.jar도 잘 넣었고 microsoft sql 2016버전 없어서 2017버전 깔았는 데 ㅠㅠㅠ 뭐가 문제일까요?


0
0
  • 답변 1

  • 훈마로
    378
    2019-11-09 01:52:04


    java.lang.UnsupportedClassVersionError: com/microsoft/sqlserver/jdbc/SQLServerDriver has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0이
    이 부분이 주요 원인이네요

    사용하신 sqldriver가 자바 11 이상만 지원 가능합니다.

    1
  • 로그인을 하시면 답변을 등록할 수 있습니다.