Re: tomcat doesn't create directories under 'work' but does create .java/.class files

2004-07-13 Thread Morus Walter
Hi,

First of all apologies to everyone for sending my last message thrice.
Wasn't intentional and I'll do my best not to repeat that...


 File destDir = null;
 
 if (absoluteLibPath != null) {
 destDir = new File(absoluteLibPath);
 } else {
 copyJars = true;
 destDir = new File(workDir, libPath);
 destDir.mkdirs();
 }
 
I compiled tomcat from sources and added some debugging messages.
What I found is, that tomcat takes the else-branch which should create
the directory.
I changed this to
   } else {
copyJars = true;
System.err.println(WorkDir:  + workDir + ; libPath:  + libPath);
destDir = new File(workDir, libPath);
System.err.println(no absoluteLibPath; dest Dir:  + destDir);
destDir.mkdirs();
if ( !destDir.exists() ) {
System.err.println(destDir  + destDir +  does not exist);
destDir.getParentFile().mkdirs();
destDir.mkdirs();
if ( !destDir.exists() ) {
System.err.println(destDir  + destDir +  does not exist);
}
else {
System.err.println(destDir  + destDir +  does exist);
}
}
}
and it works. After the first destDir.mkdirs() destDir does not exist,
the second (two) mkdirs calls create it.

So this really seems to be some bug in javas File.mkdirs implementation
(or in the underlying libc/linux filesystem).

I'm not sure what's the best thing to do in this situation, but I'll file
a bug report for tomcat suggesting to add
if ( !destDir.exists() ) {
destDir.getParentFile().mkdirs();
destDir.mkdirs();
}
with an apropriate comment as a workaround...

Morus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: tomcat doesn't create directories under 'work' but does create .java/.class files

2004-07-13 Thread STOCKHOLM, Raymond
What JVM are you using ?
I had some similar problems with java 1.4.1_01 on Windows,
when to many files were opened.
Solved with 1.4.1_05.

-Message d'origine-
De : Morus Walter [mailto:[EMAIL PROTECTED]
Envoyé : mardi 13 juillet 2004 11:19
À : Tomcat Users List
Cc : [EMAIL PROTECTED]
Objet : Re: tomcat doesn't create directories under 'work' but does
create .java/.class files


Hi,

First of all apologies to everyone for sending my last message thrice.
Wasn't intentional and I'll do my best not to repeat that...


 File destDir = null;
 
 if (absoluteLibPath != null) {
 destDir = new File(absoluteLibPath);
 } else {
 copyJars = true;
 destDir = new File(workDir, libPath);
 destDir.mkdirs();
 }
 
I compiled tomcat from sources and added some debugging messages.
What I found is, that tomcat takes the else-branch which should create
the directory.
I changed this to
   } else {
copyJars = true;
System.err.println(WorkDir:  + workDir + ; libPath:  + libPath);
destDir = new File(workDir, libPath);
System.err.println(no absoluteLibPath; dest Dir:  + destDir);
destDir.mkdirs();
if ( !destDir.exists() ) {
System.err.println(destDir  + destDir +  does not exist);
destDir.getParentFile().mkdirs();
destDir.mkdirs();
if ( !destDir.exists() ) {
System.err.println(destDir  + destDir +  does not exist);
}
else {
System.err.println(destDir  + destDir +  does exist);
}
}
}
and it works. After the first destDir.mkdirs() destDir does not exist,
the second (two) mkdirs calls create it.

So this really seems to be some bug in javas File.mkdirs implementation
(or in the underlying libc/linux filesystem).

I'm not sure what's the best thing to do in this situation, but I'll file
a bug report for tomcat suggesting to add
if ( !destDir.exists() ) {
destDir.getParentFile().mkdirs();
destDir.mkdirs();
}
with an apropriate comment as a workaround...

Morus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: tomcat doesn't create directories under 'work' but does create .java/.class files

2004-07-13 Thread Morus Walter
STOCKHOLM, Raymond writes:
 What JVM are you using ?
 I had some similar problems with java 1.4.1_01 on Windows,
 when to many files were opened.
 Solved with 1.4.1_05.
 
java -version
java version 1.4.2_04
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

Morus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat doesn't create directories under 'work' but does create .java/.class files

2004-07-12 Thread Morus Walter
Hi Horacio,

I get similar problems (on debian woody) for the deployment of jar-files.

