UI ( UX )/Websquare2015. 1. 27. 10:02

~/websquare/websquare.html?w2xPath=/w2/spring/sample_spring2.xml

웹스퀘어 + 스프링 연동 샘플예제 오류

MediaType : json 선택 시 조회 오류

1월 27, 2015 9:09:36 오전 org.apache.catalina.core.StandardWrapperValve invoke
심각: Servlet.service() for servlet [sample] in context with path [] threw exception [Request processing failed; nested exception is java.lang.ClassCastException: org.json.simple.JSONObject cannot be cast to sample.beans.BaseBean] with root cause
java.lang.ClassCastException: org.json.simple.JSONObject cannot be cast to sample.beans.BaseBean
 at sample.spring.adapter.CustomWqArgumentResolver.resolveArgument(CustomWqArgumentResolver.java:50)
--- 생략 ---

 2) MediaType : xml 시 조회 오류

 [request] org.apache.catalina.connector.RequestFacade@5dbef3d2
[beanDef] @websquare.system.adapter.annotation.BEAN_DEF(beans=[root=sample.beans.SelectBean, infoList=sample.beans.InfoBean, codeList=sample.beans.CodeBean])
1월 27, 2015 9:15:24 오전 org.apache.catalina.core.StandardWrapperValve invoke
심각: Servlet.service() for servlet [sample] in context with path [] threw exception [Request processing failed; nested exception is Unexpected character (<) at position 0.] with root cause
Unexpected character (<) at position 0.
--- 생략 ---

위의 오류 시 websquare.xml (환경설정 파일)을 확인 후 수정 해야 한다.

Websquare 에서는 convertType  server : map/bean client : xml/json 둘 중 하나만 선택 가능하다.

bean, json 을 사용한다면 request, response 설정을 바꿔야 한다.

수정전 :
<convertType server="map" client="json" />

수정후 :
<convertType server="bean" client="json" />

권장은 map , json 이라고 한다.

Posted by 비니미니파파