changeset 778:97f3e821200f

Merge
author asaha
date Tue, 01 Oct 2013 13:28:04 -0700
parents a2097d0dbdef 5524cced32d3
children 5a6f745eb3c3
files .hgtags
diffstat 9 files changed, 436 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Sep 12 17:17:32 2013 -0700
+++ b/.hgtags	Tue Oct 01 13:28:04 2013 -0700
@@ -302,6 +302,22 @@
 0cd0d4e7331f7fc9f9ee77f2275113571bcf67cf jdk7u25-b09
 105cdfd4f40837917d0065e3e58052d2854df7da jdk7u25-b10
 6de7fec036abf91ce962c74f11a6266491df3fd8 jdk7u25-b11
+a367ebf0c21512867f4ab5cdd206dd8c7817c004 jdk7u14-b16
+74c34f35912d8d7145b3ff34fefea2d2f189f2b4 jdk7u14-b17
+c93a35b3638f45de91013d65543217a002577684 jdk7u14-b18
+82be38857de3b2f6d8def98034f3e7b0827fd9f0 jdk7u14-b19
+82be38857de3b2f6d8def98034f3e7b0827fd9f0 jdk7u14-b19
+d63b21e6c3d29305400dbfc1500090cab89f25d1 jdk7u14-b19
+dd695ad6c5ec797fe61db31600a3fd2dbc62247b jdk7u14-b20
+97bbac299eb801709a924fe777b3ee9c96829d8b jdk7u14-b21
+6e74b3e1773cfbac99998431a5a54c70baaf1dc5 jdk7u14-b22
+e9bbdf789d2b512550e0ca80629980e96f02146d jdk7u40-b23
+adaf9cf486fab1b14c5af9fc6525565760bb9c11 jdk7u40-b24
+aafab1efbd4ced5e05695aa1887813f9f5de9d5c jdk7u40-b25
+6581f9739031120bb7515d3b09fa3501653d11af jdk7u40-b26
+46ebac943288218b14d7ce3df23aa42a70fa4cf9 jdk7u40-b27
+016957700ac905ebf3432ae8ba17d3576a51e585 jdk7u40-b28
+15a82c84d9f7f6c99310380d4766fc68a3882671 jdk7u40-b29
 4c5d242efa0d6e0cdb688e41e722bff671dfbfec jdk7u25-b12
 6b4a165221304d809f678a18f51c7a8cb042d60b jdk7u25-b13
 03073e4e6d3f600102d31e862154f56730838b11 jdk7u25-b14
@@ -342,4 +358,20 @@
 adc234666397f6bdacd295c87be34c6a1a4d7bf2 jdk7u40-b41
 89f6c9663d75d9e4b672aed16f885b84232e9c93 jdk7u40-b42
 3ee85b3793de16855e20272336a3565af8477b6b jdk7u40-b43
+cbeef786ce489096c39ec5effee4f8f9e770b4af jdk7u40-b60
+000becfcb945d8592cfdef6ef1704b532af56762 jdk7u45-b01
+817632baca26f7566e36c7708455494c15113d88 jdk7u45-b02
+f65baba9400aec6cb29bc06b3139623bb4663225 jdk7u45-b03
+80ff2468f520ed1940915815ceb85e05bd2bc568 jdk7u45-b04
+1128d3934b643660a219532aa1ca554877d89375 jdk7u45-b05
+8da3d41d946925a07a9f1001795959bfdb4c02c6 jdk7u45-b06
+38f5b376c38035f13ede456f158ee26d0cf8d99c jdk7u45-b07
+86f3efd1edae3c0f47ad14bef992e7566eaa94d4 jdk7u45-b08
+ab835f7247e40dd7fb457830eaa31c550b434413 jdk7u45-b09
+bbd594e6cf45ebfc37c71e217772b7f37a9c5750 jdk7u45-b10
+c01eab96821e3c0315c4637e61a8015cbfe63b6a jdk7u45-b11
+05f1274a8aa019584b4ceb05c73fc89bf7b7f4de jdk7u45-b12
+3271849829b7c8ac32f6bb17b763d8a85a1a0a32 jdk7u45-b13
+842dd63be9c633b8448e1837a5bb7b803dfdaad9 jdk7u45-b14
+93a3fb090be58a5a45464f866a7093f24205dae2 jdk7u45-b15
 cb5f95263f620967f5097c5ff8e0b27cfb9e8c44 jdk7u60-b00
