Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
1.2
-
None
-
Windows XP,
Sun JRE 1.4.2 or IBM JRE 1.4.2,
running JUnit test from within Eclipse 3.2.2
Description
-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)
}
}