You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Chris McClelland (JIRA)" <ji...@apache.org> on 2006/10/18 00:19:35 UTC

[jira] Created: (AXIS2-1436) In JAXB RI, construction of JAXBContext is expensive - only do it once.

In JAXB RI, construction of JAXBContext is expensive - only do it once.
-----------------------------------------------------------------------

                 Key: AXIS2-1436
                 URL: http://issues.apache.org/jira/browse/AXIS2-1436
             Project: Apache Axis 2.0 (Axis2)
          Issue Type: Improvement
          Components: databinding
    Affects Versions: 1.1
            Reporter: Chris McClelland
            Priority: Minor


I propose a patch to:

http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/jaxbri/src/org/apache/axis2/jaxbri/template/JaxbRIDatabindingTemplate.xsl?revision=464450&content-type=text%2Fplain&pathrev=464450

in order to achieve this. The idea is to keep just one static final copy of the JAXBContext for each type, with name mangling to replace the "." with "_". So for each class (e.g, com.foo.xsd.Echo)...

private static final javax.xml.bind.JAXBContext com_foo_xsd_Echo;

private static final java.util.HashMap<Class, javax.xml.bind.JAXBContext> classContextMap =
    new java.util.HashMap<Class, javax.xml.bind.JAXBContext>();

static {
    javax.xml.bind.JAXBContext jc;
    jc = null;
    try {
        jc = javax.xml.bind.JAXBContext.newInstance(com.foo.xsd.Echo.class);
    }
    catch ( javax.xml.bind.JAXBException ex ) {
        // Should never happen
        System.err.println("Unable to create JAXBContext for class: com.foo.xsd.Echo");
        Runtime.getRuntime().exit(-1);
    }
    finally {
        com_foo_xsd_Echo = jc;
        classContextMap.put(com.foo.xsd.Echo.class, jc);
    }
}

I'm fairly sure that the JAXBException above will never be thrown under "well-configured" circumstances. Even so, forcing the JVM to quit might be a bit extreme. Suggestions welcome!

Patch follows...

--- old/org/apache/axis2/jaxbri/template/JaxbRIDatabindingTemplate.xsl  2006-10-17 23:01:21.000000000 +0100
+++ new/org/apache/axis2/jaxbri/template/JaxbRIDatabindingTemplate.xsl  2006-10-17 23:06:13.000000000 +0100
@@ -17,10 +17,38 @@
 
         <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
             <xsl:if test="@type!=''">
