Invalid byte 1 of 1-byte UTF-8 sequence 이와 같은 오류 검색해보면 여러가지 해결책이 나오는데
내가 오류난 경우와 다른경우가 있어서 또다른 해결책으로 적는다.
내가 오류난 경우는 한글의 들어간 xml문자열을 node 객체로 변환하다가 오류가 난것이다.
원래는 getBytes 이렇게 되어있었는데 getBytes("UTF-8") 이렇게 변경했다.
// xml 문자열을 Node 객체로 변환
Element node = null;
try {
node = DocumentBuilderFactory
.newInstance()
.newDocumentBuilder()
.parse(new ByteArrayInputStream(("<node>" + xmlString + "</node>").getBytes("UTF-8")))
.getDocumentElement();
} catch (Exception e) {
e.printStackTrace();
}