File descriptor from Runtime.exec not being closed (Linux)
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Scott_Byrd
Posted On:   Wednesday, April 25, 2007 05:15 PM

We changed our file descriptor limit to 2048 on our Linux server last week. There is something in our Java code that is not "closing" these file descriptors after it opens them. The error message we are getting is below. org.apache.jasper.JasperException: NamingException: javax.naming.CommunicationException: admin.local:389 [Root exception is java.net.SocketException: Too many open files] - com.sun.jndi.ldap.Connection. (Connection.java:204) We are running a jboss application server on a Linux box. I have a code snipet below. Basically, it seems that the Runtime.exec is not closing the file descriptor after the "chmod" is performed. Is there a way to "close" this file descriptor? I know there i   More>>

We changed our file descriptor limit to 2048 on our Linux server last week.
There is something in our Java code that is not "closing" these file descriptors after it opens them. The error message we are getting is below.

org.apache.jasper.JasperException: NamingException: javax.naming.CommunicationException: admin.local:389 [Root exception is java.net.SocketException: Too many open files] - com.sun.jndi.ldap.Connection. (Connection.java:204)

We are running a jboss application server on a Linux box. I have a code snipet below. Basically, it seems that the Runtime.exec is not closing the file descriptor after the "chmod" is performed. Is there a way to "close" this file descriptor? I know there is an "exit" method, but do not think this is what I need to do. Please advise.



String command = "chmod -R 777 " + rootFile.getAbsolutePath();

Runtime r = Runtime.getRuntime();

r.exec(command);

   <<Less
About | Sitemap | Contact