java.lang.NoClassDefFoundError: javax/enterprise/context/spi/Contextual
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0(Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:139)
at org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap.contextInitialized(ResteasyBootstrap.java:28)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: javax.enterprise.context.spi.Contextual
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 17 more
在Tomcat服务器下报错,换成Jboss服务器异常消失。
ERROR Could not instantiate appender named "warn".
在Maven项目中同时引用了slf4j和log4j,删除slf4j后不输出。
严重: Exception sending context initialized event to listener instance of class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
java.lang.NoSuchMethodError: javax.ws.rs.ConstrainedTo.value()Ljavax/ws/rs/RuntimeType;
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1371)
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1085)
at org.jboss.resteasy.plugins.providers.RegisterBuiltin.registerProviders(RegisterBuiltin.java:70)
at org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterBuiltin.java:31)
at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:212)
at org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap.contextInitialized(ResteasyBootstrap.java:28)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
2013-5-7 9:50:25 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
2013-5-7 9:50:25 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.jboss.resteasy.plugins.spring.SpringContextLoaderListener
java.lang.RuntimeException: RESTeasy Provider Factory is null, do you have the ResteasyBootstrap listener configured?
at org.jboss.resteasy.plugins.spring.SpringContextLoaderSupport.customizeContext(SpringContextLoaderSupport.java:44)
at org.jboss.resteasy.plugins.spring.SpringContextLoader.customizeContext(SpringContextLoader.java:19)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:275)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.jboss.resteasy.plugins.spring.SpringContextLoaderListener.contextInitialized(SpringContextLoaderListener.java:44)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
2013-5-7 9:50:25 org.apache.catalina.core.StandardContext startInternal
严重: Error listenerStart
2013-5-7 9:50:25 org.apache.catalina.core.StandardContext startInternal
严重: Context [/dci-services-web] startup failed due to previous errors
2013-5-7 9:50:25 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2013-5-7 9:50:25 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(E:\eclipsejuno\eclipse\workspaces\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\dci-services-webapp\WEB-INF\lib\geronimo-servlet_3.0_spec-1.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
log4j:ERROR Could not find value for key log4j.appender.warn
log4j:ERROR Could not instantiate appender named "warn".
2013-5-7 9:50:33 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
2013-5-7 9:50:33 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.jboss.resteasy.plugins.spring.SpringContextLoaderListener
java.lang.RuntimeException: RESTeasy Provider Factory is null, do you have the ResteasyBootstrap listener configured?
at org.jboss.resteasy.plugins.spring.SpringContextLoaderSupport.customizeContext(SpringContextLoaderSupport.java:44)
at org.jboss.resteasy.plugins.spring.SpringContextLoader.customizeContext(SpringContextLoader.java:19)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:275)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.jboss.resteasy.plugins.spring.SpringContextLoaderListener.contextInitialized(SpringContextLoaderListener.java:44)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
2013-5-7 9:50:33 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
java.lang.NoSuchMethodError: javax.ws.rs.ConstrainedTo.value()Ljavax/ws/rs/RuntimeType;
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1371)
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1085)
at org.jboss.resteasy.plugins.providers.RegisterBuiltin.registerProviders(RegisterBuiltin.java:70)
at org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterBuiltin.java:31)
at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:212)
at org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap.contextInitialized(ResteasyBootstrap.java:28)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
2013-5-7 9:50:33 org.apache.catalina.core.StandardContext startInternal
严重: Error listenerStart
2013-5-7 9:50:33 org.apache.catalina.core.StandardContext startInternal
严重: Context [/dci-services-webapp] startup failed due to previous errors
2013-5-7 9:50:33 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2013-5-7 9:50:33 org.apache.coyote.AbstractProtocol start
解决方案:Maven依赖包之间发生冲突,查找javax.ws.rs.RunType所在类,看是否有两个版本。
原因解释:在Maven引用包时,很多使用的是隐式引用,可能不同组件引用的包之间产生了冲突,怎么去查找隐式依赖关系呢,Eclipse中提供了一个Dependency Hierarchy。找到冲突包后,Exclude就OK了。
分享到:
相关推荐
**Spring整合RestEasy示例工程源码解析** 在现代Web开发中,Spring框架因其强大的功能和灵活性而被广泛采用,而RESTful API设计已经成为服务端与客户端交互的标准方式。RestEasy是一个优秀的Java RESTful Web ...
在本文中,我们将深入探讨如何使用RESTEasy和Guice框架实现文件的上传与下载功能。RESTEasy是一个基于Java的RESTful Web服务实现,它与Java EE应用服务器集成,而Guice是Google提供的一款轻量级依赖注入框架,帮助...
RestEasy与Netty结合使用,可以构建高性能的RESTful服务,摆脱传统的Servlet容器如Tomcat的依赖。RestEasy是JBoss公司开发的一个Java框架,它实现了JSR 311和JSR 339(Java API for RESTful Web Services)标准,...
resteasy
【RESTEasy HelloWorld 示例详解】 RESTEasy 是一个开源的 Java 框架,它实现了 JAX-RS(Java API for RESTful Web Services)规范,使得开发者能够轻松地在 Java 应用程序中创建 RESTful 服务。JAX-RS 是一种用于...
RESTEasy是一个开源的Java框架,它实现了JSR 311和JSR 339(JAX-RS)标准,用于在Java EE环境中构建RESTful Web服务。它提供了多种功能,包括注解驱动的接口、拦截器、转换服务、异常处理等。在使用RESTEasy时,通常...
Resteasy 是一个开源的 JAX-RS 实现,它允许开发者构建 RESTful Web 服务,并在 Java 应用程序中轻松地使用这些服务。JAX-RS(Java API for RESTful Web Services)是 Java 中的一个标准,用于创建基于 HTTP 的 REST...
Resteasy是一款开源的Java框架,专门用于实现RESTful(Representational State Transfer)Web服务。它是一个JAX-RS(Java API for RESTful Web Services)的实现,允许开发人员轻松地在Java应用程序中创建和消费REST...
RESTEasy是一个开源的JAX-RS实现,它允许开发者以简单的方式构建RESTful Web服务。JAX-RS是Java API for RESTful Web Services的缩写,是一个Java编程语言的API,用于开发Web服务和基于Web的应用程序。RESTEasy不仅...
**RESTEasy 概述** RESTEasy 是一个 Java 框架,它实现了 JAX-RS(Java API for RESTful Web Services)规范,使得开发者能够轻松地构建基于 REST 的 Web 服务。RESTEasy 集成了多种 Java EE 容器,如 Tomcat、...
RESTEasy是一款支持Java的RESTful Web Services实现,它是JAX-RS标准的一个参考实现。JAX-RS(Java API for RESTful Web Services)是一个Java编程语言的应用程序接口,用于开发基于REST架构风格的Web服务。RESTEasy...
RESTEasy是一款开源的Java框架,专门用于实现JAX-RS(Java API for RESTful Web Services)规范,使得开发RESTful Web服务变得更加简单。RESTEasy集成了多种Java EE应用服务器,如Tomcat、Jetty以及WildFly等,为...
Resteasy是Java应用程序开发中的一个关键组件,它是一个开源的JAX-RS(Java API for RESTful Web Services)实现。JAX-RS是Java标准,用于构建RESTful Web服务,而Resteasy则提供了丰富的功能来支持这一标准。在这个...
**RestEasy简介** RestEasy是一款基于Java的RESTful Web服务框架,它被广泛应用于JAX-RS(Java API for RESTful Web Services)规范的实现。RESTful架构风格是Web服务设计的一种流行方式,强调资源的识别和通过HTTP...
RESTEasy是一个由JBoss开发的开源项目,专门用于构建RESTful Web Services。REST(Representational State Transfer)是一种轻量级的Web服务设计风格,强调简单、直接的HTTP协议使用,与SOAP等较重的Web服务协议相比...
Resteasy + Spring + Netty sample Inject resteasy provider / controllers as spring bean Authentication Run at Main.java Test http://localhost:8082/resteasy/hello/world 教程 jax-rs规范用法: ...
RESTEasy是Java EE环境中一个流行的开源框架,专门用于实现RESTful Web服务。它与Java EE应用程序服务器集成,如JBoss AS、WildFly等,提供了一种简单的方式来创建和消费REST API。本文将深入探讨如何使用RESTEasy...
RestEasy实例Demo是一个理想的起点,尤其对于初学者来说,它能快速让你理解并掌握RESTful服务的开发。RestEasy是一个开源的Java框架,它实现了JSR 311(Java API for RESTful Web Services)和JSR 339(Java API for...
RESTEasy是Java中一个流行的RESTful Web服务框架,它允许开发者轻松地创建和消费REST API。在RESTEasy中,身份验证是确保只有授权用户能够访问受保护资源的关键机制。由于RESTEasy是基于Servlet容器运行的,因此它...
RESTEasy 是一个开源的 JBoss 项目,它实现了 Java API for RESTful Web Services (JAX-RS) 规范,使开发人员能够轻松地在 Java 应用程序中创建 RESTful Web 服务。RESTEasy 与 Java EE 和 Java SE 兼容,并广泛应用...