본문 바로가기

Issue

(13)
[Java][Spring] Dependency Injection : How to @Autowired fail case and The better case Java로 웹 프로젝트를 만들다보면, 반드시 필요한 것 중 하나인 의존성 주입(dependency injection)을 고려하게 된다. 의존성 주입이라 하면 하나의 객체가 다른 객체의 의존성을 제공하는 테크닉을 뜻한다. 필자는 작업하던 프로젝트에서 @Autowired를 계속 쓰고 당연하게 주입해서 쓰곤 했다. (사실 대학에서도 의존성 주입 중 하나의 방법이라고 위 어노테이션을 설명없이 쓰라고만 했었다..) 그러던 중 문득 드는 생각. 내가 왜 저걸 써야하는가. 우선 이를 이해하기 위해서는 의존성 주입이 대해 좀더 알아봐야했다. DI, dependency injection 은 spring 프레임워크에서만 사용하는 것이 아닌 객체지향 프로그래밍에서 통용되는 개념이다. 강한 결합 객체 내부에서 다른 객체를 생..
[Spring] IntelliJ에서 lombok 어노테이션이 적용되지 않는 경우 개발 환경 IntelliJ, gradle, spring-boot ⌗ 오류 현상 IntelliJ에서 SpringBoot Framework를 사용한 프로젝트가 application 을 실행(Build)했을 때, cannot find symbol 과 같은 에러가 발생할 하는 경우 ⌗ 해결 방법 아래의 순서대로 해결을 하면 됩니다. 1 ) IntelliJ → preference → plugin 에서 lombok 검색 ⇢ lombok 플러그인 설치 2 ) IntelliJ → preference → Build,Execution,Deployment → Compiler → Annotation Processors ⇢ Enable annotation processing 체크 3 ) IntelliJ → File → Inva..
[Spring] Generating equals/hashCode implementation but without a call to superclass, even though this class does not extend java.lang.Object 오류 해결 ⌗ 오류 현상 warning: Generating equals/hashCode implementation but without a call to superclass, even though this class does not extend java.lang.Object. If this is intentional, add '@EqualsAndHashCode(callSuper=false)' to your type. ⌗ 해결 방법 import lombok.EqualsAndHashCode; @Data @EqualsAndHashCode(callSuper=false) public class TestDtoB extends TestDtoA { private String id; } @EqualsAndHashCode 어노테이..
[Spring] Cannot determine embedded database driver class for database type NONE 오류 해결 ⌗ 오류 현상 *************************** APPLICATION FAILED TO START *************************** Description: Cannot determine embedded database driver class for database type NONE Action: If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (the profiles "local" are currently activ..
[Spring] 빈 순환 참조로 인한 오류 해결 ⌗ 오류 현상 ************************** APPLICATION FAILED TO START *************************** Description: The dependencies of some of the beans in the application context form a cycle: testApplication ┌─────┐ | garbageRemoveServiceImpl defined in file [/Documents/DevSource/test/classes/com/example/service/TestA.class] ↑ ↓ | garbageCouponIssueServiceImpl defined in file[/Documents/DevSource/test/cl..
[Java][Mybatis] 테스트 코드 실행 중 org.mybatis.spring.MyBatisSystemException 오류 해결 ⌗ 오류 현상 11:49:08 com.test.service.serviceTest > sqlTest FAILED 11:49:08 org.mybatis.spring.MyBatisSystemException at serviceTest.java:57 11:49:08 Caused by: org.apache.ibatis.exceptions.PersistenceException at serviceTest.java:57 11:49:08 Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException at serviceTest.java:57 11:49:08 Caused by: java.sql.SQLException at serviceTest.java:57 11..
[Java][MyBatis] org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 오류 해결 ⌗ 오류 현상 mybatis 테스트 코드 작성시 @MybatisTest 어노테이션을 붙였는거나 그 외에도 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 라고 에러가 날때. ⌗ 해결 방법 아래의 순서에 맞춰 해결하면 된다. ^0^ Mapper Interface와 mapping되는 xml파일에 오타가 있는 경우 (예시) id와 Interface에 메소드명이 일치하지 않는 경우 Build 파일이 갱신되지 않은 경우 classpath에 경로가 잘못된 경우 xml이 저장될 경로를 잘못 생성한 경우 DataBase confiure 파일을 찾지 못하는 경우 1 ) 대부분 이와 같은 에러가 발생하는데, 오타만 찾으면 금방 ..
[Java] java.lang.IllegalArgumentException: Request header is too large 오류 해결 ⌗ 오류 현상 org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Request header is too large at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:718) at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuf..

❥ CHATI Github