0

カラフ 2.3.2

私が知る限り、コードまたはコンテナー構成で Apache cxf への参照はありませんが、Exchange Web サービスを使用しようとすると、cxf がインストールされていないため、jax 実装が cxf によって引き継がれ、このエラーが発生します。 :

./data/karaf.out:javax.xml.ws.spi.FactoryFinder$ConfigurationError: プロバイダー org.apache.cxf.jaxws.spi.ProviderImpl が見つかりません

ファイル META-INF\services\javax.xml.ws.spi.Provider をコンテンツ com.sun.xml.internal.ws.spi.ProviderImpl で作成しましたが、Karaf では登録されていないようです。

cxf への参照がないにもかかわらず、cxf をロードしようとしている理由について何か考えはありますか? または、デフォルトの実装の使用を強制する別の方法はありますか?

どうもありがとう

ref の場合、cxf 実装をロードしようとしているように見える provider.provide() メソッド

/** 
 * 
 * Creates a new provider object. 
 * <p>
 * The algorithm used to locate the provider subclass to use consists 
 * of the following steps: 
 * <p>
 * <ul>
 * <li>
 *   If a resource with the name of 
 *   <code>META-INF/services/javax.xml.ws.spi.Provider</code>
 *   exists, then its first line, if present, is used as the UTF-8 encoded 
 *   name of the implementation class. 
 * </li>
 * <li>
 *   If the $java.home/lib/jaxws.properties file exists and it is readable by 
 *   the <code>java.util.Properties.load(InputStream)</code> method and it contains 
 *   an entry whose key is <code>javax.xml.ws.spi.Provider</code>, then the value of 
 *   that entry is used as the name of the implementation class. 
 * </li>
 * <li>
 *   If a system property with the name <code>javax.xml.ws.spi.Provider</code>
 *   is defined, then its value is used as the name of the implementation class. 
 * </li>
 * <li>
 *   Finally, a default implementation class name is used. 
 * </li>
 * </ul>
 * 
 */ 
public static Provider provider() { 
    try { 
        Object provider = getProviderUsingServiceLoader(); 
        if (provider == null) { 
            provider = FactoryFinder.find(JAXWSPROVIDER_PROPERTY, DEFAULT_JAXWSPROVIDER); 
        } 
        if (!(provider instanceof Provider)) { 
            Class pClass = Provider.class; 
            String classnameAsResource = pClass.getName().replace('.', '/') + ".class"; 
            ClassLoader loader = pClass.getClassLoader(); 
            if(loader == null) { 
                loader = ClassLoader.getSystemClassLoader(); 
            } 
            URL targetTypeURL  = loader.getResource(classnameAsResource); 
            throw new LinkageError("ClassCastException: attempting to cast" + 
                   provider.getClass().getClassLoader().getResource(classnameAsResource) + 
                   "to" + targetTypeURL.toString() ); 
        } 
        return (Provider) provider; 
    } catch (WebServiceException ex) { 
        throw ex; 
    } catch (Exception ex) { 
        throw new WebServiceException("Unable to createEndpointReference Provider", ex); 
    } 
} 
4

2 に答える 2

0

まず、CXF バンドルをインストールしないでください。次に、「com.sun.xml.internal.ws.spi」パッケージをシステム バンドルに公開する必要があります。

于 2014-03-28T12:25:07.657 に答える