Tomcat 이 사용 하는 JRE 설정이 초기화 되어 있기 때문에 발생 한다. Window > Preferences 를 보자. 

Server > Runtime Environments 에 접근하여 JRE 설정을 하자.



정상적으로 동작 할 것이다.


'Tools' 카테고리의 다른 글

Bootstrap Editor 소개  (0) 2014.11.13
Eclipse FindBugs 사용 하기  (2) 2014.11.12
Markdown, Editor 소개  (3) 2014.09.17
간단하게 프로그래밍 할수 있는 Cloud9 활용하기  (0) 2014.09.03
Vim 사용 시 euc-kr, utf-8 로 변환 하기  (0) 2013.12.14

Eclipse 에서는 정상적으로 동작 하지만, CUI 환경에서 Maven clean tomcat:run 하는 경우 Parameter 값을 인식 하지 못하여 예외 상황이 발생 한다.


테스트 했던 프로젝트는 SpringFramework 3.2.11.RELEASE, Tomcat 7.0 으로 작성 하였다.


Cannot create inner bean 'net.sf.log4jdbc.tools.Log4JdbcCustomFormatter#746c2814' of type [net.sf.log4jdbc.tools.Log4JdbcCustomFormatter] while setting bean property 'logFormatter'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'net.sf.log4jdbc.tools.Log4JdbcCustomFormatter#746c2814' defined in file [D:\Project\workspace\sample\target\classes\spring\db\datasource-context.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'margin' threw exception; nested exception is java.util.FormatFlagsConversionMismatchException: Conversion = s, Flags = #


예외가 발생 했기 때문에, Bean 을 생성 하지 못했다. Log4JdbcCustomFormatter margin 값이 인식이 되지 않았기 때문이다.


<beans:bean id="dataSource" class="net.sf.log4jdbc.Log4jdbcProxyDataSource">
    <beans:constructor-arg ref="dataSourceSpied" />
    <beans:property name="logFormatter">
        <beans:bean class="net.sf.log4jdbc.tools.Log4JdbcCustomFormatter">
            <beans:property name="loggingType" value="MULTI_LINE" />
            <!-- <beans:property name="margin" value="19" /> -->
            <beans:property name="sqlPrefix" value="SQL&#58;&#58;&#58;" />
        </beans:bean>
    </beans:property>
</beans:bean>


margin 값을 제외하고 테스트 해보자. 정상 동작 할 것이다.


'Maven' 카테고리의 다른 글

Maven Tomcat Plugin 사용 하기  (0) 2014.11.07
Eclipse에 Maven 연동 후 경고 창이 뜰 경우.  (0) 2012.11.12
Eclipse에서 Maven Project 생성하기  (0) 2012.11.09
Eclipse와 Maven 연동하기  (0) 2012.11.08

Text 가 길어서 Div 영역 오른쪽으로 벗어나는 경우가 있다. 화면이 작은 경우 불필요하게 가로 스크롤이 보이게 된다.



아래 속성을 추가하여 적용 해 보자.


element {word-break: break-all;}


Div 영역에 맞게 수정 된 것을 볼 수 있다.


Tibreo 공식 가이드를 참고 하면, 데이터 타입 중 LONG 은 접근 시 항상 순차적으로만 접근 할 수 있으며, 임의의 위치에 대해 연산은 할 수 없다고 한다.


즉 검색을 할 수 없다. 필요하다면 다른 데이터 타입을 사용해야 하는대 대용량 객체를 저장하기 위한 CLOB 를 사용하면 된다.


CLOB 타입은 LONG 타입을 확장한 데이터 타입이다.


  • 데이터를 최대 4GB까지 저장할 수 있다.
  • 테이블 내에서 하나 이상의 컬럼에 선언할 수 있다.
  • 데이터에 접근할 때, LONG 타입과 달리 임의의 위치에서 접근할 수 있다.
  • CLOB 타입의 컬럼 값은 같은 테이블의 다른 타입으로 선언된 컬럼 값과 동일한 디스크 블록에 저장되 지 않는다.


디스크 블록 내의 로우는 별도의 디스크 블록에 저장된 CLOB 타입의 포인터만 저장하고 있다.


Table 을 Drop 하고 CLOB 타입을 사용하여 새로 생성 하자.


프로젝트를 접하다 보면 화면에 출력 하거나 긴 문자열을 간추려서 사용 할 때, 문자열에서 Html 태그를 제거 해야 하는 경우가 있는대 유용한 라이브러리가 있다.



사용하기 편리한 유틸, Spring Framework 사용 시 지원 해주는 유틸 등 제공 된다.


pom.xml 에 추가 하자.


<dependency>
  <groupId>com.lyncode</groupId>
  <artifactId>jtwig-functions</artifactId>
  <version>2.0.1</version>
</dependency>


사용 방법


import static com.lyncode.jtwig.functions.util.HtmlUtils.stripTags;

public class StripTagsExample {
    public static void main(String... args) {
        String result = stripTags("<!-- <a href='test'></a>--><a>Test</a>", "");
        // Produced result: Test
    }
}

참고 사이트


window opener 로 접근해야만 부모 창 window 접근이 가능 하다.


window.opener.location.href = 'http://www.naver.com'


위 코드를 적용 하자.


Controller 에서 요청 처리 후 응답 할 때 RedirectView 를 사용한다.


return "redirect:/go";


보통 위와 같이 간단하게 사용하면 옵션 값을 주기 불편하다. 직접 객체로 작성 해야 상세하게 설정 할 수 있다.


ModelAndView mav = new ModelAndView();

RedirectView redirectView = new RedirectView(); // redirect url 설정
redirectView.setUrl(String url);
redirectView.setExposeModelAttributes(false);

mav.setView(redirectView);

return mav;


setExposeModelAttributes(false) 로 설정 하면, 직접 ?test=a&test=b 붙여서 작성 하는 부분은 파라미터가 붙지만, ModelAndView.addObject(attributeName, attributeValue) 로 추가 하는 부분은 파라미터가 생략 된다.


조금 번거롭다 하더라도, 직접 객체로 작성 하는 것을 권장 한다.


SSL 보안서버 인증서 를 구매하여 사용하지 않고, OpenSSL 인증서 를 사용하는 경우 Certificate Authority(CA) 에서 인증 되지 않은 인증서 이기 때문에 에러가 발생 한다.


보통 OpenSource 로 제공 되는 Gitlab 를 사용 할 때 위와 같은 이유로 인하여 에러가 빈번하게 발생 한다.


해결을 위해서는 CA 에서 인증 하는 절차를 무시하는 옵션이 있다. 아래와 같이 global 값을 설정 한다.


git config --global http.sslVerify false


정상적으로 git clone 을 받을 수 있을 것 이다.


'Source Tools' 카테고리의 다른 글

Eclipse 에 git 연동하기  (0) 2014.10.16
SVN 파일 충돌 시 해결 하기  (2) 2014.06.11

+ Recent posts