2월, 2014의 게시물 표시

Eclipse에서 sh 작성시 유의사항

개발 PC가 Windows일 경우 sh를 작성할 때 Line Delimiter에 주의해야 한다. Line Delimiter 변경은 아래의 방식으로 진행한다. 1. sh 파일 선택 2. 상단의 File > Convert Line Delimiters To > UNIX

Jetty 와 JDK 버전 비교 테이블

참고 :  https://wiki.eclipse.org/Jetty/Starting/Jetty_Version_Comparison_Table Jetty Version Comparison Table Version Servlet Java Namespace Licenses Site Status Jetty 9 Servlet 3.0+ Java 1.7 org.eclipse.jetty.* EPLv1  /  ASLv2 Eclipse.org Alpha Milestones Jetty 8 Servlet 3.0 Java 1.6 org.eclipse.jetty.* EPLv1  /  ASLv2 Eclipse.org Stable Jetty 7 Servlet 2.5 Java 1.5 org.eclipse.jetty.* EPLv1  /  ASLv2 Eclipse.org Stable Jetty 6 Servlet 2.5 Java 1.4 org.mortbay.* ASLv2 Codehaus.org End of Life / Nov 2010

Mybatis에서 ExceptionTranslator 설정하는 방법

개발 환경 : Hsql, mybatis 개발 중인 코드에서 column에 지정된 길이보다 긴 문자열을 insert 나 update 하였을때, Mybais에서는 DataIntegrityViolationException 이 발생한다. 여기서 문제는  DataIntegrityViolationException 의 의미가 너무나 광범위 하다는 점이다. 그래서 구글링 해본 결과  ExceptionTranslator 라는 개념과 Exception의 원인과 코드 값을 알 수 있는 getRootCause() 및 getErrorCode()를 찾을 수 있었다. 참고 :  https://groups.google.com/forum/#!topic/ksug/3WSic9p5poo 참고 자료에서는 JdbcTemplate에서 ExceptionTranslator를 주입하라는 것인데,  현재 개발 환경은 mybatis 이므로 mybatis 내에서 유사 기능이 있는지 확인하기 위해 구글링을 하였다. 그래서 발견한 문서는 다음과 같다. 참고 :  http://mybatis-user.963551.n3.nabble.com/Are-custom-ExceptionTranslators-supported-in-MyBatis-3-How-are-these-typically-injected-via-Spring-td2929647.html 질문을 보면 "ExceptionTranslator를 주입하고 싶은데 해당 property가 없다 어떻하냐?" 의 내용인데 다행히도 해당 내용에 대한 답변이 있고 설명도 잘 되어 있다. 답변을 간단하게 설명하면 "sqlSessionTemplate에서 exceptionTranslator를 생성자를 통해 주입이 하라"는 말이다. 위 내용을 바탕으로 구현한 context는 다음과 같다.           < ...

JUnit Smtp 테스트 코드

import java.util.Properties; import javax.mail.Authenticator; import javax.mail.Message; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMessage.RecipientType; import org.junit.Before; import org.junit.Test; public class SmtpSend { private String userid; private String password; private String email; private String subject; private String contents; private String rcvEmail; private Properties properties; @Before public void setUp() { String host = "gw.konantech.com"; properties = new Properties(); properties.put("mail.smtp.host", host); properties.put("mail.smtp.socketFactory.port", "25"); properties.put("mail.smtp.socketFactory.class","javax.net.ssl.SSLSocketFactory"); properties.put("mail.smtp.auth...

jotm을 이용한 DataSource 구성 시 의문사항??

< bean class = "org.enhydra.jdbc.standard.StandardXADataSource" destroy-method = " shutdown " > < property name = "transactionManager" ref = "jotm" ></ property >        < property name = "driverName" value = "#{dbProp.driverClassName}" />       < property name = "url" value = "#{dbProp.dbBatchUrl}" ></ property > </ bean > 여기서.. destroy-method설정 하는 데에서 xml 에러가 난다. Destroy-method 'shutdown' not found in bean class 'org.enhydra.jdbc.standard.StandardXADataSource'  그도 그럴것이 shutdown 메소드는 인자를 받는 메소드이기 때문이다.  - public void shutdown( boolean force ) {} 즉 destroy method에서 어떤 인자를 던질지 모르기 때문에 인자가 없어야 하지 않을까? 뭐 어찌 되었던 위 처럼 사용해도 컴파일도 되고 실행도 된다. 하지만... 검색에서 보인 모든 소스들은 StandardXDataSource 빈에 destroy-method를 shutdown를 쓴다는 것이다. 단지 eclipse 설정 문제인가...? 아님...어떤 설정이 빠진 것인가?