cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r567114 - in /incubator/cxf/trunk: parent/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ rt/frontend/jaxws/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ systests/
Date Fri, 17 Aug 2007 19:21:04 GMT
Author: dkulp
Date: Fri Aug 17 12:21:01 2007
New Revision: 567114

URL: http://svn.apache.org/viewvc?view=rev&rev=567114
Log:
[CXF-915] Update to allow any version of ASM to be on the classpath, downgrade to asm 2.2.3
Fix l7n log messages in RPCInInterceptor
For RCP/Lit reading, just look at localpart of part accessors

Modified:
    incubator/cxf/trunk/parent/pom.xml
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/pom.xml
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelper.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java
    incubator/cxf/trunk/systests/pom.xml

Modified: incubator/cxf/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/parent/pom.xml?view=diff&rev=567114&r1=567113&r2=567114
==============================================================================
--- incubator/cxf/trunk/parent/pom.xml (original)
+++ incubator/cxf/trunk/parent/pom.xml Fri Aug 17 12:21:01 2007
@@ -621,7 +621,7 @@
             <dependency>
                 <groupId>asm</groupId>
                 <artifactId>asm</artifactId>
-                <version>3.0</version>
+                <version>2.2.3</version>
             </dependency>
             <dependency>
                 <groupId>velocity</groupId>

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java?view=diff&rev=567114&r1=567113&r2=567114
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
Fri Aug 17 12:21:01 2007
@@ -26,6 +26,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
 
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.interceptor.AbstractInDatabindingInterceptor;
 import org.apache.cxf.interceptor.BareInInterceptor;
@@ -44,7 +45,7 @@
 
 public class RPCInInterceptor extends AbstractInDatabindingInterceptor {
 
-    private static final Logger LOG = Logger.getLogger(RPCInInterceptor.class.getName());
+    private static final Logger LOG = LogUtils.getL7dLogger(RPCInInterceptor.class);
     
     public RPCInInterceptor() {
         super(Phase.UNMARSHAL);
@@ -106,7 +107,13 @@
             }
             if (hasNext) {
                 QName qn = xmlReader.getName();
-                while (!qn.equals(part.getConcreteName())
+                // WSI-BP states that RPC/Lit part accessors should be completely unqualified
+                // However, older toolkits (Axis 1.x) are qualifying them.   We'll go
+                // ahead and just match on the localpart.   The RPCOutInterceptor
+                // will always generate WSI-BP compliant messages so it's unknown if
+                // the non-WSI-BP toolkits will be able to understand the CXF
+                // generated messages if they are expecting it to be qualified.
+                while (!qn.getLocalPart().equals(part.getConcreteName().getLocalPart())
                     && itr.hasNext()) {
                     part = itr.next();
                 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/pom.xml?view=diff&rev=567114&r1=567113&r2=567114
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/pom.xml (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/pom.xml Fri Aug 17 12:21:01 2007
@@ -62,6 +62,7 @@
         <dependency>
             <groupId>asm</groupId>
             <artifactId>asm</artifactId>
+            <optional>true</optional>
         </dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelper.java?view=diff&rev=567114&r1=567113&r2=567114
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelper.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelper.java
Fri Aug 17 12:21:01 2007
@@ -287,7 +287,7 @@
                         }
                     } else if (setMethods[x] != null) {
                         setMethods[x].invoke(ret, o);
-                    } else {
+                    } else if (fields[x] != null) {
                         fields[x].set(ret, lst.get(x));
                     }
                 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java?view=diff&rev=567114&r1=567113&r2=567114
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java
Fri Aug 17 12:21:01 2007
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.jaxws.interceptors;
 
+import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.util.Collection;
@@ -35,6 +36,9 @@
 final class WrapperHelperCompiler {
     private static final Map<Class<?>, String> PRIMITIVE_MAP = new HashMap<Class<?>,
String>();
     private static final Map<Class<?>, String> NONPRIMITIVE_MAP = new HashMap<Class<?>,
String>();
+    
+    private static boolean oldASM;
+    
     static {
         PRIMITIVE_MAP.put(Byte.TYPE, "B");
         PRIMITIVE_MAP.put(Boolean.TYPE, "Z");
@@ -76,8 +80,39 @@
         this.fields = fields;
         this.objectFactory = objectFactory;
         
-        cw = new ClassWriter(ClassWriter.COMPUTE_MAXS 
-                            | ClassWriter.COMPUTE_FRAMES);
+
+        ClassWriter newCw = null;
+        if (!oldASM) {
+            Class<ClassWriter> cls = ClassWriter.class;
+            try {
+                //ASM 1.5.x/2.x
+                Constructor<ClassWriter> cons = cls.getConstructor(new Class<?>[]
{Boolean.TYPE});
+                
+                try {
+                    //got constructor, now check if it's 1.x which is very different from
2.x and 3.x 
+                    cls.getMethod("newConstInt", new Class<?>[] {Integer.TYPE});  
            
+                    //newConstInt was removed in 2.x, if we get this far, we're using 1.5.x,
+                    //set to null so we don't attempt to use it.
+                    newCw = null;    
+                    oldASM = true;
+                } catch (Throwable t) {
+                    newCw = cons.newInstance(new Object[] {Boolean.TRUE});
+                }
+                
+            } catch (Throwable e) {
+                //ASM 3.x
+                try {
+                    Constructor<ClassWriter> cons = cls.getConstructor(new Class<?>[]
{Integer.TYPE});
+                    int i = cls.getField("COMPUTE_MAXS").getInt(null);
+                    i |= cls.getField("COMPUTE_FRAMES").getInt(null);
+                    newCw = cons.newInstance(new Object[] {Integer.valueOf(i)});
+                } catch (Throwable e1) {
+                    //ignore
+                }
+                
+            }
+        }
+        cw = newCw;
     }
 
     static WrapperHelper compileWrapperHelper(Class<?> wrapperType,
@@ -86,15 +121,23 @@
                                               Method jaxbMethods[],
                                               Field fields[],
                                               Object objectFactory) {
-        return new WrapperHelperCompiler(wrapperType,
+        try {
+            return new WrapperHelperCompiler(wrapperType,
                                         setMethods,
                                         getMethods,
                                         jaxbMethods,
                                         fields,
                                         objectFactory).compile();
+        } catch (Throwable t) {
+            //Some error - probably a bad version of ASM or similar
+            return null;
+        }
     }
 
     public WrapperHelper compile() {
+        if (cw == null) {
+            return null;
+        }
         String newClassName = wrapperType.getName() + "_WrapperTypeHelper";
         newClassName = newClassName.replaceAll("\\$", ".");
         newClassName = periodToSlashes(newClassName);

Modified: incubator/cxf/trunk/systests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/pom.xml?view=diff&rev=567114&r1=567113&r2=567114
==============================================================================
--- incubator/cxf/trunk/systests/pom.xml (original)
+++ incubator/cxf/trunk/systests/pom.xml Fri Aug 17 12:21:01 2007
@@ -321,6 +321,10 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>asm</groupId>
+            <artifactId>asm</artifactId>
+        </dependency>
+        <dependency>
             <groupId>httpunit</groupId>
             <artifactId>httpunit</artifactId>
             <scope>test</scope>



Mime
View raw message