Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > tomcat and the working directory

Thread Tools

tomcat and the working directory

Chris Uppal
Posts: n/a
ian ward wrote:

> Thanks for your comments. The dlls are home-made, not commercial. Would
> it be difficult to fix this 'current directory' bug?

Who knows ? My point is that it's a /bug/ not a configuration error -- no JNI
code should /ever/ produce the error you are seeing. It's program crash, not
a diagnostic error message. The bug might be simple and easy to fix, but the
only people who can fix it are the people who supply the JNI code.

> Also, is there any
> way I can test what you've said about the thread issue? This is not my
> area at all but I do need to know about these risks.

I'm afraid that I can't tell. I'm /suspicious/ of any JNI code that crashes,
and the nature of the crash suggests (but does not imply) that the code's
authors are breaking some of the JNI rules. There are a number of such rules
concerning things like how long a reference to a Java object is valid, and what
can be passed from thread to thread. Of course, the crash may be nothing to do
with JNI at all, it could be caused by any random C++ bug (such as using a
pointer that has been freed). But the JNI rules are relatively easy to get
wrong, so my /guess/ is that that's the most likely source of the problem. If
that /is/ the case, then I suspect threading issues might /also/ be a problem
simply because the threading rules are easy to get wrong (any threaded code is
easy to get wrong, of course, but JNI adds some extra restrictions), hard to
test, and it seems likely that Tomcat is providing a threading environment that
does not resemble the testing environment that the JNI code's authors used (I
wouldn't be surprised if they didn't test threading at all). However the fact
that you can make the code fail from a simple (and, I assume, single-threaded)
test harness implies that there is at least one bug that is /not/
thread-related. You can legitimately /hope/ that fixing that will fix all of
your problems.

I'm sorry not to be more help. Basically, what I am saying is that the only
people who can fix the code are the ones who wrote it, or who have taken
ownership of it since. If you now "own" that code, then I don't think you have
any option but to get involved in JNI coding (not something to look forward to,
I agree...)

-- chris

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() are not returning the specified directory Nathan Sokalski ASP .Net 2 09-06-2007 03:58 PM
Difference between Apache Tomcat and Jakrata Tomcat twins Java 1 11-25-2005 05:57 PM
Which JVM to use for Tomcat 5.0.28 and Tomcat 5.5.4? Katerina McLean Java 1 12-10-2004 10:55 PM
Runtime.exec() with env and working directory parameters is not working. Priyanka AGARWAL Java 9 05-25-2004 02:34 PM
Tomcat - symbolic link for WEB-INF/classes directory not working Matthew Macchia Java 3 04-12-2004 11:52 PM