+                private static final javax.xml.bind.JAXBContext <xsl:value-of select="translate(@type,'.','_')"/>;
+            </xsl:if>
+        </xsl:for-each>
+
+        private static final java.util.HashMap&lt;Class,javax.xml.bind.JAXBContext&gt; classContextMap = new java.util.HashMap&lt;Class,javax.xml.bind.JAXBContext&gt;();
+
+        static {
+            javax.xml.bind.JAXBContext jc;
+            <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
+                <xsl:if test="@type!=''">
+                    jc = null;
+                    try {
+                        jc = javax.xml.bind.JAXBContext.newInstance(<xsl:value-of select="@type"/>.class);
+                    }
+                    catch ( javax.xml.bind.JAXBException ex ) {
+                        System.err.println("Unable to create JAXBContext for class: <xsl:value-of select='@type'/>");
+                        Runtime.getRuntime().exit(-1);
+                    }
+                    finally {
+                        <xsl:value-of select="translate(@type,'.','_')"/> = jc;
+                        classContextMap.put(<xsl:value-of select="@type"/>.class, jc);
+                    }
+                </xsl:if>
+            </xsl:for-each>
+        }
+
+        <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
+            <xsl:if test="@type!=''">
 
                 private org.apache.axiom.om.OMElement toOM(<xsl:value-of select="@type"/> param, org.apache.axiom.soap.SOAPFactory factory, boolean optimizeContent) {
                     try {
-                        javax.xml.bind.JAXBContext context = javax.xml.bind.JAXBContext.newInstance(<xsl:value-of select="@type"/>.class);
+                        javax.xml.bind.JAXBContext context = <xsl:value-of select="translate(@type,'.','_')"/>;
                         javax.xml.bind.Marshaller marshaller = context.createMarshaller();
                         marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FRAGMENT, Boolean.TRUE);            
         
@@ -56,7 +84,7 @@
             java.lang.Class type,
             java.util.Map extraNamespaces) {
             try {
-                javax.xml.bind.JAXBContext context = javax.xml.bind.JAXBContext.newInstance( type );
+                javax.xml.bind.JAXBContext context = classContextMap.get(type);
                 javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
 
                 return unmarshaller.unmarshal(param.getXMLStreamReader(), type).getValue();
@@ -119,7 +147,7 @@
 
             public javax.xml.stream.XMLStreamReader getReader() throws javax.xml.stream.XMLStreamException {
                 try {
-                    javax.xml.bind.JAXBContext context = javax.xml.bind.JAXBContext.newInstance(outClazz);
+                    javax.xml.bind.JAXBContext context = classContextMap.get(outClazz);
                     org.apache.axiom.om.impl.builder.SAXOMBuilder builder = new org.apache.axiom.om.impl.builder.SAXOMBuilder();
                     javax.xml.bind.Marshaller marshaller = context.createMarshaller();
                     marshaller.marshal(outObject, builder);


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Resolved: (AXIS2-1436) In JAXB RI, construction of JAXBContext is expensive - only do it once.

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2-1436?page=all ]

Davanum Srinivas resolved AXIS2-1436.
-------------------------------------

    Resolution: Fixed

Applied. Thanks Chris. Please try latest nightly in a few hours.

-- dims

> In JAXB RI, construction of JAXBContext is expensive - only do it once.
> -----------------------------------------------------------------------
>
>                 Key: AXIS2-1436
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1436
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: databinding
>    Affects Versions: 1.1
>            Reporter: Chris McClelland
>            Priority: Minor
>
> I propose a patch to:
> http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/jaxbri/src/org/apache/axis2/jaxbri/template/JaxbRIDatabindingTemplate.xsl?revision=464450&content-type=text%2Fplain&pathrev=464450
> in order to achieve this. The idea is to keep just one static final copy of the JAXBContext for each type, with name mangling to replace the "." with "_". So for each class (e.g, com.foo.xsd.Echo)...
> private static final javax.xml.bind.JAXBContext com_foo_xsd_Echo;
> private static final java.util.HashMap<Class, javax.xml.bind.JAXBContext> classContextMap =
>     new java.util.HashMap<Class, javax.xml.bind.JAXBContext>();
> static {
>     javax.xml.bind.JAXBContext jc;
>     jc = null;
>     try {
>         jc = javax.xml.bind.JAXBContext.newInstance(com.foo.xsd.Echo.class);
>     }
>     catch ( javax.xml.bind.JAXBException ex ) {
>         // Should never happen
>         System.err.println("Unable to create JAXBContext for class: com.foo.xsd.Echo");
>         Runtime.getRuntime().exit(-1);
>     }
>     finally {
>         com_foo_xsd_Echo = jc;
>         classContextMap.put(com.foo.xsd.Echo.class, jc);
>     }
> }
> I'm fairly sure that the JAXBException above will never be thrown under "well-configured" circumstances. Even so, forcing the JVM to quit might be a bit extreme. Suggestions welcome!
> Patch follows...
> --- old/org/apache/axis2/jaxbri/template/JaxbRIDatabindingTemplate.xsl  2006-10-17 23:01:21.000000000 +0100
> +++ new/org/apache/axis2/jaxbri/template/JaxbRIDatabindingTemplate.xsl  2006-10-17 23:06:13.000000000 +0100
> @@ -17,10 +17,38 @@
>  
>          <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
>              <xsl:if test="@type!=''">
> +                private static final javax.xml.bind.JAXBContext <xsl:value-of select="translate(@type,'.','_')"/>;
> +            </xsl:if>
> +        </xsl:for-each>
> +
> +        private static final java.util.HashMap&lt;Class,javax.xml.bind.JAXBContext&gt; classContextMap = new java.util.HashMap&lt;Class,javax.xml.bind.JAXBContext&gt;();
> +
> +        static {
> +            javax.xml.bind.JAXBContext jc;
> +            <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
> +                <xsl:if test="@type!=''">
> +                    jc = null;
> +                    try {
> +                        jc = javax.xml.bind.JAXBContext.newInstance(<xsl:value-of select="@type"/>.class);
> +                    }
> +                    catch ( javax.xml.bind.JAXBException ex ) {
> +                        System.err.println("Unable to create JAXBContext for class: <xsl:value-of select='@type'/>");
> +                        Runtime.getRuntime().exit(-1);
> +                    }
> +                    finally {
> +                        <xsl:value-of select="translate(@type,'.','_')"/> = jc;
> +                        classContextMap.put(<xsl:value-of select="@type"/>.class, jc);
> +                    }
> +                </xsl:if>
> +            </xsl:for-each>
> +        }
> +
> +        <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
> +            <xsl:if test="@type!=''">
>  
>                  private org.apache.axiom.om.OMElement toOM(<xsl:value-of select="@type"/> param, org.apache.axiom.soap.SOAPFactory factory, boolean optimizeContent) {
>                      try {
> -                        javax.xml.bind.JAXBContext context = javax.xml.bind.JAXBContext.newInstance(<xsl:value-of select="@type"/>.class);
> +                        javax.xml.bind.JAXBContext context = <xsl:value-of select="translate(@type,'.','_')"/>;
>                          javax.xml.bind.Marshaller marshaller = context.createMarshaller();
>                          marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FRAGMENT, Boolean.TRUE);            
>          
> @@ -56,7 +84,7 @@
>              java.lang.Class type,
>              java.util.Map extraNamespaces) {
>              try {
> -                javax.xml.bind.JAXBContext context = javax.xml.bind.JAXBContext.newInstance( type );
> +                javax.xml.bind.JAXBContext context = classContextMap.get(type);
>                  javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
>  
>                  return unmarshaller.unmarshal(param.getXMLStreamReader(), type).getValue();
> @@ -119,7 +147,7 @@
>  
>              public javax.xml.stream.XMLStreamReader getReader() throws javax.xml.stream.XMLStreamException {
>                  try {
> -                    javax.xml.bind.JAXBContext context = javax.xml.bind.JAXBContext.newInstance(outClazz);
> +                    javax.xml.bind.JAXBContext context = classContextMap.get(outClazz);
>                      org.apache.axiom.om.impl.builder.SAXOMBuilder builder = new org.apache.axiom.om.impl.builder.SAXOMBuilder();
>                      javax.xml.bind.Marshaller marshaller = context.createMarshaller();
>                      marshaller.marshal(outObject, builder);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: [jira] Commented: (AXIS2-1436) In JAXB RI, construction of JAXBContext is expensive - only do it once.

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Tue, 2006-10-17 at 15:57 -0700, Chris McClelland (JIRA) wrote:
>     [ http://issues.apache.org/jira/browse/AXIS2-1436?page=comments#action_12443109 ] 
>             
> Chris McClelland commented on AXIS2-1436:
> -----------------------------------------
> 
> Sorry, that patch paste didn't work. You can get the proposed patch here:
>  http://www.swaton.org/JaxbRIDatabindingTemplate464450.diff

Please attach the patch here so you can clearly grant a license to
Apache.

Thanks!

Sanjiva.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-1436) In JAXB RI, construction of JAXBContext is expensive - only do it once.

Posted by "Chris McClelland (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-1436?page=comments#action_12443109 ] 
            
Chris McClelland commented on AXIS2-1436:
-----------------------------------------

Sorry, that patch paste didn't work. You can get the proposed patch here: http://www.swaton.org/JaxbRIDatabindingTemplate464450.diff

- Chris

> In JAXB RI, construction of JAXBContext is expensive - only do it once.
> -----------------------------------------------------------------------
>
>                 Key: AXIS2-1436
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1436
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: databinding
>    Affects Versions: 1.1
>            Reporter: Chris McClelland
>            Priority: Minor
>
> I propose a patch to:
> http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/jaxbri/src/org/apache/axis2/jaxbri/template/JaxbRIDatabindingTemplate.xsl?revision=464450&content-type=text%2Fplain&pathrev=464450
> in order to achieve this. The idea is to keep just one static final copy of the JAXBContext for each type, with name mangling to replace the "." with "_". So for each class (e.g, com.foo.xsd.Echo)...
> private static final javax.xml.bind.JAXBContext com_foo_xsd_Echo;
> private static final java.util.HashMap<Class, javax.xml.bind.JAXBContext> classContextMap =
>     new java.util.HashMap<Class, javax.xml.bind.JAXBContext>();
> static {
>     javax.xml.bind.JAXBContext jc;
>     jc = null;
>     try {
>         jc = javax.xml.bind.JAXBContext.newInstance(com.foo.xsd.Echo.class);
>     }
>     catch ( javax.xml.bind.JAXBException ex ) {
>         // Should never happen
>         System.err.println("Unable to create JAXBContext for class: com.foo.xsd.Echo");
>         Runtime.getRuntime().exit(-1);
>     }
>     finally {
>         com_foo_xsd_Echo = jc;
>         classContextMap.put(com.foo.xsd.Echo.class, jc);
>     }
> }
> I'm fairly sure that the JAXBException above will never be thrown under "well-configured" circumstances. Even so, forcing the JVM to quit might be a bit extreme. Suggestions welcome!
> Patch follows...
> --- old/org/apache/axis2/jaxbri/template/JaxbRIDatabindingTemplate.xsl  2006-10-17 23:01:21.000000000 +0100
> +++ new/org/apache/axis2/jaxbri/template/JaxbRIDatabindingTemplate.xsl  2006-10-17 23:06:13.000000000 +0100
> @@ -17,10 +17,38 @@
>  
>          <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
>              <xsl:if test="@type!=''">
> +                private static final javax.xml.bind.JAXBContext <xsl:value-of select="translate(@type,'.','_')"/>;
> +            </xsl:if>
> +        </xsl:for-each>
> +
> +        private static final java.util.HashMap&lt;Class,javax.xml.bind.JAXBContext&gt; classContextMap = new java.util.HashMap&lt;Class,javax.xml.bind.JAXBContext&gt;();
> +
> +        static {
> +            javax.xml.bind.JAXBContext jc;
> +            <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
> +                <xsl:if test="@type!=''">
> +                    jc = null;
> +                    try {
> +                        jc = javax.xml.bind.JAXBContext.newInstance(<xsl:value-of select="@type"/>.class);
> +                    }
> +                    catch ( javax.xml.bind.JAXBException ex ) {
> +                        System.err.println("Unable to create JAXBContext for class: <xsl:value-of select='@type'/>");
> +                        Runtime.getRuntime().exit(-1);
> +                    }
> +                    finally {
> +                        <xsl:value-of select="translate(@type,'.','_')"/> = jc;
> +                        classContextMap.put(<xsl:value-of select="@type"/>.class, jc);
> +                    }
> +                </xsl:if>
> +            </xsl:for-each>
> +        }
> +
> +        <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
> +            <xsl:if test="@type!=''">
>  
>                  private org.apache.axiom.om.OMElement toOM(<xsl:value-of select="@type"/> param, org.apache.axiom.soap.SOAPFactory factory, boolean optimizeContent) {
>                      try {
> -                        javax.xml.bind.JAXBContext context = javax.xml.bind.JAXBContext.newInstance(<xsl:value-of select="@type"/>.class);
> +                        javax.xml.bind.JAXBContext context = <xsl:value-of select="translate(@type,'.','_')"/>;
>                          javax.xml.bind.Marshaller marshaller = context.createMarshaller();
>                          marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FRAGMENT, Boolean.TRUE);            
>          
> @@ -56,7 +84,7 @@
>              java.lang.Class type,
>              java.util.Map extraNamespaces) {
>              try {
> -                javax.xml.bind.JAXBContext context = javax.xml.bind.JAXBContext.newInstance( type );
> +                javax.xml.bind.JAXBContext context = classContextMap.get(type);
>                  javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
>  
>                  return unmarshaller.unmarshal(param.getXMLStreamReader(), type).getValue();
> @@ -119,7 +147,7 @@
>  
>              public javax.xml.stream.XMLStreamReader getReader() throws javax.xml.stream.XMLStreamException {
>                  try {
> -                    javax.xml.bind.JAXBContext context = javax.xml.bind.JAXBContext.newInstance(outClazz);
> +                    javax.xml.bind.JAXBContext context = classContextMap.get(outClazz);
>                      org.apache.axiom.om.impl.builder.SAXOMBuilder builder = new org.apache.axiom.om.impl.builder.SAXOMBuilder();
>                      javax.xml.bind.Marshaller marshaller = context.createMarshaller();
>                      marshaller.marshal(outObject, builder);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-1436) In JAXB RI, construction of JAXBContext is expensive - only do it once.

Posted by "Sebastian J. (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-1436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739514#action_12739514 ] 

Sebastian J. commented on AXIS2-1436:
-------------------------------------

Hopefully someone listens:

Why is a JAXBContext created for every single operation?
According to https://jaxb.dev.java.net/guide/Performance_and_thread_safety.html only one JAXBContext should be created (per application).


> In JAXB RI, construction of JAXBContext is expensive - only do it once.
> -----------------------------------------------------------------------
>
>                 Key: AXIS2-1436
>                 URL: https://issues.apache.org/jira/browse/AXIS2-1436
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: databinding
>    Affects Versions: 1.1
>            Reporter: Chris McClelland
>            Priority: Minor
>
> I propose a patch to:
> http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/jaxbri/src/org/apache/axis2/jaxbri/template/JaxbRIDatabindingTemplate.xsl?revision=464450&content-type=text%2Fplain&pathrev=464450
> in order to achieve this. The idea is to keep just one static final copy of the JAXBContext for each type, with name mangling to replace the "." with "_". So for each class (e.g, com.foo.xsd.Echo)...
> private static final javax.xml.bind.JAXBContext com_foo_xsd_Echo;
> private static final java.util.HashMap<Class, javax.xml.bind.JAXBContext> classContextMap =
>     new java.util.HashMap<Class, javax.xml.bind.JAXBContext>();
> static {
>     javax.xml.bind.JAXBContext jc;
>     jc = null;
>     try {
>         jc = javax.xml.bind.JAXBContext.newInstance(com.foo.xsd.Echo.class);
>     }
>     catch ( javax.xml.bind.JAXBException ex ) {
>         // Should never happen
>         System.err.println("Unable to create JAXBContext for class: com.foo.xsd.Echo");
>         Runtime.getRuntime().exit(-1);
>     }
>     finally {
>         com_foo_xsd_Echo = jc;
>         classContextMap.put(com.foo.xsd.Echo.class, jc);
>     }
> }
> I'm fairly sure that the JAXBException above will never be thrown under "well-configured" circumstances. Even so, forcing the JVM to quit might be a bit extreme. Suggestions welcome!
> Patch follows...
> --- old/org/apache/axis2/jaxbri/template/JaxbRIDatabindingTemplate.xsl  2006-10-17 23:01:21.000000000 +0100
> +++ new/org/apache/axis2/jaxbri/template/JaxbRIDatabindingTemplate.xsl  2006-10-17 23:06:13.000000000 +0100
> @@ -17,10 +17,38 @@
>  
>          <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
>              <xsl:if test="@type!=''">
> +                private static final javax.xml.bind.JAXBContext <xsl:value-of select="translate(@type,'.','_')"/>;
> +            </xsl:if>
> +        </xsl:for-each>
> +
> +        private static final java.util.HashMap&lt;Class,javax.xml.bind.JAXBContext&gt; classContextMap = new java.util.HashMap&lt;Class,javax.xml.bind.JAXBContext&gt;();
> +
> +        static {
> +            javax.xml.bind.JAXBContext jc;
> +            <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
> +                <xsl:if test="@type!=''">
> +                    jc = null;
> +                    try {
> +                        jc = javax.xml.bind.JAXBContext.newInstance(<xsl:value-of select="@type"/>.class);
> +                    }
> +                    catch ( javax.xml.bind.JAXBException ex ) {
> +                        System.err.println("Unable to create JAXBContext for class: <xsl:value-of select='@type'/>");
> +                        Runtime.getRuntime().exit(-1);
> +                    }
> +                    finally {
> +                        <xsl:value-of select="translate(@type,'.','_')"/> = jc;
> +                        classContextMap.put(<xsl:value-of select="@type"/>.class, jc);
> +                    }
> +                </xsl:if>
> +            </xsl:for-each>
> +        }
> +
> +        <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
> +            <xsl:if test="@type!=''">
>  
>                  private org.apache.axiom.om.OMElement toOM(<xsl:value-of select="@type"/> param, org.apache.axiom.soap.SOAPFactory factory, boolean optimizeContent) {
>                      try {
> -                        javax.xml.bind.JAXBContext context = javax.xml.bind.JAXBContext.newInstance(<xsl:value-of select="@type"/>.class);
> +                        javax.xml.bind.JAXBContext context = <xsl:value-of select="translate(@type,'.','_')"/>;
>                          javax.xml.bind.Marshaller marshaller = context.createMarshaller();
>                          marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FRAGMENT, Boolean.TRUE);            
>          
> @@ -56,7 +84,7 @@
>              java.lang.Class type,
>              java.util.Map extraNamespaces) {
>              try {
> -                javax.xml.bind.JAXBContext context = javax.xml.bind.JAXBContext.newInstance( type );
> +                javax.xml.bind.JAXBContext context = classContextMap.get(type);
>                  javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
>  
>                  return unmarshaller.unmarshal(param.getXMLStreamReader(), type).getValue();
> @@ -119,7 +147,7 @@
>  
>              public javax.xml.stream.XMLStreamReader getReader() throws javax.xml.stream.XMLStreamException {
>                  try {
> -                    javax.xml.bind.JAXBContext context = javax.xml.bind.JAXBContext.newInstance(outClazz);
> +                    javax.xml.bind.JAXBContext context = classContextMap.get(outClazz);
>                      org.apache.axiom.om.impl.builder.SAXOMBuilder builder = new org.apache.axiom.om.impl.builder.SAXOMBuilder();
>                      javax.xml.bind.Marshaller marshaller = context.createMarshaller();
>                      marshaller.marshal(outObject, builder);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.