You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Rich Scheuerle (JIRA)" <ji...@apache.org> on 2008/03/22 16:29:24 UTC

[jira] Created: (WSCOMMONS-315) StAXUtils loads a singleton XML*Factory. It should load a singleton XML*Factory per classloader

StAXUtils loads a singleton XML*Factory.  It should load a singleton XML*Factory per classloader
------------------------------------------------------------------------------------------------

                 Key: WSCOMMONS-315
                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-315
             Project: WS-Commons
          Issue Type: Bug
          Components: AXIOM
            Reporter: Rich Scheuerle
            Assignee: Rich Scheuerle


Problem Description:
------------------------------
The XMLInputFactory.newInstance() method uses the current classloader to determine which version of STAX XMLInputFactory to load.

The current StAXUtils.getXMLInputFactory() overrides this behavior and uses the classloader of StAXUtils instead of the current classloader.
Unfortunately this makes it impossible for Axiom to use the STAX version defined by a different classloader.

Note: This issue is equally applicable to XMLOutputFactory.  

Problem Solution:
-------------------------
The solution is to change StAXUtils.getXMLInputFactory to return a STAX XMLInputFactory for the current classloader.
This will comply with the expected STAX behavior.
A weak map of (key=ClassLoader, value = XMLInputFactory) will be maintained to try and preserve a singleton factory per classloader.

There will be two ways for users to trigger the old behavior.

1) A new method will be added to change the policy:
/**
     * Set the policy for how to maintain the XMLInputFactory and XMLOutputFactory
     * @param value (if false, then one singleton...if true...then singleton per class loader 
     *  (default is true)
     */
    public static void setFactoryPerClassLoader(boolean value) ;

2) New methods will be added to programatically request the policy.
    ie.  getXMLInputFactory(boolean isFactoryPerClassLoaderPolicy);


Note: The same solution will be applied for XMLOutputFactory.  





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


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


[jira] Resolved: (WSCOMMONS-315) StAXUtils loads a singleton XML*Factory. It should load a singleton XML*Factory per classloader

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle resolved WSCOMMONS-315.
--------------------------------------

    Resolution: Fixed

> StAXUtils loads a singleton XML*Factory.  It should load a singleton XML*Factory per classloader
> ------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-315
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-315
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Rich Scheuerle
>            Assignee: Rich Scheuerle
>
> Problem Description:
> ------------------------------
> The XMLInputFactory.newInstance() method uses the current classloader to determine which version of STAX XMLInputFactory to load.
> The current StAXUtils.getXMLInputFactory() overrides this behavior and uses the classloader of StAXUtils instead of the current classloader.
> Unfortunately this makes it impossible for Axiom to use the STAX version defined by a different classloader.
> Note: This issue is equally applicable to XMLOutputFactory.  
> Problem Solution:
> -------------------------
> The solution is to change StAXUtils.getXMLInputFactory to return a STAX XMLInputFactory for the current classloader.
> This will comply with the expected STAX behavior.
> A weak map of (key=ClassLoader, value = XMLInputFactory) will be maintained to try and preserve a singleton factory per classloader.
> There will be two ways for users to trigger the old behavior.
> 1) A new method will be added to change the policy:
> /**
>      * Set the policy for how to maintain the XMLInputFactory and XMLOutputFactory
>      * @param value (if false, then one singleton...if true...then singleton per class loader 
>      *  (default is true)
>      */
>     public static void setFactoryPerClassLoader(boolean value) ;
> 2) New methods will be added to programatically request the policy.
>     ie.  getXMLInputFactory(boolean isFactoryPerClassLoaderPolicy);
> Note: The same solution will be applied for XMLOutputFactory.  

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


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


[jira] Resolved: (WSCOMMONS-315) StAXUtils loads a singleton XML*Factory. It should load a singleton XML*Factory per classloader

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle resolved WSCOMMONS-315.
--------------------------------------

    Resolution: Fixed

Added trace and additional fallback logic: 652102

> StAXUtils loads a singleton XML*Factory.  It should load a singleton XML*Factory per classloader
> ------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-315
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-315
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Rich Scheuerle
>            Assignee: Rich Scheuerle
>
> Problem Description:
> ------------------------------
> The XMLInputFactory.newInstance() method uses the current classloader to determine which version of STAX XMLInputFactory to load.
> The current StAXUtils.getXMLInputFactory() overrides this behavior and uses the classloader of StAXUtils instead of the current classloader.
> Unfortunately this makes it impossible for Axiom to use the STAX version defined by a different classloader.
> Note: This issue is equally applicable to XMLOutputFactory.  
> Problem Solution:
> -------------------------
> The solution is to change StAXUtils.getXMLInputFactory to return a STAX XMLInputFactory for the current classloader.
> This will comply with the expected STAX behavior.
> A weak map of (key=ClassLoader, value = XMLInputFactory) will be maintained to try and preserve a singleton factory per classloader.
> There will be two ways for users to trigger the old behavior.
> 1) A new method will be added to change the policy:
> /**
>      * Set the policy for how to maintain the XMLInputFactory and XMLOutputFactory
>      * @param value (if false, then one singleton...if true...then singleton per class loader 
>      *  (default is true)
>      */
>     public static void setFactoryPerClassLoader(boolean value) ;
> 2) New methods will be added to programatically request the policy.
>     ie.  getXMLInputFactory(boolean isFactoryPerClassLoaderPolicy);
> Note: The same solution will be applied for XMLOutputFactory.  

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


[jira] Reopened: (WSCOMMONS-315) StAXUtils loads a singleton XML*Factory. It should load a singleton XML*Factory per classloader

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle reopened WSCOMMONS-315:
--------------------------------------


> StAXUtils loads a singleton XML*Factory.  It should load a singleton XML*Factory per classloader
> ------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-315
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-315
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Rich Scheuerle
>            Assignee: Rich Scheuerle
>
> Problem Description:
> ------------------------------
> The XMLInputFactory.newInstance() method uses the current classloader to determine which version of STAX XMLInputFactory to load.
> The current StAXUtils.getXMLInputFactory() overrides this behavior and uses the classloader of StAXUtils instead of the current classloader.
> Unfortunately this makes it impossible for Axiom to use the STAX version defined by a different classloader.
> Note: This issue is equally applicable to XMLOutputFactory.  
> Problem Solution:
> -------------------------
> The solution is to change StAXUtils.getXMLInputFactory to return a STAX XMLInputFactory for the current classloader.
> This will comply with the expected STAX behavior.
> A weak map of (key=ClassLoader, value = XMLInputFactory) will be maintained to try and preserve a singleton factory per classloader.
> There will be two ways for users to trigger the old behavior.
> 1) A new method will be added to change the policy:
> /**
>      * Set the policy for how to maintain the XMLInputFactory and XMLOutputFactory
>      * @param value (if false, then one singleton...if true...then singleton per class loader 
>      *  (default is true)
>      */
>     public static void setFactoryPerClassLoader(boolean value) ;
> 2) New methods will be added to programatically request the policy.
>     ie.  getXMLInputFactory(boolean isFactoryPerClassLoaderPolicy);
> Note: The same solution will be applied for XMLOutputFactory.  

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