File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Web application - access remote server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Web application - access remote server" Watch "Web application - access remote server" New topic

Web application - access remote server

Matthew Hersee

Joined: Dec 19, 2006
Posts: 9

I am running a local (localhost) web application that needs to access a VSS installation on a remote machine via a DOS command line on my local machine.

I have written the java (Runtime.exec etc) to run the DOS command. But evidently I get an "access is denied" error when the command line tries to access the remotely installed VSS ini file.

My question is this - how can i work out what user my java web app is running as? Or is there a way of making the webapp impersonate my user rights for this connection?

if i can find this out then i can get my IT department to give this user rights to access the remote machine.

Thanks in advance

Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11778

Hi Matthew,

It sounds like you have solved your problem in your other posts, but just to provide an answer to this one ...

Typing "SET" at the command prompt will provide you with all the environmental variables that the current environment knows about.

So all you need do is run the set command through your call to Runtime.exec within Tomcat, and you should be able to see the user that Tomcat is currently running as.

Regards, Andrew

The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
I agree. Here's the link:
subject: Web application - access remote server
It's not a secret anymore!