'XML에러'에 해당되는 글 2

  1. 2009.12.23 XML 파싱 에러
  2. 2009.06.10 Open quote is expected for attribute "{1}" associated with an element type "parameterClass".

XML 파싱 에러

무시무시한 XML 파싱 에러가 났다.
Caused by: org.jdom.input.JDOMParseException: Error on line 15: The element type "xxx:TestName" must be terminated by the matching end-tag "</xxx:TestName>".
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:504)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:807)
    ...
    ... 37 more
Caused by: org.xml.sax.SAXParseException: The element type "xxx:PartyName" must be terminated by the matching end-tag "</xxx:TestName>".
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)

시스템이 영문 윈도우즈라 file.encoding을 EUC-KR로 지정해 두었다.
외부시스템과 검증테스트를 하다보니 위와 같은 에러가 남.
개발자와 통화를 하던중 한글이 깨진 경우라고 함.
생성된 MIME 파일을 살펴보니 한글이 깨진 경우가 나왔다.

XXX-20091223162459-72723.0
    <XxxDateTime>20091223162532</XxxDateTime>
    <DescriptionText>성공적으로 처리 되었습니다.</DescriptionText>

XXX-20091223162459-72723.s
      <xxx:To>
        <xxx:TestID>1234512345</xxx:TestID>
        <xxx:TestName>(주)XXX</xxx:TestName>
      </xxx:To>

XXX-20091223162541-07225.s
      <xxx:To>
        <xxx:TestID>1234512345</xxx:TestID>
        <xxx:TestName>(二??대?????ㅽ???/xxx:TestName>
      </xxx:To>

file.encoding을 8859_1, UTF-8로 수정하면 정상적으로 처리된다.
시스템의 페이지 인코딩인 UTF-8로 설정했다.

Open quote is expected for attribute "{1}" associated with an element type "parameterClass".

java.lang.RuntimeException: Error occurred. 
Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. 
Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. 
Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. 
Cause: org.xml.sax.SAXParseException: Open quote is expected for attribute "{1}" associated with an  element type  "parameterClass".
    at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:49)
    at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:63)

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="Person">
<select id="getPerson" parameterClass=”int” resultClass="examples.domain.Person">
	SELECT
	PER_ID as id,
	PER_FIRST_NAME as firstName,
	PER_LAST_NAME as lastName,
	PER_BIRTH_DATE as birthDate,
	PER_WEIGHT_KG as weightInKilograms,
	PER_HEIGHT_M as heightInMeters
	FROM PERSON
	WHERE PER_ID = #value#
</select>
...

” 를 " 로 바꾼다.