我使用的是RestEasy客户端框架,并且有一个包含以下代码的WARN:
RegisterBuiltin.register(ResteasyProviderFactory.getInstance());
// [WARN] org.jboss.resteasy.logging.impl.Log4jLogger-103: NoClassDefFoundError:
// Unable to load builtin provider:
// org.jboss.resteasy.plugins.providers.DocumentProvider根据GrepCode的说法,这个类应该在resteasy-jaxrs模块中。这只是一个警告,但我在谷歌上只找到了几个提示,我想知道我是应该忽略它还是找到解决方案,因为这只是一个警告,而不是CNFE。下面的代码可以正常工作。
<dependencyManagement>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-bom</artifactId>
<version>2.3.1.GA</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
</dependency>
</dependencies>发布于 2013-04-24 06:41:30
要避免此警告,请尝试执行以下操作:
public class SomeClass
{
static {ResteasyProviderFactory.setRegisterBuiltinByDefault(false);}
public static void main(String[] args) {}
}根据http://docs.jboss.org/resteasy/2.0.0.GA/userguide/html/Migration_from_older_versions.html更新方法调用RegisterBuiltin.register(ResteasyProviderFactory.getInstance());不再需要了!
https://stackoverflow.com/questions/10615540
复制相似问题