2017-02-20 111 views
0

我使用Axis2版本1.6.0從wsdl文件生成java類。Java客戶端Axis2 OMException

當我打電話,我得到以下異常服務:

org.apache.axiom.om.OMException:沒有工廠薈萃發現功能 「默認」;這通常意味着公理-impl.jar中不在類路徑 或該META-INF/axiom.xml資源不能被讀

使用的依賴關係的axis2是:

 <dependency> 
      <groupId>org.apache.ws.commons.schema</groupId> 
      <artifactId>XmlSchema</artifactId> 
      <version>1.4.7</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.axis2</groupId> 
      <artifactId>axis2</artifactId> 
      <version>1.6.2</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.ws.commons.axiom</groupId> 
      <artifactId>axiom-api</artifactId> 
      <version>1.2.12</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.ws.commons.axiom</groupId> 
      <artifactId>axiom-impl</artifactId> 
      <version>1.2.12</version> 
     </dependency> 

我如何解決這個異常?

回答

0

我發現這個解決方案,即在Axis2中1.6.2 axiom.xml不存在的,所以我繼續使用下面的依賴關係:

<!-- Start minimal dependency for axis2 --> 
     <dependency> 
      <groupId>org.apache.ws.commons.schema</groupId> 
      <artifactId>XmlSchema</artifactId> 
      <version>1.4.7</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.axis2</groupId> 
      <artifactId>axis2</artifactId> 
      <version>1.6.1</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.ws.commons.axiom</groupId> 
      <artifactId>axiom-api</artifactId> 
      <version>1.2.12</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.ws.commons.axiom</groupId> 
      <artifactId>axiom-impl</artifactId> 
      <version>1.2.12</version> 
     </dependency> 

     <!-- https://mvnrepository.com/artifact/org.apache.neethi/neethi --> 
     <dependency> 
      <groupId>org.apache.neethi</groupId> 
      <artifactId>neethi</artifactId> 
      <version>2.0.2</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.axis2</groupId> 
      <artifactId>axis2-adb</artifactId> 
      <version>1.5.4</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.axis2</groupId> 
      <artifactId>axis2-transport-local</artifactId> 
      <version>1.5.4</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.axis2</groupId> 
      <artifactId>axis2-transport-http</artifactId> 
      <version>1.5.4</version> 
     </dependency> 

     <!-- https://mvnrepository.com/artifact/org.apache.axis2/axis2-kernel --> 
     <dependency> 
      <groupId>org.apache.axis2</groupId> 
      <artifactId>axis2-kernel</artifactId> 
      <version>1.5.4</version> 
     </dependency> 
     <!-- https://mvnrepository.com/artifact/commons-codec/commons-codec --> 
     <dependency> 
      <groupId>commons-codec</groupId> 
      <artifactId>commons-codec</artifactId> 
      <version>1.3</version> 
     </dependency> 
     <!-- https://mvnrepository.com/artifact/commons-httpclient/commons-httpclient --> 
     <dependency> 
      <groupId>commons-httpclient</groupId> 
      <artifactId>commons-httpclient</artifactId> 
      <version>3.1</version> 
     </dependency> 
     <!-- https://mvnrepository.com/artifact/commons-logging/commons-logging --> 
     <dependency> 
      <groupId>commons-logging</groupId> 
      <artifactId>commons-logging</artifactId> 
      <version>1.1.1</version> 
     </dependency> 
     <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore --> 
     <dependency> 
      <groupId>org.apache.httpcomponents</groupId> 
      <artifactId>httpcore</artifactId> 
      <version>4.0</version> 
     </dependency> 
     <!-- https://mvnrepository.com/artifact/wsdl4j/wsdl4j --> 
     <dependency> 
      <groupId>wsdl4j</groupId> 
      <artifactId>wsdl4j</artifactId> 
      <version>1.6.2</version> 
     </dependency> 
     <!-- https://mvnrepository.com/artifact/javax.mail/mail --> 
     <dependency> 
      <groupId>javax.mail</groupId> 
      <artifactId>mail</artifactId> 
      <version>1.4</version> 
     </dependency> 
     <!-- End dependency axis2 -->