[Seasar-user:19529] [SAStruts][CoolDeploy時のみ例外発生]FileNotFoundException app.properties (Too many open files)が発生します。

前薗裕作 [E-MAIL ADDRESS DELETED]
2010年 3月 22日 (月) 04:25:26 JST


$BA01r$H?=$7$^$9!#(B

Cool Deploy$B;~$N$_0J2<Nc30$,H/@8$7$^$9!#(B

$BBP1~J}K!$K$D$$$F!"%"%I%P%$%9$rD:$-$?$$$G$9!#(B

--------------------------------------------
Caused by: java.io.FileNotFoundException:
/usr/local/tomcat/webapps/xxx/WEB-INF/classes/app.properties (Too many
open files)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at java.io.FileInputStream.<init>(FileInputStream.java:66)
        at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
        at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
        at org.seasar.framework.util.URLUtil.openStream(URLUtil.java:59)
--------------------------------------------

$B$3$N%(%i!<$,H/@8$9$k%a%=%C%I$OFCDj$G$-$F$*$j!"(B
$B%=!<%9$O0J2<$G$9!#(B($B0lItJQ99$7$F$$$^$9(B)

$B=hM}FbMF$O!"<u$1<h$C$?%Q%i%a!<%?$N%U%!%$%kL>$r85$K2hA|%U%!%$%k$rI=<($7$F$$$^$9!#(B

1$B2hLL$+$i!":GBg(B100$B8D$N%j%/%(%9%H$,HsF14|$K%"%/%;%9$7$^$9!#(B(<img src="xxx/view" $B$H$J$C$F$$$^$9(B)

$B:G=i$N(B60$B2hA|$O!"@5$7$/I=<($G$-$k$N$G$9$,!"(B
$B$=$l0J9_!">e5-%(%i!<$,B??tH/@8$7$F!"2hA|$,I=<($5$l$^$;$s!#(B

--------------------------------------------
import org.seasar.framework.util.InputStreamUtil;
import org.seasar.framework.util.OutputStreamUtil;

@Execute(validator = false)
public String view() throws Exception {

	// $B2hA|%U%!%$%kL>(B
	String fileName = request.getParameter("fileName");
	FileInputStream inputStream = null;
	BufferedInputStream bufferedInputStream = null;
	BufferedOutputStream bufferedOutputStream = null;

	// $B2hA|I=<((B
	response.setContentType("image/jpeg");
	try {
		String realPath = appConfig.imagePath + fileName;
		inputStream = new FileInputStream(realPath);
		bufferedInputStream = new BufferedInputStream(inputStream);
		bufferedOutputStream = new BufferedOutputStream(response.getOutputStream());
		byte[] buffer = new byte[1024];
		int length;
		while((length = bufferedInputStream.read(buffer)) > -1) {
			bufferedOutputStream.write(buffer, 0, length);
			bufferedOutputStream.flush();
		}
	} catch (Exception e) {
		throw e;
	} finally {
		inputStream.close();
		InputStreamUtil.close(bufferedInputStream);
		OutputStreamUtil.close(bufferedOutputStream);
	}

	return null;
}
--------------------------------------------

3$[E-MAIL ADDRESS DELETED]?Ld$G$9!#(B

$B-!(Bclose$B$O$7$F$$$kG'<1$J$N$K!"(BToo many open files$B$,=P$kE@!#(B

close$B:Q$_$+$I$&$+!"(BeclipseTPTP$BEy$rMxMQ$7$F3NG'Cf$G$9!#(B
Eclipse$B4D6-$G$J$/!"(Blinux$B$N(Btomcat$B$K%G%W%m%$$7$?>uBV$G$N%W%m%U%!%$%k$r8!F$$7$F$$$^$9!#(B

$B-"(BHot Deploy$B;~$K$O>e5-%(%i!<$,H/@8$7$J$$E@!#(B

$BK\8=>]$O!"(BCool Deploy$B;~$N$_H/@8$7$^$9!#(B
$B$?$@$7!"(B($BJL%a!<%k$K=q$-$^$7$?$,(B)Hot Deploy$B;~$O!"(B
$B0lDj;~4V7P2a8e!"(BOutOfMemoryError: PermGen space $B$,H/@8$7$^$9!#(B

$B-#(Bapp.properties$B$,Kh2sFI$_$3$^$l$kM}M3$,ITL@!#(B

$B$J$<!"(Bapp.properties$B$rKh2sFI$`I,MW$,$"$k$N$G$7$g$&$+!#(B
$B!J!V(BappConfig.imagePath$B!W$NItJ,$G!"(Bapp.properties$B$,4XO"$7$F$$$^$9$,!"(B
$B!V(BappConfig.imagePath$B!W$r8GDj$N!"!V(B/var/tmp/$B!W$K$7$F$bF1MM$G$7$?!#(B

$BEY!9$N<ALd$G62=L$G$9$,!"(B
$B:#8e$NBP1~$K$D$$$F!"%"%I%P%$%9$7$FD:$1$k$H=u$+$j$^$9!#(B

$B0J>e$G$9!#$h$m$7$/$*4j$$$7$^$9!#(B

$B!Z4XO"%a!<%k![(B
-------------------------------------------------------------
[SAStruts][$B7Y9pH/@8(B]HOT deploy$BBP>]%/%i%9(B(jp.XXX) $B$,HsBP>]%/%i%9$+$i;2>H$5$l$FDL>o$N%/%i%9%m(B $B!<%@$K%m!<%I$5$l$F$$$^$9!#(B

$B!Z4D6-![(B
-------------------------------------------------------------
$B"#(BSeasar
s2-framework-2.4.40.jar
sa-struts-1.0.4-sp7.jar

$B"#(BTomcat

Server version: Apache Tomcat/6.0.24
OS Name:        Linux
OS Version:     2.6.18-164.el5
Architecture:   i386
JVM Version:    1.6.0_18-b07
JVM Vendor:     Sun Microsystems Inc.

$B"#(BMysql
mysql  Ver 14.14 Distrib 5.1.41
-------------------------------------------------------------


Seasar-user メーリングリストの案内