programming/jsp

[jsp] json-lib 를 이용한 list -> json 으로 뽑기 jdk1.4, json-lib-2.3-jdk13

labj 2013. 4. 3. 15:03
[jsp] json-lib 를 이용한 list -> json 으로 뽑기 jdk1.4,  json-lib-2.3-jdk13

 톰캣 7에서 잘 돌아가던 API 웹서버를 JDK 1.4에서 돌아가도록 만들어야 해서

라이브러리를 JDK 1.4에 맞추어서 설치 테스트를 했는데 오류가 발생 했습니다.

나중에 알고 보니 json-lib-2.4-jdk13.jar를 사용해서 발생한 문제였습니다.

json-lib-2.3-jdk13.jar로 변경하고 나서 문제가 해결 되었습니다.

덕분에 json-lib 라이브러리 공부는 열심히 했네요 ^^


[JDK1.4에서 돌리기 위한 library 목록]

맨 아래 이미지


[자바소스 위치]
JSONArray jArray = new JSONArray();
jArray = JSONArray.fromObject(JSONSerializer.toJSON(list));  

 

[오류 로그]

Could not complete request
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoSuchMethodError: java.lang.ThreadLocal.remove()V
Caused by:
java.lang.NoSuchMethodError: java.lang.ThreadLocal.remove()V
 at net.sf.json.AbstractJSON.removeInstance(AbstractJSON.java:221)
 at net.sf.json.JSONArray._fromCollection(JSONArray.java:909)
 at net.sf.json.JSONArray.fromObject(JSONArray.java:118)
 at net.sf.json.JSONSerializer.toJSON(JSONSerializer.java:105)
 at net.sf.json.JSONSerializer.toJSON(JSONSerializer.java:84)
 at kr.actsoft.dlms.booking.web.KoreaLoginCtrl.sessionLogin2(KoreaLoginCtrl.java:80)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:428)
 at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:366)
 at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
 at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:857)
 at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792)
 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:475)
 at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:430)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:720)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:199)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:145)
 at kr.actsoft.commons.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:102)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:165)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:145)
 at kr.actsoft.commons.filter.EncodingFilter.doFilter(EncodingFilter.java:80)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:165)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:145)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
 at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:139)
 at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
 at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2460)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
 at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
 at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:119)
 at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
 at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
 at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
 at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:157)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 at java.lang.Thread.run(Thread.java:534)

 

- JDK1.4에서 돌리기 위한 library 목록






[jsp] json-lib 를 이용한 list -> json 으로 뽑기 jdk1.4, json-lib-2.3-jdk13