--- a/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/InstanceResolver.java	Thu Sep 12 17:17:32 2013 -0700
+++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/InstanceResolver.java	Tue Oct 01 13:28:04 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -232,7 +232,7 @@
             public Object invoke(Packet p, Method m, Object... args) throws InvocationTargetException, IllegalAccessException {
                 T t = resolve(p);
                 try {
-                    return m.invoke(t, args );
+                    return MethodUtil.invoke(t, m, args );
                 } finally {
                     postInvoke(p,t);
                 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/MethodUtil.java	Tue Oct 01 13:28:04 2013 -0700
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks
+ * to java.lang,reflect.Method.invoke()
+ *
+ * Be careful, copy of this class exists in several packages, iny modification must be done to other copies too!
+ */
+class MethodUtil {
+
+    private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName());
+    private static final Method INVOKE_METHOD;
+
+    static {
+        Method method;
+        try {
+            Class<?> clazz = Class.forName("sun.reflect.misc.MethodUtil");
+            method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class);
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods.");
+            }
+        } catch (Throwable t) {
+            method = null;
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM");
+            }
+        }
+        INVOKE_METHOD = method;
+    }
+
+    static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException {
+        if (INVOKE_METHOD != null) {
+            // sun.reflect.misc.MethodUtil.invoke(method, owner, args)
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil");
+            }
+            try {
+                return INVOKE_METHOD.invoke(null, method, target, args);
+            } catch (InvocationTargetException ite) {
+                // unwrap invocation exception added by reflection code ...
+                throw unwrapException(ite);
+            }
+        } else {
+            // other then Oracle JDK ...
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM");
+            }
+            return method.invoke(target, args);
+        }
+    }
+
+    private static InvocationTargetException unwrapException(InvocationTargetException ite) {
+        Throwable targetException = ite.getTargetException();
+        if (targetException != null && targetException instanceof InvocationTargetException) {
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Unwrapping invocation target exception");
+            }
+            return (InvocationTargetException) targetException;
+        } else {
+            return ite;
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java	Tue Oct 01 13:28:04 2013 -0700
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.ws.client.sei;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks
+ * to java.lang,reflect.Method.invoke()
+ * <p/>
+ * Be careful, copy of this class exists in several packages, iny modification must be done to other copies too!
+ */
+class MethodUtil {
+
+    private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName());
+    private static final Method INVOKE_METHOD;
+
+    static {
+        Method method;
+        try {
+            Class<?> clazz = Class.forName("sun.reflect.misc.MethodUtil");
+            method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class);
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods.");
+            }
+        } catch (Throwable t) {
+            method = null;
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM");
+            }
+        }
+        INVOKE_METHOD = method;
+    }
+
+    static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException {
+        if (INVOKE_METHOD != null) {
+            // sun.reflect.misc.MethodUtil.invoke(method, owner, args)
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil");
+            }
+            try {
+                return INVOKE_METHOD.invoke(null, method, target, args);
+            } catch (InvocationTargetException ite) {
+                // unwrap invocation exception added by reflection code ...
+                throw unwrapException(ite);
+            }
+        } else {
+            // other then Oracle JDK ...
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM");
+            }
+            return method.invoke(target, args);
+        }
+    }
+
+    private static InvocationTargetException unwrapException(InvocationTargetException ite) {
+        Throwable targetException = ite.getTargetException();
+        if (targetException != null && targetException instanceof InvocationTargetException) {
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Unwrapping invocation target exception");
+            }
+            return (InvocationTargetException) targetException;
+        } else {
+            return ite;
+        }
+    }
+
+}
--- a/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIStub.java	Thu Sep 12 17:17:32 2013 -0700
+++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIStub.java	Tue Oct 01 13:28:04 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,17 +28,20 @@
 import com.sun.istack.internal.NotNull;
 import com.sun.istack.internal.Nullable;
 import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
 import com.sun.xml.internal.ws.api.client.WSPortInfo;
