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

+ Recent posts