2011-10-12 48 views
3

我們已經有了一個Maven的集成測試使用Axis2客戶機壁壘rampart.mar被指定爲pom中的依賴項,但是maven並未將其包含在classpath中。軸需要加載rampart模塊。的Apache Axis2的/壁壘+ Maven的

有沒有人有解決方案?

的pom.xml片段:

<dependency> 
      <groupId>org.apache.rampart</groupId> 
      <artifactId>rampart</artifactId> 
      <version>1.4</version> 
      <type>mar</type> 
</dependency> 
+0

也許你可以分享相關的POM片段混淆? – Raghuram

+0

你能請在看[這裏](http://stackoverflow.com/questions/28979339/exception-while-running-the-client-request-to-rampart-samples-in-tomcat-the-sec)問題 – dileepVikram

回答

1

我用axis2-1.6.0與壁壘-1.6.0具有以下POM摘錄:

<!-- axis2/axiom: dependencies --> 
<dependency> 
     <groupId>org.apache.axis2</groupId> 
     <artifactId>axis2</artifactId> 
     <version>${axis2.version}</version> 
</dependency> 
<dependency> 
    <groupId>org.apache.axis2</groupId> 
    <artifactId>axis2-transport-local</artifactId> 
    <version>${axis2.version}</version> 
</dependency> 
<dependency> 
    <groupId>org.apache.axis2</groupId> 
    <artifactId>axis2-transport-http</artifactId> 
    <version>${axis2.version}</version> 
</dependency>   
<dependency> 
    <groupId>org.apache.axis2</groupId> 
    <artifactId>axis2-codegen</artifactId> 
    <version>${axis2.version}</version> 
    <scope>provided</scope> 
</dependency> 

<!-- axis2-rampart: dependencies --> 
<dependency> 
    <groupId>org.apache.rampart</groupId> 
    <artifactId>rampart-core</artifactId> 
    <version>${axis2.version}</version> 
    <exclusions> 
     <exclusion> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-jdk14</artifactId> 
     </exclusion> 
     <exclusion> 
      <artifactId>log4j-over-slf4j</artifactId> 
      <groupId>org.slf4j</groupId> 
     </exclusion> 
    </exclusions> 
</dependency> 
<!-- slf4j: dependencies --> 
<dependency> 
    <groupId>org.slf4j</groupId> 
    <artifactId>slf4j-api</artifactId> 
    <version>${slf4j.version}</version> 
</dependency> 
<dependency> 
    <groupId>org.slf4j</groupId> 
    <artifactId>slf4j-log4j12</artifactId> 
    <version>${slf4j.version}</version> 
    <!-- 
    <scope>runtime</scope> 
    --> 
</dependency> 
<dependency> 
    <groupId>org.slf4j</groupId> 
    <artifactId>jcl-over-slf4j</artifactId> 
    <version>${slf4j.version}</version> 
</dependency> 
<!-- log4j: dependencies --> 
<dependency> 
    <groupId>log4j</groupId> 
    <artifactId>log4j</artifactId> 
    <version>${log4j.version}</version> 
    <exclusions> 
    <exclusion> 
     <artifactId>jmxtools</artifactId> 
     <groupId>com.sun.jdmk</groupId> 
    </exclusion> 
    <exclusion> 
     <artifactId>jmxri</artifactId> 
     <groupId>com.sun.jmx</groupId> 
    </exclusion> 
    <exclusion> 
     <artifactId>mail</artifactId> 
     <groupId>javax.mail</groupId> 
    </exclusion> 
    <exclusion> 
     <artifactId>jms</artifactId> 
     <groupId>javax.jms</groupId> 
    </exclusion> 
    </exclusions> 
</dependency> 

<properties> 
<slf4j.version>1.6.3</slf4j.version> 
    <log4j.version>1.2.15</log4j.version> 
    <axis2.version>1.6.0</axis2.version> 
    <rampart.version>1.6.0</rampart.version> 
</properties> 

然而,在服務用法客戶端或服務器,您需要指定axis2-repository運行時位置。

 // get Modulrepository 
     ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_REPOSITORY, null); 

     // create new Stub 
     Stub stub = createStub(ctx); 

     // configure and engage Rampart 
     ServiceClient client = stub._getServiceClient(); 


     Options options = client.getOptions();  

     // modify charset 
     options.setProperty(org.apache.axis2.Constants.Configuration.CHARACTER_SET_ENCODING, charsetEncoding); 


     // // modify endpoint 
     // options.setTo(new org.apache.axis2.addressing.EndpointReference(ENDPOINT_LOCATION)); 

     // modify policies 
     Policy policy = loadPolicy(POLICY_FILE); 
     client.getAxisService().getPolicySubject().attachPolicy(policy); 

其實我已經有了一個最終的計算器錯誤,因爲neethy策略驗證更新的一些問題axis2-1.6.1

+0

你能請在看[這裏](http://stackoverflow.com/questions/28979339/exception-while-running-the-client-request-to-rampart-samples-in-tomcat-the-sec)問題 – dileepVikram

0

保持和眼睛。

http://www.slf4j.org/legacy.html JCL-過slf4j.jar不應與SLF4J-jcl.jar

+0

你能請在看[這裏](http://stackoverflow.com/questions/28979339/exception-while-running-the-client-request-to-rampart-samples-in-tomcat-the-sec)問題 – dileepVikram