Re: tomcat and the working directory




Raymond DeCampo a écrit :
> ian ward wrote:
> >
> > ian ward a écrit :
> >
> >>I've seen several old threads speaking about Tomcat and the working
> >>directory but I haven't seen how this may be set. I believe I need to
> >>do this so that some dlls I am using, which are invoked via jni from my
> >>java/web app, can talk to each other. I can get them going but that's
> >>it. At the moment these dlls are in myapp\WEB-INF\lib, which I assume
> >>is tomcat's java.library.path, otherwise system.loadlibrary can't find
> >>them in the first place.
> >>
> >>I have experimented a bit but I think it might be some time before I
> >>hit on it. If I am barking up the wrong tree then I'd appreciate being
> >>gently informed and, well, what do I need to do to keep these dlls
> >>happy?
> >>
> >>Thanks
> >>Ian
> >
> >
> > I think I can set this using System.setProperty("user.dir",<the right
> > folder>) but at the moment I am putting this in one of my jsp pages and
> > I'm not convinced that that will work. How can I be sure that I have
> > set it so that it provides the reference for my dlls? Does it need to
> > go in the java class(es) which invoke(s) the dlls?
> >
>
> You are confusing the concepts of the working directory and the user's
> home directory. The working directory is the directory the Java process
> was started in. As far as I know, there is no way in Java to change the
> working directory once the process starts (although JNI calls could
> probably do it).
>
> HTH,
> Ray
>
> --
> XML is the programmer's duct tape.

This is good news (my confusion) as it hasn't been getting me anywhere.
The other good news is that I don't want to change the working
directory once the java process has started, I just want it to be right
in the first place - I only made the suggestion about doing it within
java as I assumed (wrongly) that I had the right thing and that I just
needed to find the right place/moment to set it.

The (temporary, I hope) bad news is that you haven't told me how I do
set the working directory. I assume I'm looking for some sort of
environment variable (which one?) and the right place to set it
(whether inside or outside tomcat).

You're not allowed to have a proper weekend until you've told me this!

Many thanks in the meantime

PS I've discovered that my comments about the java.library.path and
tomcat are are bit out but I think I've got that covered now.

.



Relevant Pages

  • Re: API-Programmierung mit Java?
    ... dlls) und Anweisungen, wie diese in Visual C oder Visual Basic ... Ein Windows-API ist von Programmiersprachen nutzbar, ... etwa Java, PHP, ... ...
    (de.comp.lang.java)
  • Tomcat on OpenVMS - Is source code available?
    ... Is the Java source code for Tomcat [as built by HP for the CSWS_JAVA v2.1 ... I know it is based on Tomcat v4.1.24, which is the version that it reports ... "WEB-INF" subfolder of a webapp to enable them to be protected from being ... The JSP files in the "WEB-INF" subfolder do not get compiled into Java ...
    (comp.os.vms)
  • Cannot install / uninstall alternate signal stack
    ... Java HotSpotClient VM warning: ... Please check ERROR REPORT FILE for further information, ... Tomcat was restarted, and I have not seen these messages since. ... happened twice in the last year on a production machine. ...
    (comp.lang.java.help)
  • Java / Tomcat / Jython Problem running on FC4
    ... I have an interesting problem trying to deploy a Java web application to ... my instance of Tomcat running on my FC4 machine. ... nested exception is org.springframework.beans.FatalBeanException: Could ... not instantiate class; ...
    (Fedora)
  • Java Webservices - newbie question.....
    ... And i moved onto Java side recently - and am pretty new to tomcat / ... why would people use it on top of apache http server, ... web services, they mainly explain what webservices are, what is ...
    (comp.lang.java.programmer)