json 디펜던시
- 작성자 :
- 박*우
- 작성일 :
- 2013-06-05 17:40:42
- 조회수 :
- 2,185
- 구분 :
- 개발환경
- 진행상태 :
- 완료
Q
ajax-json 을 테스트 하려는데 json 디펜던시 문제가 있습니다.
json 어떤걸 사용해야 하나요?
[org.springframework.http.converter.json.MappingJacksonHttpMessageConverter]: Constructor threw exception; nested exception is java.lang.VerifyError: (class: org/codehaus/jackson/map/ObjectMapper, method: <init> signature: (Lorg/codehaus/jackson/JsonFactory;Lorg/codehaus/jackson/map/SerializerProvider;Lorg/codehaus/jackson/map/DeserializerProvider;Lorg/codehaus/jackson/map/SerializationConfig;Lorg/codehaus/jackson/map/DeserializationConfig;)V) Bad type in putfield/putstatic
이런 에러 나거나
[/WEB-INF/config/egovframework/springmvc/dispatcher-servlet.xml]: Cannot create inner bean 'org.springframework.http.converter.json.MappingJacksonHttpMessageConverter#709a1411' of type [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter] while setting bean property 'messageConverters' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.http.converter.json.MappingJacksonHttpMessageConverter#709a1411' defined in ServletContext resource [/WEB-INF/config/egovframework/springmvc/dispatcher-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter]: Constructor threw exception; nested exception is java.lang.VerifyError: Cannot inherit from final class
이런 에러가 납니다.
위에건
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.12</version>
</dependency>
이걸 썼고
아래 에러는
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-lgpl</artifactId>
<version>1.9.12</version>
</dependency>
이렇게 디펜던시 설정을 했습니다.
컨버터 설정은 아래와 같습니다.
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="webBindingInitializer">
<bean class="iwe.cmmn.web.EgovBindingInitializer"/>
</property>
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"></bean>
</list>
</property>
</bean>
ajax , json 관련 디펜던시 설정 정보를 알려 주시면 좋겠습니다.
감사 합니다.
json 어떤걸 사용해야 하나요?
[org.springframework.http.converter.json.MappingJacksonHttpMessageConverter]: Constructor threw exception; nested exception is java.lang.VerifyError: (class: org/codehaus/jackson/map/ObjectMapper, method: <init> signature: (Lorg/codehaus/jackson/JsonFactory;Lorg/codehaus/jackson/map/SerializerProvider;Lorg/codehaus/jackson/map/DeserializerProvider;Lorg/codehaus/jackson/map/SerializationConfig;Lorg/codehaus/jackson/map/DeserializationConfig;)V) Bad type in putfield/putstatic
이런 에러 나거나
[/WEB-INF/config/egovframework/springmvc/dispatcher-servlet.xml]: Cannot create inner bean 'org.springframework.http.converter.json.MappingJacksonHttpMessageConverter#709a1411' of type [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter] while setting bean property 'messageConverters' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.http.converter.json.MappingJacksonHttpMessageConverter#709a1411' defined in ServletContext resource [/WEB-INF/config/egovframework/springmvc/dispatcher-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter]: Constructor threw exception; nested exception is java.lang.VerifyError: Cannot inherit from final class
이런 에러가 납니다.
위에건
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.12</version>
</dependency>
이걸 썼고
아래 에러는
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-lgpl</artifactId>
<version>1.9.12</version>
</dependency>
이렇게 디펜던시 설정을 했습니다.
컨버터 설정은 아래와 같습니다.
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="webBindingInitializer">
<bean class="iwe.cmmn.web.EgovBindingInitializer"/>
</property>
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"></bean>
</list>
</property>
</bean>
ajax , json 관련 디펜던시 설정 정보를 알려 주시면 좋겠습니다.
감사 합니다.
A
안녕하세요. 박성우님
모바일 공통컴포넌트에서는 참고하는 json 라이브러리입니다.
<dependency>
<groupId>net.sf.json-lib<groupId>
<artifactId>json-lib<artifactId>
<version>2.4<version>
<classifier>jdk15<classifier>
<dependency>
고맙습니다.
모바일 공통컴포넌트에서는 참고하는 json 라이브러리입니다.
<dependency>
<groupId>net.sf.json-lib<groupId>
<artifactId>json-lib<artifactId>
<version>2.4<version>
<classifier>jdk15<classifier>
<dependency>
고맙습니다.