글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
Cannot load JDBC driver class 'org.mysql.jdbc.Driver'
이런 오류가 나는데,
HTTP Status 500 – Internal Server Error
Type Exception Report
Message Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.mysql.jdbc.Driver'
### The error may exist in org/example/repository/UserMapper.java (best guess)
### The error may involve org.example.repository.UserMapper.selectAll
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.mysql.jdbc.Driver'
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
...[생략]...
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.mysql.jdbc.Driver'
### The error may exist in org/example/repository/UserMapper.java (best guess)
### The error may involve org.example.repository.UserMapper.selectAll
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.mysql.jdbc.Driver'
org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75)
...[생략]...
javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.mysql.jdbc.Driver'
### The error may exist in org/example/repository/UserMapper.java (best guess)
### The error may involve org.example.repository.UserMapper.selectAll
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.mysql.jdbc.Driver'
org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)
...[생략]...
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause
org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.mysql.jdbc.Driver'
org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:82)
...[생략]...
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause
org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.mysql.jdbc.Driver'
org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1429)
...[생략]...
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause
java.lang.ClassNotFoundException: org.mysql.jdbc.Driver
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1372)
...[생략]...
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Note The full stack trace of the root cause is available in the server logs.
도대체 내가 본 예제 코드는 왜?
<property name="driverClassName" value="org.mysql.jdbc.Driver" />
org.mysql.jdbc.Driver라는 드라이버를 사용한 걸까요? ^^; 이것을 해결하려면
지난번처럼 "com.mysql.cj.jdbc.Driver"로 바꿔야 합니다.
<property name="driverClassName" value="com.mysql.cj.jdbc.Driver" />
[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]
... 76 77 78 79 80 81 82 [83] 84 85 86 87 88 89 90 ...
No | Writer | Date | Cnt. | Title | File(s) |
11892 | 정성태 | 5/10/2019 | 20405 | 웹: 38. HTTP Cookie의 expires 시간 형식(RFC7231) | |
11891 | 정성태 | 5/9/2019 | 23499 | .NET Framework: 831. (번역글) .NET Internals Cookbook Part 12 - Memory structure, attributes, handles | |
11890 | 정성태 | 5/8/2019 | 19128 | 개발 환경 구성: 439. "Visual Studio Enterprise is required to execute the test." 메시지와 관련된 코드 기록 | |
11889 | 정성태 | 5/8/2019 | 19235 | 개발 환경 구성: 438. mstest, QTAgent의 로그 파일 설정 방법 | |
11888 | 정성태 | 5/8/2019 | 37110 | .NET Framework: 830. C# - 비동기 호출을 취소하는 CancellationToken의 간단한 예제 코드 [1] | 1 |
11887 | 정성태 | 5/8/2019 | 22962 | .NET Framework: 829. C# - yield 문을 사용할 수 있는 메서드의 조건 | |
11886 | 정성태 | 5/7/2019 | 20038 | 오류 유형: 534. mstest.exe 실행 시 "Visual Studio Enterprise is required to execute the test." 오류 [2] | |
11885 | 정성태 | 5/7/2019 | 17493 | 오류 유형: 533. mstest.exe 실행 시 "File extension specified '.loadtest' is not a valid test extension." 오류 발생 | |
11884 | 정성태 | 5/5/2019 | 22405 | .NET Framework: 828. C# DLL에서 Win32 C/C++처럼 dllexport 함수를 제공하는 방법 - 두 번째 이야기 | |
11883 | 정성태 | 5/3/2019 | 27410 | .NET Framework: 827. C# - 인터넷 시간 서버로부터 받은 시간을 윈도우에 적용하는 방법 | 1 |
11882 | 정성태 | 5/2/2019 | 23875 | .NET Framework: 826. (번역글) .NET Internals Cookbook Part 11 - Various C# riddles | 1 |
11881 | 정성태 | 4/28/2019 | 23969 | 오류 유형: 532. .NET Core 프로젝트로 마이그레이션 시 "CS0579 Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute" 오류 발생 | |
11880 | 정성태 | 4/25/2019 | 19693 | 오류 유형: 531. 이벤트 로그 오류 - Task Scheduling Error: m->NextScheduledSPRetry 1547, m->NextScheduledEvent 1547 | |
11879 | 정성태 | 4/24/2019 | 28585 | .NET Framework: 825. (번역글) .NET Internals Cookbook Part 10 - Threads, Tasks, asynchronous code and others | 2 |
11878 | 정성태 | 4/22/2019 | 23918 | .NET Framework: 824. (번역글) .NET Internals Cookbook Part 9 - Finalizers, queues, card tables and other GC stuff | 1 |
11877 | 정성태 | 4/22/2019 | 24110 | .NET Framework: 823. (번역글) .NET Internals Cookbook Part 8 - C# gotchas | 1 |
11876 | 정성태 | 4/21/2019 | 22405 | .NET Framework: 822. (번역글) .NET Internals Cookbook Part 7 - Word tearing, locking and others | 1 |
11875 | 정성태 | 4/21/2019 | 24188 | 오류 유형: 530. Visual Studo에서 .NET Core 프로젝트를 열 때 "One or more errors occurred." 오류 발생 | |
11874 | 정성태 | 4/20/2019 | 24205 | .NET Framework: 821. (번역글) .NET Internals Cookbook Part 6 - Object internals | 1 |
11873 | 정성태 | 4/19/2019 | 22902 | .NET Framework: 820. (번역글) .NET Internals Cookbook Part 5 - Methods, parameters, modifiers | 1 |
11872 | 정성태 | 4/17/2019 | 23712 | .NET Framework: 819. (번역글) .NET Internals Cookbook Part 4 - Type members | 1 |
11871 | 정성태 | 4/16/2019 | 21657 | .NET Framework: 818. (번역글) .NET Internals Cookbook Part 3 - Initialization tricks [3] | 1 |
11870 | 정성태 | 4/16/2019 | 20553 | .NET Framework: 817. Process.Start로 실행한 콘솔 프로그램의 출력 결과를 얻는 방법 | 1 |
11869 | 정성태 | 4/15/2019 | 26874 | .NET Framework: 816. (번역글) .NET Internals Cookbook Part 2 - GC-related things [2] | 2 |
11868 | 정성태 | 4/15/2019 | 22395 | .NET Framework: 815. CER(Constrained Execution Region)이란? | 1 |
11867 | 정성태 | 4/15/2019 | 21552 | .NET Framework: 814. Critical Finalizer와 SafeHandle의 사용 의미 | 1 |
... 76 77 78 79 80 81 82 [83] 84 85 86 87 88 89 90 ...