When I start tomcat (with jsvc) everythings fine and the webapp is
startet.
But I would like to unload and load the application with the manager
application. In this case the start of the webapp fails, because
tomcat cannot copy the jar-files (jstl beeing the first of them) into
work/Standalone/localhost/webapp/WEB-INF/lib
because it didn't create that dir.

I did a strace analysis which shows, that tomcat
- checks for the existance of .../localhost/webapp/WEB-INF/lib
- tries to create this directory and fails (No such file or directory)
  (because .../localhost/webapp/WEB-INF does not exist)
- checks all paths up to .../localhost/webapp/WEB-INF
- finds that the path up to .../localhost/webapp exits
  and .../localhost/webapp/WEB-INF is missing
- ignores this and tries to open the jar-File (for writing)
  This fails and an IOException is thrown

mkdir(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search,
 0777) = 0
gettimeofday({1089624365, 625731}, NULL) = 0
write(21, 2004-07-12 11:26:05 StandardCont..., 90) = 90
gettimeofday({1089624365, 626281}, NULL) = 0
write(21, 2004-07-12 11:26:05 WebappLoader..., 180) = 180
gettimeofday({1089624365, 626677}, NULL) = 0
gettimeofday({1089624365, 626855}, NULL) = 0
stat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF/lib,
 0xbbffe43c) = -1 ENOENT (No such file or directory)
mkdir(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF/lib,
 0777) = -1 ENOENT (No such file or directory)
