[ 
https://issues.apache.org/jira/browse/AXIS2-2899?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Deepal Jayasinghe resolved AXIS2-2899.
--------------------------------------

    Resolution: Fixed

After adding one line I was able to run more 10000 without having any issues.
[call configurationContetxt.terminate() ]


 try {
            ConfigurationContext configContext;
            for (int i = 0; i < 10000; i++) {
                System.out.println("Iteration " + i);
                configContext = 
ConfigurationContextFactory.createConfigurationContextFromFileSystem(
                        "E:\\Projects\\LSF\\Axis2\\Axis1.0\\target\\axis2", 
"E:\\Projects\\LSF\\Axis2\\Axis1.0\\target\\axis2/conf/axis2.xml");
                System.out.println(configContext);
                configContext.terminate();
            }
        }
        catch (Exception e) {
            e.printStackTrace();
        }

> "Too many open files" exception when hotdeployment set to true, after loading 
> configurationContext multiple times
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2899
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2899
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: deployment
>    Affects Versions: 1.2
>         Environment: Windows XP, 
> Sun JRE 1.4.2 or IBM JRE 1.4.2,
> running JUnit test from within Eclipse 3.2.2
>            Reporter: Greg Lee-Shoy
>            Assignee: Deepal Jayasinghe
>            Priority: Minor
>         Attachments: axis2.zip
>
>
> -When configuration context is loaded about 400 times using 
> createConfigurationContextFromFileSystem( ), and hotdeployment is set to 
> true, the following error occurs: java.io.IOException: Too many open files.  
> -if hotdeployment is set to false, this error does not occur even after 
> loading configurationContext 100,000 times
> -if there is a check in getURLsForAllJars() in 
> org.apache.axis2.deployment.util.Utils to see if a URL has file protocol (and 
> not creating a temp file if it does) the threshold is raised to 2826 times, 
> after which an OutOfMemoryError occurs.
> The JUnit test is:
> import org.apache.axis2.context.ConfigurationContext;
> import org.apache.axis2.context.ConfigurationContextFactory;
> import junit.framework.TestCase;
> public class LoadConfigFromFileTest extends TestCase {
>       public LoadConfigFromFileTest(String name)
>       {
>               super(name);
>       }
>       
>       public void testLoadConfig1000Times()
>       {
>               try
>               {
>                       
>                       ConfigurationContext configContext = null;
>                       
>                       String axis2Conf = "C:\\Java\\axis2\\conf\\axis2.xml";
>                       String repoDir = "C:\\Java\\axis2";
>               
>                       for( int i = 0; i < 1000; i++)
>                       {
>                               System.out.println("Iteration " + i);
>                               configContext = 
> ConfigurationContextFactory.createConfigurationContextFromFileSystem(
>                                       repoDir, axis2Conf);
>                               configContext = null;
>                       }
>               }
>               catch (Exception e)
>               {
>                       e.printStackTrace();
>               }
>       }
> }

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to