본문 바로가기

멘탈저장소250

Spring 에러 - Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource mapper.xml을 찾지못하는 오류, 아래처럼 property value의 경로 중 classpath뒤에 *를 붙여준다. (읭? 수정했는데도 안된다?) 계속 안되길래 뭐가 문젠가 봤더니 /(슬래쉬) 하나를 빼먹음… 오타조심... 2020. 2. 8.
Spring 에러 - resource specification not allowed here for source level below 1.7 ~ 에러 내용 : 1.7 이상의 컴파일 환경을 사용하고 있음에도 1.7 이하의 버전을 환경설정에 사용중이기 때문에 발생하는 문제 해결 방법 : 아래처럼 pom.xml 파일을 수정 후 Update Maven 실행. org.apache.maven.plugins maven-compiler-plugin 2.5.1 1.6 -> 1.8로 수정 1.6 -> 1.8로 수정 -Xlint:all true true 2020. 2. 8.
Spring 에러 - Maven에서 json-lib 추가 시 Missing artifact net.sf.json-lib:json-lib:jar:2.4 아래의 문장을 추가한다. jdk15 2020. 2. 8.
Spring 에러 - java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password' 해결 방법 : (mysql 최신버전(8버전 이상)에서 오류 발생) 아래와 같이 mysql 콘솔창에 입력한다. alter user 'username'@'ip' identified with mysql_native_password by 'password'; username은 root, ip는 루프백 ip, password에는 작은 따옴표를 포함한 데이터베이스 비밀번호를 써준다. 2020. 2. 8.
Spring 에러 - the server time zone value is unrecognized or represents 해결 방법 : root-context의 드라이버 커넥션 뒤에 serverTimezone 옵션을 아래와같이 추가해준다. jdbc:mysql://localhost/abc?serverTimezone=UTC 2020. 2. 8.
Spring 에러 - <annotation-driven> 에러 해결 방법 : c:\사용자 밑의 .m2 폴더를 지운 후 sts를 다시 실행한다. 2020. 2. 8.
Spring 에러 - SqlSession cannot be resolved to a type & SqlSessionFactory cannot be resolved to a type & The import org.apache.ibatis.session.SqlSessionFactory cannot be resolved 에러 내용 : 해당 에러의 경우 보통 maven 업데이트를 하면 해결이 되지만, 해결이 안되는 경우 maven에 추가한 라이브러리들을 일일히 까봐야 한다. 아래는 오류가 발생했던 라이브러리 //수정 org.mybatis mybatis 3.4.1 -> 3.2.8로 변경하니 에러 사라짐 위의 라이브러리를 바꿔주니 아래와 같은 에러 발생 java.lang.NoClassDefFoundError: org/apache/ibatis/cursor/Cursor 추가된 ibatis와 버전이 맞지 않아 발생하는 오류, 아래의 ibatis 버전을 바꾸거나 추가된 ibatis를 확인해보자. //추가 org.apache.ibatis ibatis-core 3.0 2020. 2. 8.
Spring 에러 - Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [net.sf.log4jdbc.sql.jdbcapi.DriverSpy] 에러 내용 : 해당 에러의 경우 DB-log4j 사용과 관련해서 라이브러리가 추가되지 않았을경우 나타난다. 해결 방법 : resource 폴더 내의 log4j.xml, log4j~.properties 와 같은 log4j 관련 파일들을 추가해주고 아래의 라이브러리를 추가해준다. // 추가 해 줄 maven 라이브러리 org.bgee.log4jdbc-log4j2 log4jdbc-log4j2-jdbc4 1.16 2020. 2. 8.
Spring 에러 - org.springframework.beans.factory.BeanCreationException: Error creating bean with name '~Controller': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean.. 에러 내용 : 해당 에러의 경우 컨트롤러(bookController)에서 inject옵션(Resource, Autowired)가 사용될 때 서비스(BookService)가 정의되지 않았기 때문에 나타난다. 해결 방법 : dispatcher-servlet(servlet-context)의 component-scan이 제대로 사용되었는지 확인하자. 2020. 2. 8.