1

私は 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モジュール内にある必要があります。これは単なる警告ですが、Google でこれに関するヒントをいくつか見つけたにすぎず、これを無視するか、解決策を見つけるかを考えています。これは単なる警告であり、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>
4

1 に答える 1

2

この警告を回避するには、次のことを試してください。

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());はもう必要ありません!

于 2013-04-23T22:41:30.127 に答える