Page 1 of 1

Validation Error java.io.FileNotFoundException-

Posted: Tue Sep 16, 2003 7:32 pm
by seanwhe
I have two DB XML files, both validate independantly.

However, if I use an ENTITY reference to include the second file in the first I get:

Validation Error java.io.FileNotFoundException-/path/to/some/file/filename.xml (Too many open files)

Note I do have many ENTITY references in each file. But independantly they validate. Its only when I include the second to the first that the error occurs.

The filename.xml in the error is also not consistantly referencing the same file.

Any ideas?

Posted: Tue Sep 16, 2003 9:34 pm
by george
Hi Sean,

We also got into this problem on Mac OS X trying to edit the oxygen user guide :wink: . This is a Xerces problem, we made a test showing that this problem appears on a simple parsing of a file that includes a lot of external entities and post this in a bugzilla entry for Xerces:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19152

I guess you have this problem in Linux, right ?
A possible workaround will be if it is possible to increase the system allowed number of open files. We will look to see if this is possible.


Best Regards,
George

Posted: Wed Sep 17, 2003 10:52 am
by Dan
Hello Sean,

Try the following command:

ulimit -n 2047

This will set the maximum number of files that can be opened at one time by a process to 2047. I had the same problem on Mac OS X and I have put this command in my .bash_profile file.

Posted: Wed Sep 17, 2003 12:42 pm
by seanwhe
Hello Mihai,

I still get the same error.
.bash_profile on MACOS = .bashrc on Linux

I added this command to my ~/.bashrc.
logoff/logon.
Now bash raises the following error message when invoked.
ulimit: open files: cannot modify limit: Operation not permitted.

The validation problem remains.

Posted: Wed Sep 17, 2003 12:58 pm
by seanwhe
Sorry, my fault. I have This comand should not be placed in .bashrc

I did not have .bash_profile, but I do have .profile, one of the files bash reads on start.
Added ulimit to .profile

But still the same problem.

When I type ulimit at bash prompt. It returns the word unlimited.

Any ideas where I went wrong or misunderstood.

Posted: Wed Sep 17, 2003 1:09 pm
by seanwhe
According to the MAN for bash, not all systems allow ulimit -n to be set
http://www.die.net/doc/linux/man/man1/bash.1.html

ulimit -a shows open files value to be 1024.

When I try ulimit from prompt I get the same message prev mentioned.

Perhaps there is another way?

Posted: Wed Sep 17, 2003 1:13 pm
by george
Hi Sean,

Have you tried running that command as root ?

Best Regards,
George

Posted: Wed Sep 17, 2003 2:06 pm
by seanwhe
Yes. Under root this works. But not for other users.

Any idea how I can change it for the users?

Posted: Wed Sep 17, 2003 2:13 pm
by Dan
You can add the

ulimit -n 2047

to the /etc/rc.d/rc.local file.

Edit the file as root. On some Linuxes the name of this file is changed. This is executed each time the system is started. In this way all the users will benefit of the setting.

Posted: Wed Sep 17, 2003 2:31 pm
by seanwhe
That works.

But for SUSE users see this about the non-existance of rc.local

http://www.luci.org/luci-discuss/199912/msg00110.html

Posted: Wed Sep 17, 2003 5:03 pm
by seanwhe
Sorry, it enables me to set open files, but this does not solve the validation problem.

Even when I run OXY as root the same problem exists.

Posted: Thu Sep 18, 2003 1:48 pm
by seanwhe
The problem also extends to XPath, so I think that the problem is to do with Xerces.

Posted: Thu Sep 18, 2003 2:03 pm
by george
Sean,

Sure it is a Xerces problem, please review my first post.
This is a Xerces problem, we made a test showing that this problem appears on a simple parsing of a file that includes a lot of external entities and post this in a bugzilla entry for Xerces:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19152
You can find in the bug attachments the test to reproduce it with a simple parsing.

Regards,
George

Posted: Thu Sep 18, 2003 2:18 pm
by seanwhe
Yes I did see your first post. I just thought the Mihai's ulimit suggestion may have been a possible the answer.

BTW. I am able to open and validate my documents under XXE and Morphon, which parsers are they using?

Posted: Thu Sep 18, 2003 2:29 pm
by george
Hi Sean,

Dan's suggestion with ulimit was an workaround that worked for us on Mac OS X. You may try a larger parameter for ulimit.

I do not know what parser they are using, it may be Xerces but a different version. We are using the latest version.

Best Regards,
George