Java/오류노트

Java/오류노트

[Java/오류노트] Solved - org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL

Spring Boot JPA 기반으로 프로젝트를 수행하는 도중에 발생하는 오류에 대해 알아보고 해결책을 알아봅니다. 1) 문제점 💡 문제점 - Spring Boot JPA를 테스트하는 도중에 application.properties 값을 spring.jpa.hibernate.ddl-auto= create로 해둔 상태에서 발생한 문제점이었습니다. 💡 오류메시지 - org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "drop table if exists xxxx" via JDBC Statement - 해당 문제는 하단의 오류에서 확인해 볼 수 있듯이 Cannot drop table 'tb_board' referenced..

Java/오류노트

[Java/오류노트] Solved - Could not create plugin of type class org.apache.logging.log4j.core.async.AsyncLoggerConfig for element AsyncLogger: java.lang.NoClassDefFoundError: com/lmax/disruptor/EventFactory java.lang.NoClassDefFoundError: com/lmax/di..

해당 글에서는 Log4j2에서 비동기 로깅에 대해 설정하는 과정 중에 발생하는 오류에 대한 해결한 방법에 대해 공유합니다. 1) 문제점 💡 문제점 - Log4j2에서 ‘비동기 로깅’과 관련되어 테스트를 하는 중에 아래와 같은 문제가 발생하였습니다. Could not create plugin of type class org.apache.logging.log4j.core.async.AsyncLoggerConfig for element AsyncLogger: java.lang.NoClassDefFoundError: com/lmax/disruptor/EventFactory java.lang.NoClassDefFoundError: com/lmax/disruptor/EventFactory - 해당 문제는 Async..

Java/오류노트

[Java/오류노트] Solved - Annotation-specified bean name 'xxxController' for bean class [xxxController] conflicts with existing, non-compatible bean definition of same name and class [xxxController]

해당 글에서는 동일한 이름의 Controller를 생성하였을 때 발생하는 오류와 이에 대해 해결하는 방법에 대해 알아봅니다. 1) 문제점 💡 문제점 - 아래와 같은 문제가 발생하였습니다. Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'xxxController' for bean class [xxxController] conflicts with existing, non-compatible bean definition of same name and class [xxxController] - 해당 오류는 동일한 이름을 가진 두 개의 빈 정의가 서로 ..

Java/오류노트

[Java/오류노트] Solved - org.apache.ibatis.binding.BindingException : Type interface xxx is not known to the MapperRegistry.

해당 문제에서는 Mybatis에서 발생하는 BindingException에 대해 해결 방법을 알아봅니다. 1) 문제점 💡 문제점 - 최근 프로젝트에서 패키지를 재구성하였습니다. - 이에 따라 IDE 툴 내에서 자동 Refactor가 되었는 줄 알았으나 아래와 같은 문제가 발생하였습니다. org.apache.ibatis.binding.BindingException : Type interface xxx is not known to the MapperRegistry. - 해당 문제는 말 그대로 **Mapper로 구성한 xxx 경로에 있는 파일이 MapperRegistry에 등록되지 않은 문제입니다. - 다시 말해 Mapper Resource 세팅의 경로가 문제가 생겨서 이를 수정 해줘야 합니다. org.apa..

Java/오류노트

[Java/오류노트] Solved - No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.2.1 was found.

해당 글에서는 Spring Boot 프로젝트를 새로 구성하고 빌드하는 과정에서 발생하는 오류에 대해서 확인하고 해결하는 방법에 대해 알아봅니다. 1) 문제점 💡 문제점 - 해당 문제가 발생하는 환경은 Spring Boot 3.2.1 버전을 최초 생성하여 서버를 빌드하는 과정에서 Gradle에서 발생하는 문제로 아래와 같은 문제점이 발생하였습니다. - 해당 문제점을 확인해보면 프로젝트의 구성이 java 8로 구성이 되어 있어서 java 17로 변경을 하는것을 권장한다는 문제였습니다. > Could not resolve all files for configuration ':classpath'. > Could not resolve org.springframework.boot:spring-boot-gradle-..

Java/오류노트

[Java/오류노트] SonarLint: integer number too large

