본문 바로가기

정리 카테고리/토비s Spring Vol.1

Vol_1, 1.1, 59P

Vol_1

-1.1

-59p




-프로젝트 생성 후.

-예제와 같이 코드 작성.

-추가 설정 변경 없음. 





-Mysql 설정( 자세한 내용은 더보기에 )


-localhost 위에 포트 번호 사용

-maven 클린, maven 업데이트 프로젝트

-spring boot app 실행



-아래와 같은 오류 발생

Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:264)

at springbook.user.dao.UserDao.add(UserDao.java:13)

at springbook.user.StudybookApplication.main(StudybookApplication.java:22)




검색중 pom에 관한 정보( 자세한 내용은 더보기에 )


*JAVA MYSQL 연동시 발생 애러 해결 방법에 도움되는 링크  (2018년 작성)


*STS , Maven 환경 pom 필요 정보를 볼수 있는 링크







com.mysql.jdbc.Driver   --->     com.mysql.cj.jdbc.Driver 으로 수정


-spring boot app 실행

-아래와 같은 오류 발생

오류: 기본 클래스 springbook.user.dao.UserDao을(를) 찾거나 로드할 수 없습니다.








-mybatis와 mysql를  pom.xml 에 추가( 자세한 내용은 더보기에 )


-spring boot app 실행

-아래와 같은 오류 발생

Fri May 11 12:45:53 KST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

Exception in thread "main" java.sql.SQLException: The server time zone value '���ѹα� ǥ�ؽ�' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:545)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:513)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:505)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:479)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:489)

at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:69)

at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1606)

at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:633)

at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:347)

at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:219)

at java.sql.DriverManager.getConnection(DriverManager.java:664)

at java.sql.DriverManager.getConnection(DriverManager.java:247)

at springbook.user.dao.UserDao.add(UserDao.java:14)

at springbook.user.dao.UserDao.main(UserDao.java:53)

Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value '���ѹα� ǥ�ؽ�' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:54)

at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73)

at com.mysql.cj.jdbc.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:118)

at com.mysql.cj.mysqla.MysqlaSession.configureTimezone(MysqlaSession.java:293)

at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:2399)

at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:1739)

at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1596)

... 7 more




-오류 문구에  The server time zone value   있으므로 timezone 관련 검색

-상단에 찾은 링크중 타임존 관련 해결 방법이 있어 적용




-spring boot app 실행

-아래와 같은 오류 발생

Fri May 11 12:50:49 KST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

admin등록 성공Fri May 11 12:50:49 KST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

Exception in thread "main" java.sql.SQLException: The server time zone value '���ѹα� ǥ�ؽ�' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:545)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:513)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:505)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:479)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:489)

at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:69)

at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1606)

at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:633)

at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:347)

at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:219)

at java.sql.DriverManager.getConnection(DriverManager.java:664)

at java.sql.DriverManager.getConnection(DriverManager.java:247)

at springbook.user.dao.UserDao.get(UserDao.java:27)

at springbook.user.dao.UserDao.main(UserDao.java:57)

Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value '���ѹα� ǥ�ؽ�' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:54)

at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73)

at com.mysql.cj.jdbc.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:118)

at com.mysql.cj.mysqla.MysqlaSession.configureTimezone(MysqlaSession.java:293)

at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:2399)

at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:1739)

at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1596)

... 7 more



*(윈도우 + Mysql 5.7 타임존 설정 관련 링크)


-서버로 쓸 환경의 mysql의 버전과 다른 이유로 버전을 바꾸어 설치후 지금까지된 소스로 진행.



*버전 변경중 한번 보았던 오류 해결 링크



-mysql 5.6.40

*이때 mysql 부가적으로 설치한 것들

  (워크벤치 6.3.10    커넥터/c 6.1.11  유틸리티스 1.6.5  인스톨러 1.4)


-spring boot app 실행

-아래와 같은 오류 발생

admin등록 성공Exception in thread "main" java.sql.SQLException: The server time zone value '���ѹα� ǥ�ؽ�' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:545)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:513)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:505)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:479)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:489)

at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:69)

at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1606)

at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:633)

at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:347)

at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:219)

at java.sql.DriverManager.getConnection(DriverManager.java:664)

at java.sql.DriverManager.getConnection(DriverManager.java:247)

at springbook.user.dao.UserDao.get(UserDao.java:27)

at springbook.user.dao.UserDao.main(UserDao.java:57)

Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value '���ѹα� ǥ�ؽ�' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:54)

at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73)

at com.mysql.cj.jdbc.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:118)

at com.mysql.cj.mysqla.MysqlaSession.configureTimezone(MysqlaSession.java:293)

at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:2399)

at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:1739)

at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1596)

... 7 more



>>예제와 무언가 다르다는 의심이 들기 시작함


-잘못 써있던 참조변수 내용을 변경




-com.mysql.cj.jdbc.Driver   ->  com.mysql.jdbc.Driver으로 다시 원복

-pom.xml 의 mysql 부분에 버전 명시내용을 지움


-실행은 UserDao를 직접 오른쪽 버튼으로 실행시킴


-아래와 같이 결과 확인 (추가적인 오류는 없었음)

admin등록 성공???

admintest

admin조회 성공




-윈도우에 관련된 mysql 타임존 변경 정보는 찾기 힘듬