-import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
 import com.sun.xml.internal.ws.api.message.Header;
 import com.sun.xml.internal.ws.api.message.Headers;
 import com.sun.xml.internal.ws.api.message.Packet;
 import com.sun.xml.internal.ws.api.model.MEP;
 import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
+import com.sun.xml.internal.ws.api.pipe.Fiber;
 import com.sun.xml.internal.ws.api.pipe.Tube;
-import com.sun.xml.internal.ws.api.pipe.Fiber;
 import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.client.*;
+import com.sun.xml.internal.ws.client.RequestContext;
+import com.sun.xml.internal.ws.client.ResponseContextReceiver;
+import com.sun.xml.internal.ws.client.Stub;
+import com.sun.xml.internal.ws.client.WSServiceDelegate;
 import com.sun.xml.internal.ws.model.JavaMethodImpl;
 import com.sun.xml.internal.ws.model.SOAPSEIModel;
 import com.sun.xml.internal.ws.wsdl.OperationDispatcher;
@@ -47,6 +50,8 @@
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.Proxy;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -124,13 +129,14 @@
     private final Map<Method, MethodHandler> methodHandlers = new HashMap<Method, MethodHandler>();
 
     public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+        validateInputs(proxy, method);
         MethodHandler handler = methodHandlers.get(method);
         if (handler != null) {
             return handler.invoke(proxy, args);
         } else {
             // we handle the other method invocations by ourselves
             try {
-                return method.invoke(this, args);
+                return MethodUtil.invoke(this, method, args);
             } catch (IllegalAccessException e) {
                 // impossible
                 throw new AssertionError(e);
@@ -142,6 +148,17 @@
         }
     }
 
+    private void validateInputs(Object proxy, Method method) {
+        if (proxy == null || !Proxy.isProxyClass(proxy.getClass())) {
+            throw new IllegalStateException("Passed object is not proxy!");
+        }
+        Class<?> declaringClass = method.getDeclaringClass();
+        if (method == null || declaringClass == null
+                || Modifier.isStatic(method.getModifiers())) {
+            throw new IllegalStateException("Invoking static method is not allowed!");
+        }
+    }
+
     public final Packet doProcess(Packet request, RequestContext rc, ResponseContextReceiver receiver) {
         return super.process(request, rc, receiver);
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java	Tue Oct 01 13:28:04 2013 -0700
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.ws.policy.privateutil;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks
+ * to java.lang,reflect.Method.invoke()
+ */
+class MethodUtil {
+
+    private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName());
+    private static final Method INVOKE_METHOD;
+
+    static {
+        Method method;
+        try {
+            Class<?> clazz = Class.forName("sun.reflect.misc.MethodUtil");
+            method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class);
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods.");
+            }
+        } catch (Throwable t) {
+            method = null;
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM");
+            }
+        }
+        INVOKE_METHOD = method;
+    }
+
+    static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException {
+        if (INVOKE_METHOD != null) {
+            // sun.reflect.misc.MethodUtil.invoke(method, owner, args)
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil");
+            }
+            try {
+                return INVOKE_METHOD.invoke(null, method, target, args);
+            } catch (InvocationTargetException ite) {
+                // unwrap invocation exception added by reflection code ...
+                throw unwrapException(ite);
+            }
+        } else {
+            // other then Oracle JDK ...
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM");
+            }
+            return method.invoke(target, args);
+        }
+    }
+
+    private static InvocationTargetException unwrapException(InvocationTargetException ite) {
+        Throwable targetException = ite.getTargetException();
+        if (targetException != null && targetException instanceof InvocationTargetException) {
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Unwrapping invocation target exception");
+            }
+            return (InvocationTargetException) targetException;
+        } else {
+            return ite;
+        }
+    }
+
+}
--- a/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/PolicyUtils.java	Thu Sep 12 17:17:32 2013 -0700
+++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/PolicyUtils.java	Tue Oct 01 13:28:04 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -282,13 +282,13 @@
     /**
      * Reflection utilities wrapper
      */
