본문 바로가기

JAVA

(52)
[Error] java - Unreachable catch block for SQLException. This exception is never thrown from the try statement body Unreachable catch block for SQLException. This exception is never thrown from the try statement body try 안에서 exception이 발생하지 않으니 필요없다는 뜻. 해당 Exception 필요한 경우 구문을 try-catch 안에 넣으면 됨.
[Error] Java Mvc project - exception : java.lang.NumberFormatException: For input string: "" 숫자 형식 에러 exception=java.lang.NumberFormatException: For input string: "숫자" 원인 1. 정수아닌 문자 포함 되었을 때 String str = "123o"; System.out.println(Integer.parseInt(str)); 2. int 범위보다 큰 정수일 때 String str = "123123123123123123123123"; System.out.println(Integer.parseInt(str)); 3. null 입력 시 String str= null; System.out.println(Integer.parseInt(str)); 4. 문자열에 공백이 있을 경우 String str = " 123 "; System.out.println(Integer...
[Error] Eclipse - Syntax error on tokens, delete these tokens. 복사 붙여넣기 에러 Syntax error on tokens, delete these tokens 구문을 복사 > 붙여넣기 시 발생하는 에러. > 공백 제거하면 됨. ctrl + f > 빨간색 공백 선택 > 'find'에 공백 삽입 > Replace All
[Error] Spring MVC file upload 오류 - 해결 파일 생성 및 저장은 되었는데 에러 문구 발생. 확인 필요. 파일은 정상 저장됨. C:\upload\20221022 폴더가 생성되었습니다 ERROR: com.assignment.exception.CommonExceptionAdvice - Exception ......nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection: DataSource returned null from getConnection(): or..
[Error] Eclipse Spring MVC - Multipart 파일 업로드 에러 : org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: 임시 파일 업로드 위치 [C:\uploadfile]은(.. 파일 업로드 시 에러 발생 org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: 임시 파일 업로드 위치 [C:\uploadfile]은(는) 유효하지 않습니다. > 원인 : 파일 업로드 시 필요한 파싱이 안 되어있음. 해결 1. Tomcat server - context.xml Multipart 처리를 위해서는 allowCasualMultipartParsing 옵션을 꼭 추가해야 함. 2. web.xml - url 경로 확인 C:\\uploadfile\\ 20971520 41943040 20971520
[Error] log cannot be resolved - lombok 에러 DataSource Test중 log 에러 발생 log cannot be resolved 1. Maven Dependencies > lombok.jar 우클릭 2. Run as > java Application 진행 3. IDEs 창에서 Eclipse or SpringToolSuite 선택 > install/update 클릭 4 Eclipse(sts) Project Clean > Restart or Maven > Update Project 진행 5. 에러 해결 + lombok 미설치 시에도 동일 에러 발생. lombok 설치 여부 확인 필요. + eclipse.ini 파일 > -javaagent:(경로)\lombok.jar > -javaagent:lombok.jar 로 변경 ecilpse 재실행. + p..
[Error] log4j.xml 빨간줄 - Cannot find DTD 'file:///C:/Users/master/eclipse-workspace/assignment01ex/src/main/resources/log4j.dtd'. Create the DTD file or configure an XML catalog for this DTD. 멀쩡하던 log4j.xml 을 클릭했더니 빨간줄 발생. 더보기 Multiple annotations found at this line: - The file cannot be validated as the XML definition "C:\Users\master\eclipse-workspace\assignment01ex\src\main\java\log4j.dtd (지정된 파일을 찾을 수 없습니 다)" that is specified as describing the syntax of the file cannot be located. - Cannot find DTD 'file:///C:/Users/master/eclipse-workspace/assignment01ex/src/main/resources/log4..
[Error] Eclipse spring MVC project Mapping error (WARN : org.springframework.web.servlet.PageNotFound - No mapping for GET / ) Eclipse version 2021-09 java 11 sts , sts addon install legacy project > MVC project tomtcat 연동 확인 중 1. WARN : org.springframework.web.servlet.PageNotFound - No mapping for GET / 2. WARN : org.springframework.web.servlet.PageNotFound - No mapping for GET /WEB-INF/views/index.jsp 에러 원인 / 해결 방법 1. URL 오타 @RequestMapping("/") 확인 2. @Controller 미입력 controller class에 @controller 어노테이션 확인 3. servlet-c..
[Error] Eclipse spring MVC pom.xml 오류 - Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer 1. MVC project 생성 후 pom.xml 첫 줄 오류 Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer 원인 : Maven version이 낮아서 생기는 오류. 2. Maven-war-plugin dependency 추가 maven-war-plugin 3.2.2 해결 완료.
[Error] spring framework 4 legacy project 생성 sts3 Add-On for Spring Tools install 에러 - Cannot complete the install because one or more required items could not be found. sts4 Legacy project 생성 시 sts3 add-on install 필요. 경로 : help > Eclipse Marketplace > spring tools 3 add on for spring install 에러 발생 Cannot complete the install because one or more required items could not be found. osgi.bundle; org.eclipse.mylyn.commons.ui [3.7.0,4.0.0) 1. https://www.eclipse.org/mylyn/downloads/ Mylyn Downloads | The Eclipse Foundation The Eclipse Foundation - home to a global co..