On Thu, Aug 18, 2011 at 11:46 AM, ant elder <ant.el...@gmail.com> wrote:
> On Tue, Jul 5, 2011 at 9:26 AM,  <sl...@apache.org> wrote:
>> Author: slaws
>> Date: Tue Jul  5 08:26:12 2011
>> New Revision: 1142920
>>
>> URL: http://svn.apache.org/viewvc?rev=1142920&view=rev
>> Log:
>> Re-enable Rampart support in the ws binding so that WS policy can be 
>> applied. Add a test which, for the time being, demonstrates integrity.
>>
>> Added:
>>    
>> tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/wspolicy/
>>    
>> tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/wspolicy/WSPolicyProvider.java
>>    
>> tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/wspolicy/WSPolicyProviderFactory.java
>> Modified:
>>    tuscany/sca-java-2.x/trunk/distribution/all/src/main/release/bin/LICENSE
>>    
>> tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHelper.java
>>    
>> tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/META-INF/MANIFEST.MF
>>    tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/pom.xml
>>    
>> tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2EngineIntegration.java
>>    
>> tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ReferenceBindingProvider.java
>>    
>> tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ServiceBindingProvider.java
>>    
>> tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
>>    tuscany/sca-java-2.x/trunk/modules/policy-wspolicy/pom.xml
>>    
>> tuscany/sca-java-2.x/trunk/modules/policy-wspolicy/src/main/java/org/apache/tuscany/sca/policy/wspolicy/xml/WSPolicyProcessor.java
>>    tuscany/sca-java-2.x/trunk/modules/pom.xml
>>    tuscany/sca-java-2.x/trunk/testing/itest/ws/pom.xml
>>
>> Modified: 
>> tuscany/sca-java-2.x/trunk/distribution/all/src/main/release/bin/LICENSE
>> URL: 
>> http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/distribution/all/src/main/release/bin/LICENSE?rev=1142920&r1=1142919&r2=1142920&view=diff
>> ==============================================================================
>> --- tuscany/sca-java-2.x/trunk/distribution/all/src/main/release/bin/LICENSE 
>> (original)
>> +++ tuscany/sca-java-2.x/trunk/distribution/all/src/main/release/bin/LICENSE 
>> Tue Jul  5 08:26:12 2011
>> @@ -231,7 +231,9 @@ The following components come under Apac
>>  aspectjrt-1.6.8.jar
>>  aspectjweaver-1.6.8.jar
>>  axiom-api-1.2.10.jar
>> + axiom-dom-1.2.10.jar
>>  axiom-impl-1.2.10.jar
>> + axis2-mtompolicy-1.5.4.jar
>>  bsf-utils-3.1.jar
>>  cglib-2.2.jar
>>  commons-beanutils-1.7.0.jar
>> @@ -276,6 +278,7 @@ The following components come under Apac
>>  juli-6.0.26.jar
>>  kahadb-5.3.0.jar
>>  log4j-1.2.15.jar
>> + mex-1.5.4-impl.jar
>>  myfaces-api-1.2.2.jar
>>  myfaces-impl-1.2.2.jar
>>  neethi-2.0.4.jar
>> @@ -295,7 +298,12 @@ The following components come under Apac
>>  ode-scheduler-simple-1.3.2.jar
>>  ode-utils-1.3.2.jar
>>  openjpa-1.2.1.jar
>> + opensaml-2.2.3.jar
>> + openws-1.2.2.jar
>>  org.apache.axis2.osgi-1.5.3.jar
>> + rampart-core-1.5.1.jar
>> + rampart-policy-1.5.1.jar
>> + rampart-trust-1.5.1.jar
>>  regexp-1.3.jar
>>  spring-aop-3.0.5.RELEASE.jar
>>  spring-asm-3.0.5.RELEASE.jar
>> @@ -312,10 +320,13 @@ The following components come under Apac
>>  wink-common-1.1.3-incubating.jar
>>  wink-client-1.1.3-incubating.jar
>>  wink-server-1.1.3-incubating.jar
>> + wss4j-1.5.10.jar
>>  xalan-2.7.0.jar
>>  xercesImpl-2.8.1.jar
>>  xmlbeans-2.3.0.jar
>>  XmlSchema-1.4.3.jar
>> + xmlsec-1.4.4.jar
>> + xmltooling-1.2.0.jar
>>
>>  ===============================================================================
>>  The serp-1.13.1.jar is distributed under the BSD license with the following 
>> copyright:
>>
>> Modified: 
>> tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHelper.java
>> URL: 
>> http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHelper.java?rev=1142920&r1=1142919&r2=1142920&view=diff
>> ==============================================================================
>> --- 
>> tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHelper.java
>>  (original)
>> +++ 
>> tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHelper.java
>>  Tue Jul  5 08:26:12 2011
>> @@ -37,7 +37,7 @@ import org.apache.tuscany.sca.policy.Pol
>>  * @tuscany.spi.extension.asclient
>>  */
>>  public class PolicyHelper {
>> -    public PolicySet getPolicySet(PolicySubject subject, QName 
>> policySetName) {
>> +    public static PolicySet getPolicySet(PolicySubject subject, QName 
>> policySetName) {
>>         for (PolicySet ps : subject.getPolicySets()) {
>>             if (ps.getName().equals(policySetName)) {
>>                 return ps;
>> @@ -46,7 +46,7 @@ public class PolicyHelper {
>>         return null;
>>     }
>>
>> -    public Intent getIntent(Definitions subject, QName intentName) {
>> +    public static Intent getIntent(Definitions subject, QName intentName) {
>>         for (Intent i : subject.getIntents()) {
>>             if (i.getName().equals(intentName)) {
>>                 return i;
>> @@ -55,7 +55,7 @@ public class PolicyHelper {
>>         return null;
>>     }
>>
>> -    public PolicySet getPolicySet(Definitions subject, QName policySetName) 
>> {
>> +    public static PolicySet getPolicySet(Definitions subject, QName 
>> policySetName) {
>>         for (PolicySet ps : subject.getPolicySets()) {
>>             if (ps.getName().equals(policySetName)) {
>>                 return ps;
>> @@ -64,7 +64,7 @@ public class PolicyHelper {
>>         return null;
>>     }
>>
>> -    public Intent getIntent(PolicySubject subject, QName intentName) {
>> +    public static Intent getIntent(PolicySubject subject, QName intentName) 
>> {
>>         for (Intent i : subject.getRequiredIntents()) {
>>             if (i.getName().equals(intentName)) {
>>                 return i;
>> @@ -73,7 +73,7 @@ public class PolicyHelper {
>>         return null;
>>     }
>>
>> -    public Collection<PolicyExpression> getPolicyExpressions(PolicySubject 
>> subject, QName policyName) {
>> +    public static Collection<PolicyExpression> 
>> getPolicyExpressions(PolicySubject subject, QName policyName) {
>>         Collection<PolicyExpression> policies = new 
>> ArrayList<PolicyExpression>();
>>         for (PolicySet ps : subject.getPolicySets()) {
>>             for (PolicyExpression exp : ps.getPolicies()) {
>> @@ -85,7 +85,7 @@ public class PolicyHelper {
>>         return policies;
>>     }
>>
>> -    public Collection<Object> getPolicies(PolicySubject subject, QName 
>> policyName) {
>> +    public static Collection<Object> getPolicies(PolicySubject subject, 
>> QName policyName) {
>>         Collection<Object> policies = new ArrayList<Object>();
>>         for (PolicySet ps : subject.getPolicySets()) {
>>             for (PolicyExpression exp : ps.getPolicies()) {
>> @@ -95,36 +95,18 @@ public class PolicyHelper {
>>             }
>>         }
>>         return policies;
>> -    }
>> -
>> -    public static PolicySet getPolicySet(Binding wsBinding, QName 
>> intentName) {
>> -        PolicySet returnPolicySet = null;
>> -
>> -        if (wsBinding instanceof PolicySubject) {
>> -            PolicySubject policiedBinding = (PolicySubject)wsBinding;
>> -            for (PolicySet policySet : policiedBinding.getPolicySets()) {
>> -                for (Intent intent : policySet.getProvidedIntents()) {
>> -                    if (intent.getName().equals(intentName)) {
>> -                        returnPolicySet = policySet;
>> -                        break;
>> -                    }
>> -                }
>> -            }
>> -        }
>> +    }
>>
>> -        return returnPolicySet;
>> -    }
>> +    public static boolean isIntentRequired(PolicySubject subject, QName 
>> intent) {
>>
>> -    public static boolean isIntentRequired(Binding wsBinding, QName intent) 
>> {
>> -        if (wsBinding instanceof PolicySubject) {
>> -            List<Intent> intents = 
>> ((PolicySubject)wsBinding).getRequiredIntents();
>> -            for (Intent i : intents) {
>> -                if (intent.equals(i.getName())) {
>> -                    return true;
>> -                }
>> +        List<Intent> intents = 
>> ((PolicySubject)subject).getRequiredIntents();
>> +        for (Intent i : intents) {
>> +            if (intent.equals(i.getName())) {
>> +                return true;
>>             }
>>         }
>> -        return getPolicySet(wsBinding, intent) != null;
>> +
>> +        return getPolicySet(subject, intent) != null;
>>     }
>>
>>  }
>>
>> Modified: 
>> tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/META-INF/MANIFEST.MF
>> URL: 
>> http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/META-INF/MANIFEST.MF?rev=1142920&r1=1142919&r2=1142920&view=diff
>> ==============================================================================
>> --- 
>> tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/META-INF/MANIFEST.MF
>>  (original)
>> +++ 
>> tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/META-INF/MANIFEST.MF
>>  Tue Jul  5 08:26:12 2011
>> @@ -91,9 +91,11 @@ Import-Package: javax.servlet,
>>  org.apache.axis2.description,
>>  org.apache.axis2.engine,
>>  org.apache.axis2.handlers,
>> + org.apache.axis2.i18n,
>>  org.apache.axis2.receivers,
>>  org.apache.axis2.transport,
>>  org.apache.axis2.transport.http,
>> + org.apache.axis2.util,
>>  org.apache.axis2.util.threadpool,
>>  org.apache.commons.httpclient,
>>  org.apache.commons.httpclient.params,
>>
>> Modified: tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/pom.xml
>> URL: 
>> http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/pom.xml?rev=1142920&r1=1142919&r2=1142920&view=diff
>> ==============================================================================
>> --- tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/pom.xml 
>> (original)
>> +++ tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/pom.xml Tue 
>> Jul  5 08:26:12 2011
>> @@ -71,16 +71,238 @@
>>                </exclusion>
>>            </exclusions>
>>         </dependency>
>> +
>> +        <dependency>
>> +            <groupId>org.apache.rampart</groupId>
>> +            <artifactId>rampart-core</artifactId>
>> +            <version>1.5.1</version>
>> +           <exclusions>
>> +               <!--
>> +                   We can live without most of the Rampart dependencies. 
>> The following
>> +                   jars were added to Tuscany support Rampart
>> +
>> +                   axiom-dom-1.2.10.jar,
>> +                   mex-1.5.4-impl.jar,
>> +                   not-yet-commons-ssl-0.3.9.jar,
>> +                   opensaml-2.2.3.jar,
>> +                   openws-1.2.2.jar,
>> +                   rampart-core-1.5.1.jar,
>> +                   rampart-policy-1.5.1.jar,
>> +                   rampart-trust-1.5.1.jar,
>> +                   wss4j-1.5.10.jar,
>> +                   xmlsec-1.4.4.jar,
>> +                   xmltooling-1.2.0.jar
>> +               -->
>> +               <exclusion>
>> +                   <groupId>org.apache.axis2</groupId>
>> +                   <artifactId>axis2-kernel</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.apache.axis2</groupId>
>> +                   <artifactId>addressing</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.opensaml</groupId>
>> +                   <artifactId>opensaml1</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>bouncycastle</groupId>
>> +                   <artifactId>bcprov-jdk14</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.bouncycastle</groupId>
>> +                   <artifactId>bcprov-ext-jdk15</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.slf4j</groupId>
>> +                   <artifactId>slf4j-jdk14</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.slf4j</groupId>
>> +                   <artifactId>slf4j-api</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.slf4j</groupId>
>> +                   <artifactId>jcl-over-slf4j</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.slf4j</groupId>
>> +                   <artifactId>log4j-over-slf4j</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>commons-lang</groupId>
>> +                   <artifactId>commons-lang</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>joda-time</groupId>
>> +                   <artifactId>joda-time</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>net.jcip</groupId>
>> +                   <artifactId>jcip-annotations</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>commons-collections</groupId>
>> +                   <artifactId>commons-collections</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>jargs</groupId>
>> +                   <artifactId>jargs</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>velocity</groupId>
>> +                   <artifactId>velocity</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.apache.xerces</groupId>
>> +                   <artifactId>xml-apis</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.apache.xerces</groupId>
>> +                   <artifactId>xercesImpl</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.apache.xerces</groupId>
>> +                   <artifactId>resolver</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.apache.xerces</groupId>
>> +                   <artifactId>serializer</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.apache.geronimo.specs</groupId>
>> +                   <artifactId>geronimo-stax-api_1.0_spec</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.apache.geronimo.specs</groupId>
>> +                   <artifactId>geronimo-activation_1.1_spec</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.codehaus.woodstox</groupId>
>> +                   <artifactId>wstx-asl</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.apache.xalan</groupId>
>> +                   <artifactId>xalan</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.apache.santuario</groupId>
>> +                   <artifactId>xmlsec</artifactId>
>> +               </exclusion>
>> +           </exclusions>
>> +        </dependency>
>> +
>> +        <!--  replace the Rampart xmlsec with the version Tuscany is using 
>> -->
>> +        <dependency>
>> +            <groupId>org.apache.santuario</groupId>
>> +            <artifactId>xmlsec</artifactId>
>> +            <version>1.4.4</version>
>> +            <exclusions>
>> +               <exclusion>
>> +                   <groupId>commons-logging</groupId>
>> +                   <artifactId>commons-logging</artifactId>
>> +               </exclusion>
>> +           </exclusions>
>> +        </dependency>
>> +
>> +        <dependency>
>> +            <groupId>org.opensaml</groupId>
>> +            <artifactId>opensaml</artifactId>
>> +            <version>2.2.3</version>
>> +            <exclusions>
>> +               <exclusion>
>> +                   <groupId>org.slf4j</groupId>
>> +                   <artifactId>slf4j-jdk14</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.slf4j</groupId>
>> +                   <artifactId>slf4j-api</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.slf4j</groupId>
>> +                   <artifactId>jcl-over-slf4j</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.slf4j</groupId>
>> +                   <artifactId>log4j-over-slf4j</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>commons-lang</groupId>
>> +                   <artifactId>commons-lang</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>joda-time</groupId>
>> +                   <artifactId>joda-time</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>net.jcip</groupId>
>> +                   <artifactId>jcip-annotations</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.bouncycastle</groupId>
>> +                   <artifactId>bcprov-ext-jdk15</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.apache.commons.ssl</groupId>
>> +                   <artifactId>not-yet-commons-ssl</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>commons-collections</groupId>
>> +                   <artifactId>commons-collections</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>jargs</groupId>
>> +                   <artifactId>jargs</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>velocity</groupId>
>> +                   <artifactId>velocity</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.apache.xerces</groupId>
>> +                   <artifactId>xml-apis</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.apache.xerces</groupId>
>> +                   <artifactId>xercesImpl</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.apache.xerces</groupId>
>> +                   <artifactId>resolver</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.apache.xerces</groupId>
>> +                   <artifactId>serializer</artifactId>
>> +               </exclusion>
>> +               <exclusion>
>> +                   <groupId>org.apache.xalan</groupId>
>> +                   <artifactId>xalan</artifactId>
>> +               </exclusion>
>> +            </exclusions>
>> +        </dependency>
>> +
>> +        <!--  replace the Rampart xalan with the version Tuscany is using 
>> -->
>> +        <dependency>
>> +            <groupId>xalan</groupId>
>> +            <artifactId>xalan</artifactId>
>> +            <version>2.7.0</version>
>> +            <exclusions>
>> +               <exclusion>
>> +                   <groupId>xml-apis</groupId>
>> +                   <artifactId>xml-apis</artifactId>
>> +               </exclusion>
>> +            </exclusions>
>> +        </dependency>
>>
>
> I've found one of the reasons for the random fails i've been seeing
> when running with different jdks and mvn/eclipse and its from this
> including xalan which i think conflicts with some of the base jdk
> classes. One example is the async-services hangs with jms is fixed in
> mvn when this dependency is excluded. Do you know if its actually
> needed if we're running with JDK6? ( i do have a full build running
> now to see what happens if i take it out of the ws binding pom.xml but
> asking to see if it was added for a specific reason)
>
>   ...ant
>

Not off the top of my head.At the time is made this change Rampart was
pulling in an extra version so I replaced this with the versoin the
build at the time was pulling in elsewhere so that we only had one
version.  If if builds without it exclude it.

Simon

-- 
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com

Reply via email to