2016년 3월 1일 화요일

mysql The reference to entity must end with the delimiter error



다음과 같이 DBCP JOCL 파일을 사용하면

<object class="org.apache.commons.dbcp.PoolableConnectionFactory"
        xmlns="http://apache.org/xml/xmlns/jakarta/commons/jocl">
    <object class="org.apache.commons.dbcp.DriverManagerConnectionFactory">
        <string value="jdbc:mysql://localhost:3306/webdb?useUnicode=yes&characterEncoding=UTF-8" />
        <string value="root" />
        <string value="" />
    </object>
    <object class="org.apache.commons.pool.impl.GenericObjectPool" />
    <object class="org.apache.commons.pool.impl.GenericKeyedObjectPoolFactory" null="true" />
    <string null="true" />
    <boolean value="false" />
    <boolean value="true" />
</object>

다음과 같은 에러에 직면할 수 있다.

[Fatal Error] :4:84: The reference to entity "characterEncoding" must end with the ';' delimiter.

다음과 같이 &를 &amp;로 변경한다.

<string value="jdbc:mysql://localhost:3306/webdb?useUnicode=yes&amp;characterEncoding=UTF-8" />

에러가 발생하지 않는다.

Reference:
http://bugs.mysql.com/bug.php?id=8496

댓글 없음:

댓글 쓰기