lstat64(/usr, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 
0lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30, {st_mode=S_IFDIR|0775, 
st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work, {st_mode=S_IFDIR|0755, 
st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone, 
{st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost, 
{st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search,
 {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF,
 0xbbffc394) = -1 ENOENT (No such file or directory)
lstat64(/usr, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30, {st_mode=S_IFDIR|0775, 
st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work, {st_mode=S_IFDIR|0755, 
st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone, 
{st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost, 
{st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search,
 {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF,
 0xbbffc394) = -1 ENOENT (No such file or directory)
gettimeofday({1089624365, 629834}, NULL) = 0
write(21, 2004-07-12 11:26:05 WebappLoader..., 190) = 190
open(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF/lib/jstl.jar,
 O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = -1 ENOENT (No such file or directory)


Without jsvc it looks pretty much the same, except that the directory is 
created as expected.

mkdir(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search,
 0777) = 0
gettimeofday({1089625315, 938740}, NULL) = 0
write(22, 2004-07-12 11:41:55 StandardCont..., 90) = 90
gettimeofday({1089625315, 939285}, NULL) = 0
write(22, 2004-07-12 11:41:55 WebappLoader..., 180) = 180
gettimeofday({1089625315, 939650}, NULL) = 0
gettimeofday({1089625315, 939830}, NULL) = 0
stat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF/lib,
 0xbbffe43c) = -1 ENOENT (No such file or directory)
mkdir(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF/lib,
 0777) = -1 ENOENT (No such file or directory)
lstat64(/usr, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www, {st_mode=S_IFDIR|0755, st_size=4096, 

Re: tomcat doesn't create directories under 'work' but does create .java/.class files

2004-07-12 Thread Morus Walter
Hi Horacio,

I get similar problems (on debian woody) for the deployment of jar-files.

When I start tomcat (with jsvc) everythings fine and the webapp is
startet.
But I would like to unload and load the application with the manager
application. In this case the start of the webapp fails, because
tomcat cannot copy the jar-files (jstl beeing the first of them) into
work/Standalone/localhost/webapp/WEB-INF/lib
because it didn't create that dir.

I did a strace analysis which shows, that tomcat
- checks for the existance of .../localhost/webapp/WEB-INF/lib
- tries to create this directory and fails (No such file or directory)
  (because .../localhost/webapp/WEB-INF does not exist)
- checks all paths up to .../localhost/webapp/WEB-INF
- finds that the path up to .../localhost/webapp exits
  and .../localhost/webapp/WEB-INF is missing
- ignores this and tries to open the jar-File (for writing)
  This fails and an IOException is thrown

mkdir(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search,
 0777) = 0
gettimeofday({1089624365, 625731}, NULL) = 0
write(21, 2004-07-12 11:26:05 StandardCont..., 90) = 90
gettimeofday({1089624365, 626281}, NULL) = 0
write(21, 2004-07-12 11:26:05 WebappLoader..., 180) = 180
gettimeofday({1089624365, 626677}, NULL) = 0
gettimeofday({1089624365, 626855}, NULL) = 0
stat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF/lib,
 0xbbffe43c) = -1 ENOENT (No such file or directory)
mkdir(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF/lib,
 0777) = -1 ENOENT (No such file or directory)
lstat64(/usr, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 
0lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30, {st_mode=S_IFDIR|0775, 
st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work, {st_mode=S_IFDIR|0755, 
st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone, 
{st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost, 
{st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search,
 {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF,
 0xbbffc394) = -1 ENOENT (No such file or directory)
lstat64(/usr, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30, {st_mode=S_IFDIR|0775, 
st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work, {st_mode=S_IFDIR|0755, 
st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone, 
{st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost, 
{st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search,
 {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF,
 0xbbffc394) = -1 ENOENT (No such file or directory)
gettimeofday({1089624365, 629834}, NULL) = 0
write(21, 2004-07-12 11:26:05 WebappLoader..., 190) = 190
open(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF/lib/jstl.jar,
 O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = -1 ENOENT (No such file or directory)


Without jsvc it looks pretty much the same, except that the directory is 
created as expected.

mkdir(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search,
 0777) = 0
gettimeofday({1089625315, 938740}, NULL) = 0
write(22, 2004-07-12 11:41:55 StandardCont..., 90) = 90
gettimeofday({1089625315, 939285}, NULL) = 0
write(22, 2004-07-12 11:41:55 WebappLoader..., 180) = 180
gettimeofday({1089625315, 939650}, NULL) = 0
gettimeofday({1089625315, 939830}, NULL) = 0
stat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF/lib,
 0xbbffe43c) = -1 ENOENT (No such file or directory)
mkdir(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF/lib,
 0777) = -1 ENOENT (No such file or directory)
lstat64(/usr, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www, {st_mode=S_IFDIR|0755, st_size=4096, 

Re: tomcat doesn't create directories under 'work' but does create .java/.class files

2004-07-12 Thread Morus Walter
Hi Horacio,

I get similar problems (on debian woody) for the deployment of jar-files.

When I start tomcat (with jsvc) everythings fine and the webapp is
startet.
But I would like to unload and load the application with the manager
application. In this case the start of the webapp fails, because
tomcat cannot copy the jar-files (jstl beeing the first of them) into
work/Standalone/localhost/webapp/WEB-INF/lib
because it didn't create that dir.

I did a strace analysis which shows, that tomcat
- checks for the existance of .../localhost/webapp/WEB-INF/lib
- tries to create this directory and fails (No such file or directory)
  (because .../localhost/webapp/WEB-INF does not exist)
- checks all paths up to .../localhost/webapp/WEB-INF
- finds that the path up to .../localhost/webapp exits
  and .../localhost/webapp/WEB-INF is missing
- ignores this and tries to open the jar-File (for writing)
  This fails and an IOException is thrown

mkdir(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search,
 0777) = 0
gettimeofday({1089624365, 625731}, NULL) = 0
write(21, 2004-07-12 11:26:05 StandardCont..., 90) = 90
gettimeofday({1089624365, 626281}, NULL) = 0
write(21, 2004-07-12 11:26:05 WebappLoader..., 180) = 180
gettimeofday({1089624365, 626677}, NULL) = 0
gettimeofday({1089624365, 626855}, NULL) = 0
stat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF/lib,
 0xbbffe43c) = -1 ENOENT (No such file or directory)
mkdir(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF/lib,
 0777) = -1 ENOENT (No such file or directory)
lstat64(/usr, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 
0lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30, {st_mode=S_IFDIR|0775, 
st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work, {st_mode=S_IFDIR|0755, 
st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone, 
{st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost, 
{st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search,
 {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF,
 0xbbffc394) = -1 ENOENT (No such file or directory)
lstat64(/usr, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30, {st_mode=S_IFDIR|0775, 
st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work, {st_mode=S_IFDIR|0755, 
st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone, 
{st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost, 
{st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search,
 {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF,
 0xbbffc394) = -1 ENOENT (No such file or directory)
gettimeofday({1089624365, 629834}, NULL) = 0
write(21, 2004-07-12 11:26:05 WebappLoader..., 190) = 190
open(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF/lib/jstl.jar,
 O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = -1 ENOENT (No such file or directory)


Without jsvc it looks pretty much the same, except that the directory is 
created as expected.

mkdir(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search,
 0777) = 0
gettimeofday({1089625315, 938740}, NULL) = 0
write(22, 2004-07-12 11:41:55 StandardCont..., 90) = 90
gettimeofday({1089625315, 939285}, NULL) = 0
write(22, 2004-07-12 11:41:55 WebappLoader..., 180) = 180
gettimeofday({1089625315, 939650}, NULL) = 0
gettimeofday({1089625315, 939830}, NULL) = 0
stat64(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF/lib,
 0xbbffe43c) = -1 ENOENT (No such file or directory)
mkdir(/usr/tanto/www/servers/jakarta-tomcat-4.1.30/work/Standalone/localhost/refdb_search/WEB-INF/lib,
 0777) = -1 ENOENT (No such file or directory)
lstat64(/usr, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64(/usr/tanto/www, {st_mode=S_IFDIR|0755, st_size=4096, 

tomcat doesn't create directories under 'work' but does create .java/.class files

2004-07-11 Thread Horacio de Oro
Hi! What a subject!
I've trying to make work starting up Tomcat with jsvc.
On Debian unstable, this works ok.
On Debian stable (woody), I could startup Tomcat, but when I try to 
access to a JSP file, I get the classic exception:

2004-07-12 02:03:58 StandardWrapperValve[jsp]: Servlet.service() for 
servlet jsp threw exception
java.io.FileNotFoundException: 
/home/horacio/tomcat-pruebas-startup/jakarta-tomcat-5.0.25/work/Catalina/localhost/prueba/org/apache/jsp/test_jsp.java
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.init(FileOutputStream.java:179)
at java.io.FileOutputStream.init(FileOutputStream.java:70)
at 
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:188)

This isn't a permission problems, I've checked them a hundred times, 
I've excecute 'chown -R USER.USER jakarta-tomcat-dir' many times too.

I've follow the instructions on Tomcat FAQ, and I've tryed
http://jakarta.apache.org/tomcat/faq/misc.html#commonsLoggingLog4j
http://marc.theaimsgroup.com/?l=tomcat-userm=108330970225012w=2
http://marc.theaimsgroup.com/?l=tomcat-userm=108578233003073w=2
and couldn't make it work on Debian stable (woody).
I was looking at 'generateJava()' on file 
org.apache.jasper.compiler.Compiler.java (line 188), this is what make 
the exception:

try {
  osw = new OutputStreamWriter( // - LINE 188
   new FileOutputStream(javaFileName), javaEncoding);
} catch (UnsupportedEncodingException ex) {
errDispatcher.jspError(jsp.error.needAlternateJavaEncoding,
javaEncoding);
}
So, I make a little java program using FileOutputStream.
public static void main(String[] args) throws Exception {
FileOutputStream fos = new 
FileOutputStream(/tmp/dir/that/doesnt/exist/test.txt);
byte test[] = new byte[1024];
fos.write(test);
fos.close();
}

Since /tmp/dir/that/doesnt/exist doesn't existe, I get the exact same 
exception:

java.io.FileNotFoundException:
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.init(FileOutputStream.java:179)
at java.io.FileOutputStream.init(FileOutputStream.java:70)

And then, I've tried to make the directories that Tomcat needs to make 
the temporary .java, so I do:

mkdir -p 
/home/horacio/tomcat-pruebas-startup/jakarta-tomcat-5.0.25/work/Catalina/localhost/prueba/org/apache/jsp

and then, reloaded the page, and this work!
So, the only problem is that Tomcat doesn't make the proper directory 
structure where it should put the generated .java...

So:
 - If I run Tomcat from startup.sh   - WORKS
 - If I run Tomcat from jsvc on UNSTABLE - WORKS
 - If I run Tomcat from jsvc on STABLE   - DOESN'T WORKS
ON DEBIAN UNSTABLE:
java version 1.4.2_04
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
ON DEBIAN STABLE:
java version 1.4.2
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)
ALSO ON DEBIAN STABLE:
java version 1.4.2_04
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
Tomcat 5.0.25
Is this a bug?
How can I make work Tomcat on Debian stable with jsvc?
Thanks in advance!
Horacio de Oro
*
Full error message from tomcat's logs.
2004-07-12 02:03:58 StandardWrapperValve[jsp]: Servlet.service() for 
servlet jsp threw exception
java.io.FileNotFoundException: 
/home/horacio/tomcat-pruebas-startup/jakarta-tomcat-5.0.25/work/Catalina/localhost/prueba/org/apache/jsp/test_jsp.java
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.init(FileOutputStream.java:179)
at java.io.FileOutputStream.init(FileOutputStream.java:70)
at 
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:188)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:461)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:442)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:430)
at 
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:274)
at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at 
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at