해당 글에서는 integer number too large 오류에 대해 해결방법에 대해 알아봅니다. 1) 문제점: Integer number too large 1. Integer number too large 💡 Integer number too large - Java에서 정수 값이 표현 가능한 범위를 초과했을 때 발생하는 오류입니다. - int와 long은 정해진 비트 수로 값을 표현할 수 있습니다. 만약 이 비트 수를 초과하는 값을 사용하면 이 오류가 발생합니다. 💡 [참고] int(=Integer)와 long(=Long)의 최소/최대 범위입니다. 타입 최소 범위 최대 범위 int(=Integer) -2,147,483,648 +2,147,483,647 long(=Long) -9,223,372,036,..

Java/오류노트

[Java/오류노트] Solved - Cause: superclass access check failed: class butterknife.compiler.ButterKnifeProcessor$RScanner

해당 글에서는 Android Studio내에서 발생하는 오류에 대해 이를 해결하는 방법에 대해서 알아봅니다. 1) 문제점 💡문제점 Cause: superclass access check failed: class butterknife.compiler.ButterKnifeProcessor$RScanner (in unnamed module @xxx) cannot access class com.sun.tools.javac.tree.TreeScanner (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.tree to unnamed module @xxx - 해당 문제는 안드로이드 빌드를 수행하였을 경우 위와..

Java/오류노트

[Java/오류노트] SonarLint : "Random" objects should be reused

해당 글에서는 Java에서 SornarLint에서 발생하는 오류에 대한 해결방법에 대해 알아봅니다. 1) 문제점 💡 "Random" objects should be reused 문제점 - 객체를 재 사용해야 한다는 의미입니다. 이는 일반적으로 프로그래밍에서 객체를 생성하고 사용할 때 발생하는 비용을 줄이기 위해 권장되는 접근 방식입니다. - 객체를 반복적으로 생성하고 버리는 것보다, 이미 생성된 객체를 재사용하여 성능을 향상시킬 수 있습니다. 이를 통해 메모리 사용량을 줄이고 시스템 리소스를 효율적으로 활용할 수 있습니다. 💡 아래와 같이 new Random()으로 객체를 생성해서 만드는 코드 부분에서 해당 Lint 오류가 발생하였습니다. 2) 해결방안 💡 해결방안 - new Random() 형태로 객체..

Java/오류노트

[Java/오류노트] SonarLint : Use try-with-resources or close this "CloseableHttpClient" in a "finally" clause.

해당 글에서는 Java에서 SornarLint에서 발생하는 오류에 대한 해결방법에 대해 알아봅니다. 1) 문제점 💡 Use try-with-resources or close this "CloseableHttpClient" in a "finally" clause. 문제점 - 리소스 누출을 피하기 위해 "try-with-resources" 문을 사용하거나 "finally" 절에서 "CloseableHttpClient"를 닫는 것이 권장됩니다. 이렇게 하면 예외가 발생하더라도 리소스가 제대로 닫히게 됩니다. 💡 변경 이전 소스코드 public Map httpPost(String url, String queryParams) { try { // HTTPClient 객체 생성 CloseableHttpClient h..

Java/오류노트

[Java/오류노트] SonarLint : A "NullPointerException" could be thrown; "getBody()" can return null.

해당 글에서는 Java에서 SonarLint에서 발생하는 오류에 대한 해결방법에 대해 알아봅니다. 1) 문제점 💡 A "NullPointerException" could be thrown; "getBody()" can return null. 문제점 - "NullPointerException"라는 오류 메시지는 null 값을 접근하려고 할 때 발생합니다. 이 경우 "getBody()" 메소드가 null을 반환할 수 있으며, 이로 인해 예외가 발생할 수 있습니다. 이 오류는 일반적으로 초기화되지 않은 객체의 메소드나 속성에 접근하려고 할 때 또는 존재하지 않는 객체에 접근하려고 할 때 발생합니다. - 해당 오류에서는 ResponseEntity result 값으로 제너릭 타입 형태의 ‘result’ 값에 Nu..

adjh54
'Java/오류노트' 카테고리의 글 목록