본문 바로가기

Spring

[JAVA] SPRING JPA Query Method https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#reference Spring Data JPA - Reference Documentation Example 108. Using @Transactional at query methods @Transactional(readOnly = true) public interface UserRepository extends JpaRepository { List findByLastname(String lastname); @Modifying @Transactional @Query("delete from User u where u.active = false") v docs.spring.io 예시 ) p.. 더보기
[JAVA] LIST 형 POST 처리 - JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token at [Source: java.io.PushbackInputStream@5db922ae; line: 1, column: 1] [JAVA] LIST 형 POST 처리 // CLASS // Student , String name, Integer age @PostMapping("/test") public void test(@Valid @RequestBody List data) { .... } 위와 같이 Post 를 받아주면 아래의 에러를 만날 수 있다 JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token at [Source: java.io.PushbackInputStream@5db922ae; line: 1, column: 1] Json 파싱을 할 때, 올바른 방법이 아니라는 이야기인데, 어떻게 Student .. 더보기
[JAVA] Spring 에러 Error creating bean with name : Unsatisfied dependency expressed through field ~ Error creating bean with name '...Service': Unsatisfied dependency expressed through field '...Service''; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type '...Service'' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=t.. 더보기
[JAVA] Spring 에서 python 사용하기 - jython 이전에 작성한 글에서 jython 을 설치하였습니다. https://binshuuuu.tistory.com/288 불러오는 중입니다... 이제 Spring + Maven 에 jython 을 연동해 봅시다. 1. Pom.xml org.python jython-standalone 2.7.1 * 가지고 있는 버전에 맞춰서 추가해주시면 됩니다. 저는 2.7.1 버전을 사용합니다. https://mvnrepository.com/artifact/org.python/jython Maven Repository: org.python » jython Jython is an implementation of the high-level, dynamic, object-oriented language Python written i.. 더보기
[JAVA/eGovFrame] Mapped Statements collection does not contain value for 에러 -1 [JAVA/eGovFrame] Mapped Statements collection does not contain value for 에러 -1 위의 에러의 경우 5가지의 에러 원인이 있다고 합니다. (1) mapper id가 틀린 경우 (2) Parameter와 bean의 field명이 틀린 경우 (3) sql.xml에서 정의된 namespace와 DAO에서 호출하는 namespace가 다를 경우 (4) mapper가 정의가 되어 있지 않거나 Spelling이 틀린 경우 (5) mapper에 정의된 namespace 명칭이 같은 Application 내에 중복 될 경우 그중 mapper가 정의가 되지 않았거나, Spelling 이 틀린 경우에 대한 포스팅입니다. context-mapper.xml 저의 경우.. 더보기
[JAVA] JAVASCRIPT jQuery Validation - 제이쿼리로 필수체크하기 ! [JAVA] jQuery Validation - 제이쿼리로 필수체크하기 ! 제이쿼리 Validation 플러그인을 이용해서 필수체크 포스팅입니다. 공식 사이트 URL : https://jqueryvalidation.org/ 를 이용하시어서 로컬로 사용하시거나, CDN 을 통해 플러그인을 다운받아 사용하시길 바랍니다. * 당연히, jQuery 라이브러리도 존재하여 합니다. 플러그인의 사용방법이 간단하니, 간단한 예제 소스를 보면서 이해해보도록 하겠습니다.$(function(){ var endText = '을(를) 입력하여 주십시오.' $("#formId").validate({ rules: { // name 값 birth: "required", phone1: "required", phone2: "requir.. 더보기
[JAVA/SPRING/eGovFrame] JAVA에서 Request Body 의 처리 - String toJsonArray / String toJson / JsonArray format String [JAVA/SPRING/eGovFrame] JAVA에서 Request Body 의 처리 - String toJsonArray / String toJson / JsonArray format String 제목이 무언가 굉장히 길어져버렸습니다. 내용은 간단합니다. POST 방식으로 전달된 Request 는 Body 에 DATA 가 담겨져서 저장됩니다. 그리고, 우리는 효율적은 JSON 형태로 BODY에 담아서 전달했을 경우, 어떻게 데이터를 처리해야 하는지에 대한 포스팅입니다. @RequestMapping(value ="/example.do") @ResponseBody public ModelAndView example(HttpServletRequest request, HttpServletResponse res.. 더보기
[eGovFrame] Spring & JDBC 에러 - Error creating bean with name 'CmmUseDAO': Injection of resource dependencies failed; [eGovFrame] Spring & JDBC 에러 - Error creating bean with name 'DAO_NAME': Injection of resource dependencies failed; 요즘에는 한창 프로젝트 중이라 에러 포스팅을 많이하게 되네요. 생각나는대로 에러 포스팅을 할 예정입니다. 아래와 같은 에러가 발생했습니다. 9월 13, 2018 5:43:50 오후 org.apache.catalina.core.ContainerBase startInternal심각: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed.. 더보기
[eGovFrame] MyBatis - Mysql 에러 01 : Parameter index out of range (1 > number of parameters, which is 0). [eGovFrame] MyBatis - Mysql 에러 01 : Parameter index out of range (1 > number of parameters, which is 0). Mysql 에서 SQL 문을 테스트 했을 떄는 잘되었는데, Mybatis 를 이용하면 많은 에러들을 만나 볼 수 있습니다. Parameter index out of range (1 > number of parameters, which is 0) 그 중 위와같은 에러가 발생할 수 있습니다. 당황하지 않고 mapper에서 SQL문을 확인해봅시다. 두 SQL 에서 차이점은 작은 따옴표가 있냐 없냐인데요. 해당 에러를 해결 할 수 있습니다. MyBatis 에서 ' ' , " " 등의 따옴표 실수를 줄일 수 있도록 주의하면 되겠.. 더보기
[ JAVA ] Spring & Tomcat - 톰캣(8.0) 설치하기 & 프레임워크와 연동하기 [ JAVA ] Spring & Tomcat 연동하기 - 톰캣(8.0) 설치하기 & 프레임워크와 연동하기 * 연동이라기보다는, 톰캣을 설치하고, Spring 프레임워크를 톰캣서버에 올린다는 개념이 맞다고 할 수 있다. Tomcat 설치하기 1. 톰캣 사이트에서 필요한 설치 파일을 다운 받는다 tomcat.apache.org/download-80.cgi 2. 다운받은 파일 실행 3. 일반 프로그램들을 설치하듯이 Next, Next ... 4. 기본 포트 환경설정 화면이다. 특별한 커스텀 동작이 필요없다면 이부분도 Next 5. JRE 와 톰캣 설치 경로 설정화면인데, 특별한 이유가 없다면 기본세팅으로 설치. 6. 톰캣 설치가 완료 ! 확인해보도록 합시다. 톰캣을 실행하고, 브라우저에서 localhost:8.. 더보기