cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From egl...@apache.org
Subject svn commit: r663894 - in /cxf/branches/2.0.x-fixes/rt/ws: addr/src/main/java/org/apache/cxf/ws/addressing/ policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/ rm/src/main/java/org/apache/cxf/ws/rm/ rm/src/main/java/org/apache/cxf/ws/rm/s...
Date Fri, 06 Jun 2008 11:06:12 GMT
Author: eglynn
Date: Fri Jun  6 04:06:12 2008
New Revision: 663894

URL: http://svn.apache.org/viewvc?rev=663894&view=rev
Log:
Explicitly associating a classloader with the JAXBContext created at various points in the
WS-RM, WS-Addressing & WS-Policy code, as the implicit usage of the thread context classloader
breaks in an OSGi runtime. 

Modified:
    cxf/branches/2.0.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
    cxf/branches/2.0.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/VersionTransformer.java
    cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/EndpointReferenceDomainExpressionBuilder.java
    cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
    cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
    cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java

Modified: cxf/branches/2.0.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?rev=663894&r1=663893&r2=663894&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
Fri Jun  6 04:06:12 2008
@@ -595,7 +595,10 @@
     public static JAXBContext getJAXBContext() throws JAXBException {
         synchronized (ContextUtils.class) {
             if (jaxbContext == null) {
-                jaxbContext = JAXBContext.newInstance(WSA_OBJECT_FACTORY.getClass());
+                jaxbContext =
+                    JAXBContext.newInstance(
+                        WSA_OBJECT_FACTORY.getClass().getPackage().getName(),
+                        WSA_OBJECT_FACTORY.getClass().getClassLoader());
             }
         }
         return jaxbContext;

Modified: cxf/branches/2.0.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/VersionTransformer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/VersionTransformer.java?rev=663894&r1=663893&r2=663894&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/VersionTransformer.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/VersionTransformer.java
Fri Jun  6 04:06:12 2008
@@ -337,8 +337,10 @@
         public static JAXBContext getJAXBContext() throws JAXBException {
             synchronized (Names200408.class) {
                 if (jaxbContext == null) {
-                    jaxbContext = 
-                        JAXBContext.newInstance(org.apache.cxf.ws.addressing.v200408.ObjectFactory.class);
+                    Class clz = org.apache.cxf.ws.addressing.v200408.ObjectFactory.class;
+                    jaxbContext =
+                        JAXBContext.newInstance(clz.getPackage().getName(),
+                                                clz.getClassLoader());
                 }
             }
             return jaxbContext;

Modified: cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/EndpointReferenceDomainExpressionBuilder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/EndpointReferenceDomainExpressionBuilder.java?rev=663894&r1=663893&r2=663894&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/EndpointReferenceDomainExpressionBuilder.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/EndpointReferenceDomainExpressionBuilder.java
Fri Jun  6 04:06:12 2008
@@ -89,7 +89,8 @@
         }
         
         try {
-            JAXBContext context = JAXBContext.newInstance(EndpointReferenceType.class.getPackage().getName());
+            Class clz = EndpointReferenceType.class;
+            JAXBContext context = JAXBContext.newInstance(clz.getPackage().getName(), clz.getClassLoader());
             unmarshaller = context.createUnmarshaller();
         } catch (JAXBException ex) {
             throw new PolicyException(new Message("EPR_DOMAIN_EXPRESSION_BUILDER_INIT_EXC",
BUNDLE, 

Modified: cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java?rev=663894&r1=663893&r2=663894&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java (original)
+++ cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java Fri
Jun  6 04:06:12 2008
@@ -25,6 +25,7 @@
 import java.util.logging.Logger;
 
 import javax.wsdl.extensions.ExtensibilityElement;
+import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.namespace.QName;
 
@@ -235,8 +236,11 @@
 
         DataBinding dataBinding = null;
         try {
-            dataBinding = new JAXBDataBinding(CreateSequenceType.class, CreateSequenceResponseType.class,
-                                              TerminateSequenceType.class, SequenceFaultType.class);
+            JAXBContext ctx =
+                JAXBContext.newInstance(
+                    CreateSequenceType.class.getPackage().getName(),
+                    CreateSequenceType.class.getClassLoader());
+            dataBinding = new JAXBDataBinding(ctx);
         } catch (JAXBException e) {
             throw new ServiceConstructionException(e);
         }

Modified: cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java?rev=663894&r1=663893&r2=663894&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
Fri Jun  6 04:06:12 2008
@@ -384,7 +384,10 @@
      */
     private static synchronized JAXBContext getJAXBContext() throws JAXBException {
         if (jaxbContext == null) {
-            jaxbContext = JAXBContext.newInstance(WS_RM_PACKAGE);
+            jaxbContext =
+                JAXBContext.newInstance(
+                    WS_RM_PACKAGE,
+                    SequenceAcknowledgement.class.getClassLoader());
         }
         return jaxbContext;
     }

Modified: cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java?rev=663894&r1=663893&r2=663894&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java
Fri Jun  6 04:06:12 2008
@@ -103,7 +103,9 @@
         Document doc = factory.newDocumentBuilder().newDocument();
         Element elem = null;
         
-        JAXBContext ctx = JAXBContext.newInstance(WS_RM_PACKAGE);
+        JAXBContext ctx = JAXBContext.newInstance(
+            WS_RM_PACKAGE,
+            SequenceAcknowledgement.class.getClassLoader());
         Marshaller m = ctx.createMarshaller();
         if (RMConstants.getInvalidAcknowledgmentFaultCode().equals(fault.getSubCode())) {
             SequenceAcknowledgement ack = (SequenceAcknowledgement)detail;



Mime
View raw message