-    public static class Reflection {
+    static class Reflection {
         private static final PolicyLogger LOGGER = PolicyLogger.getLogger(PolicyUtils.Reflection.class);
 
         /**
          * Reflectively invokes specified method on the specified target
          */
-        public static <T> T invoke(final Object target, final String methodName,
+        static <T> T invoke(final Object target, final String methodName,
                 final Class<T> resultClass, final Object... parameters) throws RuntimePolicyUtilsException {
             Class[] parameterTypes;
             if (parameters != null && parameters.length > 0) {
@@ -311,7 +311,7 @@
                 final Object[] parameters, final Class[] parameterTypes) throws RuntimePolicyUtilsException {
             try {
                 final Method method = target.getClass().getMethod(methodName, parameterTypes);
-                final Object result = method.invoke(target, parameters);
+                final Object result = MethodUtil.invoke(target, method,parameters);
 
                 return resultClass.cast(result);
             } catch (IllegalArgumentException e) {
--- a/src/share/jaxws_classes/com/sun/xml/internal/ws/server/AbstractInstanceResolver.java	Thu Sep 12 17:17:32 2013 -0700
+++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/server/AbstractInstanceResolver.java	Tue Oct 01 13:28:04 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -157,7 +157,7 @@
                     if (!method.isAccessible()) {
                         method.setAccessible(true);
                     }
-                    method.invoke(instance,args);
+                    MethodUtil.invoke(instance,method,args);
                 } catch (IllegalAccessException e) {
                     throw new ServerRtException("server.rt.err",e);
                 } catch (InvocationTargetException e) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/server/MethodUtil.java	Tue Oct 01 13:28:04 2013 -0700
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.ws.server;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks
+ * to java.lang,reflect.Method.invoke()
+ *
+ * Be careful, copy of this class exists in several packages, iny modification must be done to other copies too!
+ */
+class MethodUtil {
+
+    private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName());
+    private static final Method INVOKE_METHOD;
+
+    static {
+        Method method;
+        try {
+            Class<?> clazz = Class.forName("sun.reflect.misc.MethodUtil");
+            method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class);
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods.");
+            }
+        } catch (Throwable t) {
+            method = null;
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM");
+            }
+        }
+        INVOKE_METHOD = method;
+    }
+
+    static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException {
+        if (INVOKE_METHOD != null) {
+            // sun.reflect.misc.MethodUtil.invoke(method, owner, args)
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil");
+            }
+            try {
+                return INVOKE_METHOD.invoke(null, method, target, args);
+            } catch (InvocationTargetException ite) {
+                // unwrap invocation exception added by reflection code ...
+                throw unwrapException(ite);
+            }
+        } else {
+            // other then Oracle JDK ...
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM");
+            }
+            return method.invoke(target, args);
+        }
+    }
+
+    private static InvocationTargetException unwrapException(InvocationTargetException ite) {
+        Throwable targetException = ite.getTargetException();
+        if (targetException != null && targetException instanceof InvocationTargetException) {
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Unwrapping invocation target exception");
+            }
+            return (InvocationTargetException) targetException;
+        } else {
+            return ite;
+        }
+    }
+
+}