본문 바로가기

Framework

[Play Framework2] Json polymorphism Scala에서는 동적으로 Json 으로 변환하기가 힘들다. 그래서 찾은 방법이 trait을 만들어서 상속을 통한 방법이다. trait Person object Person { implicit val shapeWrites = Writes[Person] { person => person match { case student: Student => Json.writes[Student].writes(student) case teacher: Teacher => Json.writes[Teacher].writes(teacher) case parent: Parent => Json.writes[Parent].writes(parent)}} } @Entity@Table (name = "teacher")case class Te.. 더보기
[Spring Framework] Injection of autowired dependencies failed 아래의 에러에서 주목해야되는 부분은 circular reference 이다. 즉... @Inject 애노테이션을 쓰면서 서로 서로 가지도록 설정을 해서 발생한 문제이다. 해결 방법은구조적으로 @Inject 하는 상황을 회피하도록 만들거나... http://java.dzone.com/articles/resolve-circular-dependency 여기를 참고해서 보자~! org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'userService': Bean with name 'userService' has been injected into other beans [matchingSer.. 더보기
[Spring Framework] Scheduled 설정 & 사용 Spring3 에서 Scheduled 사용하는 방법이다. 우선 추가해야 될 사항으로 xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation= 에는 http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd 을 추가해야 한다. 그리고 마지막으로는 아래의 것을 추가한다. 사용방법 @Scheduled(cron = "0 2/5 * * * *") public void harvestStatus() { ~~~~~~~~~~ } 더보기