我试图从www.mkyong.com/webservices/jax-rs/json-example-with-jersey-jackson /
运行这个REST示例但我总是得到这个错误。
[ERROR] SRVE0777E:应用程序类'org.codehaus.jackson.jaxrs.MapperConfigurator._resolveIntrospector:173'抛出的异常 java.lang.IllegalStateException:无法实例化JaxbAnnotationIntrospector:org.codehaus.jackson.xc.JaxbAnnotationIntrospector无法强制转换为org.codehaus.jackson.map.AnnotationIntrospector 在org.codehaus.jackson.jaxrs.MapperConfigurator._resolveIntrospector(MapperConfigurator.java:173) 在org.codehaus.jackson.jaxrs.MapperConfigurator._resolveIntrospectors(MapperConfigurator.java:144) 在org.codehaus.jackson.jaxrs.MapperConfigurator._setAnnotations(MapperConfigurator.java:131) 在org.codehaus.jackson.jaxrs.MapperConfigurator.getDefaultMapper(MapperConfigurator.java:70) 在org.codehaus.jackson.jaxrs.JacksonJsonProvider.locateMapper(JacksonJsonProvider.java:609) 在org.codehaus.jackson.jaxrs.JacksonJsonProvider.writeTo(JacksonJsonProvider.java:488) 在com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy.writeTo(JacksonProviderProxy.java:160) at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1479) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381) 在com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) 在com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537) 在com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:668) 在com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1274) 在[内部班级] 引起:java.lang.ClassCastException:org.codehaus.jackson.xc.JaxbAnnotationIntrospector无法强制转换为org.codehaus.jackson.map.AnnotationIntrospector 在org.codehaus.jackson.jaxrs.MapperConfigurator._resolveIntrospector(MapperConfigurator.java:171) ......还有16个
[ERROR] SRVE0315E:发生了一个execption:com.ibm.ws.webcontainer.webapp.WebAppErrorReport:java.lang.IllegalStateException:无法实例化JaxbAnnotationIntrospector:org.codehaus.jackson.xc.JaxbAnnotationIntrospector无法强制转换为org。 codehaus.jackson.map.AnnotationIntrospector 在org.codehaus.jackson.jaxrs.MapperConfigurator._resolveIntrospector(MapperConfigurator.java:173) 在org.codehaus.jackson.jaxrs.MapperConfigurator._resolveIntrospectors(MapperConfigurator.java:144) 在org.codehaus.jackson.jaxrs.MapperConfigurator._setAnnotations(MapperConfigurator.java:131) 在org.codehaus.jackson.jaxrs.MapperConfigurator.getDefaultMapper(MapperConfigurator.java:70) 在org.codehaus.jackson.jaxrs.JacksonJsonProvider.locateMapper(JacksonJsonProvider.java:609) 在org.codehaus.jackson.jaxrs.JacksonJsonProvider.writeTo(JacksonJsonProvider.java:488) 在com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy.writeTo(JacksonProviderProxy.java:160) at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1479) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381) 在com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) 在com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537) 在com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:668) 在com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1274) 在[内部班级] 引起:java.lang.IllegalStateException:无法实例化JaxbAnnotationIntrospector:org.codehaus.jackson.xc.JaxbAnnotationIntrospector无法强制转换为org.codehaus.jackson.map.AnnotationIntrospector ......还有18个 引起:java.lang.ClassCastException:org.codehaus.jackson.xc.JaxbAnnotationIntrospector无法强制转换为org.codehaus.jackson.map.AnnotationIntrospector 在org.codehaus.jackson.jaxrs.MapperConfigurator._resolveIntrospector(MapperConfigurator.java:171) ......还有16个
任何人都可以帮助我。我的类路径中有以下罐子 -