Re: Network Disk Not Exist Under Tomcat-5.5.9

2005-05-06 Thread NanFei Wang
Hi,Jason

Everything is clear !
Thank so much.

- NanFei

- Original Message - 
From: Jason Bainbridge [EMAIL PROTECTED]
To: NanFei Wang [EMAIL PROTECTED]; Tomcat Users List
tomcat-user@jakarta.apache.org
Sent: Thursday, May 05, 2005 11:02 PM
Subject: Re: Network Disk Not Exist Under Tomcat-5.5.9


On 5/5/05, NanFei Wang [EMAIL PROTECTED] wrote:

 ---
 If I use Tomcat-5.0.18 working in Window2000 and start by startup.bat in
 another Dos Window after log-in with administrator,
 then the test.jsp will get Y:\ exists()=true

This works as you are running Tomcat as the Administrator within the
same session that the Y: drive is mapped, it is basically running
under the same logon AND session of the logged on user.

 If I use Apache Tomcat-5.5.9 which will give web 'Service' automatically,
 (no matter if I log-in with administrator or not log-in)
 then the test.jsp will get Y:\ exists()=false;

This doesn't work as mapped drives are logon and session specific so
eve if you rant the service as Adminstrator it wouldn't work (although
in some bizarre cases it will but shouldn't be relied on).

What you need to do is run the tomcat service as a user that has
windows network privileges (and please don't use Administrator even
for development that's bad practice, create another network account to
use for Tomcat) plus that user needs access to the network share.

The version of tomcat is irrelevant it just happens that you are
running one as the logged in user and the other as windows service.

Regards,
-- 
Jason Bainbridge
http://kde.org - [EMAIL PROTECTED]
Personal Site - http://jasonbainbridge.com

-
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: Network Disk Not Exist Under Tomcat-5.5.9

2005-05-05 Thread Jason Bainbridge
On 5/5/05, NanFei Wang [EMAIL PROTECTED] wrote:

 ---
 If I use Tomcat-5.0.18 working in Window2000 and start by startup.bat in
 another Dos Window after log-in with administrator,
 then the test.jsp will get Y:\ exists()=true

This works as you are running Tomcat as the Administrator within the
same session that the Y: drive is mapped, it is basically running
under the same logon AND session of the logged on user.

 If I use Apache Tomcat-5.5.9 which will give web 'Service' automatically,
 (no matter if I log-in with administrator or not log-in)
 then the test.jsp will get Y:\ exists()=false;

This doesn't work as mapped drives are logon and session specific so
eve if you rant the service as Adminstrator it wouldn't work (although
in some bizarre cases it will but shouldn't be relied on).

What you need to do is run the tomcat service as a user that has
windows network privileges (and please don't use Administrator even
for development that's bad practice, create another network account to
use for Tomcat) plus that user needs access to the network share.

The version of tomcat is irrelevant it just happens that you are
running one as the logged in user and the other as windows service.

Regards,
-- 
Jason Bainbridge
http://kde.org - [EMAIL PROTECTED]
Personal Site - http://jasonbainbridge.com

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



RE: Network Disk Not Exist Under Tomcat-5.5.9

2005-05-04 Thread Peter Crowther
 From: NanFei Wang [mailto:[EMAIL PROTECTED] 
 Why Network Disk Not Exist Under Tomcat-5.5.9 ?

Are you running Tomcat as a service?  If so, remember that drive
mappings (eg. mapping Y: to \\myserver\myshare) are user- and
session-specific.  You have mapped a drive as a user; the services on
your computer know nothing about this.

- Peter

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



Re: Network Disk Not Exist Under Tomcat-5.5.9

2005-05-04 Thread NanFei Wang
Dear Peter,
I have already mapped a Network Disk named 'Y'.

My question is :
If the webserver is Tomcat with ver.earlier than Tomcat-5.5.9(like 5.0.18),
Then the test.jsp will get Y:\ exists()=true
But with  Tomcat-5.5.9 ,the test.jsp will get Y:\ exists()=false

Thanks

- NanFei


- Original Message - 
From: Peter Crowther [EMAIL PROTECTED]
To: Tomcat Users List tomcat-user@jakarta.apache.org
Sent: Wednesday, May 04, 2005 3:59 PM
Subject: RE: Network Disk Not Exist Under Tomcat-5.5.9


 From: NanFei Wang [mailto:[EMAIL PROTECTED] 
 Why Network Disk Not Exist Under Tomcat-5.5.9 ?

Are you running Tomcat as a service?  If so, remember that drive
mappings (eg. mapping Y: to \\myserver\myshare) are user- and
session-specific.  You have mapped a drive as a user; the services on
your computer know nothing about this.

- Peter

-
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: Network Disk Not Exist Under Tomcat-5.5.9

2005-05-04 Thread NanFei Wang
Hi,
I have found the solution as follow:
change tomcat service account:
Control Panel  Administrative Tools  Services
change tomcat service log on account: administrator

Now,it works.
the test.jsp will get Y:\ exists()=true

- NanFei

- Original Message - 
From: NanFei Wang [EMAIL PROTECTED]
To: Tomcat Users List tomcat-user@jakarta.apache.org
Sent: Wednesday, May 04, 2005 5:47 PM
Subject: Re: Network Disk Not Exist Under Tomcat-5.5.9


 Dear Peter,
 I have already mapped a Network Disk named 'Y'.

 My question is :
 If the webserver is Tomcat with ver.earlier than Tomcat-5.5.9(like
5.0.18),
 Then the test.jsp will get Y:\ exists()=true
 But with  Tomcat-5.5.9 ,the test.jsp will get Y:\ exists()=false

 Thanks

 - NanFei


 - Original Message - 
 From: Peter Crowther [EMAIL PROTECTED]
 To: Tomcat Users List tomcat-user@jakarta.apache.org
 Sent: Wednesday, May 04, 2005 3:59 PM
 Subject: RE: Network Disk Not Exist Under Tomcat-5.5.9


  From: NanFei Wang [mailto:[EMAIL PROTECTED]
  Why Network Disk Not Exist Under Tomcat-5.5.9 ?

 Are you running Tomcat as a service?  If so, remember that drive
 mappings (eg. mapping Y: to \\myserver\myshare) are user- and
 session-specific.  You have mapped a drive as a user; the services on
 your computer know nothing about this.

 - Peter

 -
 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]



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



Re: Network Disk Not Exist Under Tomcat-5.5.9

2005-05-04 Thread Jason Bainbridge
On 5/4/05, NanFei Wang [EMAIL PROTECTED] wrote:
 Hi,
 I have found the solution as follow:
 change tomcat service account:
 Control Panel  Administrative Tools  Services
 change tomcat service log on account: administrator

Uhm you don't want to do that, running any service as Administrator is
just asking for trouble.

You want a dedicated service account for tomcat, there were some posts
about the pernissions and privileges required for such an account a
while back.

Regards,
-- 
Jason Bainbridge
http://kde.org - [EMAIL PROTECTED]
Personal Site - http://jasonbainbridge.com

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



Re: Network Disk Not Exist Under Tomcat-5.5.9

2005-05-04 Thread NanFei Wang
Dear Jason:
You are right :
-
Uhm you don't want to do that, running any service as Administrator is
just asking for trouble.
You want a dedicated service account for tomcat, there were some posts
about the pernissions and privileges required for such an account a
while back.
 ---

I use Apache Tomcat-5.5.9 which will give web service automatically.
My solution can only solve the 'network disk' mapping only to some
'shareFile' at server side .
For the 'network disk' mapping to other 'shareFile' over the network, it is
in failure !
I really need to access the 'shareFile' in other computers over network in
my Api.

It can only think about to use 'network disk mapping' to access the
'shareFile' over network,
I don't know is it right or not !

Any idea ? Thanks

- NanFei



- Original Message - 
From: NanFei Wang [EMAIL PROTECTED]
To: Tomcat Users List tomcat-user@jakarta.apache.org
Sent: Wednesday, May 04, 2005 9:21 PM
Subject: Re: Network Disk Not Exist Under Tomcat-5.5.9


 Hi,
 I have found the solution as follow:
 change tomcat service account:
 Control Panel  Administrative Tools  Services
 change tomcat service log on account: administrator

 Now,it works.
 the test.jsp will get Y:\ exists()=true

 - NanFei

 - Original Message - 
 From: NanFei Wang [EMAIL PROTECTED]
 To: Tomcat Users List tomcat-user@jakarta.apache.org
 Sent: Wednesday, May 04, 2005 5:47 PM
 Subject: Re: Network Disk Not Exist Under Tomcat-5.5.9


  Dear Peter,
  I have already mapped a Network Disk named 'Y'.
 
  My question is :
  If the webserver is Tomcat with ver.earlier than Tomcat-5.5.9(like
 5.0.18),
  Then the test.jsp will get Y:\ exists()=true
  But with  Tomcat-5.5.9 ,the test.jsp will get Y:\ exists()=false
 
  Thanks
 
  - NanFei
 
 
  - Original Message - 
  From: Peter Crowther [EMAIL PROTECTED]
  To: Tomcat Users List tomcat-user@jakarta.apache.org
  Sent: Wednesday, May 04, 2005 3:59 PM
  Subject: RE: Network Disk Not Exist Under Tomcat-5.5.9
 
 
   From: NanFei Wang [mailto:[EMAIL PROTECTED]
   Why Network Disk Not Exist Under Tomcat-5.5.9 ?
 
  Are you running Tomcat as a service?  If so, remember that drive
  mappings (eg. mapping Y: to \\myserver\myshare) are user- and
  session-specific.  You have mapped a drive as a user; the services on
  your computer know nothing about this.
 
  - Peter
 
  -
  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]
 
 

 -
 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: Network Disk Not Exist Under Tomcat-5.5.9

2005-05-04 Thread Jason Bainbridge
On 5/4/05, NanFei Wang [EMAIL PROTECTED] wrote:
 Dear Jason:
 You are right :
 -
 Uhm you don't want to do that, running any service as Administrator is
 just asking for trouble.
 You want a dedicated service account for tomcat, there were some posts
 about the pernissions and privileges required for such an account a
 while back.
  ---
 
 I use Apache Tomcat-5.5.9 which will give web service automatically.
 My solution can only solve the 'network disk' mapping only to some
 'shareFile' at server side .
 For the 'network disk' mapping to other 'shareFile' over the network, it is
 in failure !
 I really need to access the 'shareFile' in other computers over network in
 my Api.

Run it under an account that has network privileges and access to the
share and acces the share by using the UNC path in the format:

\\machinename\sharename

Regards,
-- 
Jason Bainbridge
http://kde.org - [EMAIL PROTECTED]
Personal Site - http://jasonbainbridge.com

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



Re: Network Disk Not Exist Under Tomcat-5.5.9

2005-05-04 Thread NanFei Wang
Hi, Jason
Would you please to give me a sample code in a *.jsp file
to show how to use \\machinename\sharename

I try to use my test.jsp file as follow
---
%@ page language=java contentType=text/html;charset=Big5 %
%
  String uncPath=remotehostname\\sharedname;
  java.io.File uncPathF= new java.io.File(uncPath);
  out.print(br);
  out.println(uncPath+ exists()=+uncPathF.exists());
%
---
I get: \\remotehostname\sharedname exists()=false
In my Api, I really need to access the 'shareDirectory' in other computers
over network .


If my test.jsp(where 'Y' is mapped) with follow:
---
%@ page language=java contentType=text/html;charset=Big5 %
%
String netWorkDisk=Y:\\;
java.io.File netWorkDiskF= new java.io.File(netWorkDisk);
out.println(netWorkDisk+ exists()=+netWorkDiskF.exists());
%
---
If I use Tomcat-5.0.18 working in Window2000 and start by startup.bat in
another Dos Window after log-in with administrator,
then the test.jsp will get Y:\ exists()=true

If I use Apache Tomcat-5.5.9 which will give web 'Service' automatically,
(no matter if I log-in with administrator or not log-in)
then the test.jsp will get Y:\ exists()=false;

Please advise
Regards

- NanFei








- Original Message - 
From: Jason Bainbridge [EMAIL PROTECTED]
To: Tomcat Users List tomcat-user@jakarta.apache.org
Sent: Thursday, May 05, 2005 10:04 AM
Subject: Re: Network Disk Not Exist Under Tomcat-5.5.9


On 5/4/05, NanFei Wang [EMAIL PROTECTED] wrote:
 Dear Jason:
 You are right :
 -
 Uhm you don't want to do that, running any service as Administrator is
 just asking for trouble.
 You want a dedicated service account for tomcat, there were some posts
 about the pernissions and privileges required for such an account a
 while back.
  ---

 I use Apache Tomcat-5.5.9 which will give web service automatically.
 My solution can only solve the 'network disk' mapping only to some
 'shareFile' at server side .
 For the 'network disk' mapping to other 'shareFile' over the network, it
is
 in failure !
 I really need to access the 'shareFile' in other computers over network in
 my Api.

Run it under an account that has network privileges and access to the
share and acces the share by using the UNC path in the format:

\\machinename\sharename

Regards,
-- 
Jason Bainbridge
http://kde.org - [EMAIL PROTECTED]
Personal Site - http://jasonbainbridge.com

-
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]



Network Disk Not Exist Under Tomcat-5.5.9

2005-05-03 Thread NanFei Wang
Hi All,

My file test.jsp as follow:
---
%@ page language=java contentType=text/html;charset=Big5 %
%
out.print(This page is from WebServer Apache Tomcat/5.5.9br);
out.print(I have made a Network Disk named 'Y'brbr);
out.print(It show that C:\\ existbr);
out.print(But,it show that Network Disk Y:\\ not existbr);
String disk=C:\\;
String netWorkDisk=Y:\\;
java.io.File diskF= new java.io.File(disk);
java.io.File netWorkDiskF= new java.io.File(netWorkDisk);
out.println(disk+ exists()=+diskF.exists());
out.print(br);
out.println(netWorkDisk+ exists()=+netWorkDiskF.exists());
%

By http://localhost:8080/somewhere/test.jsp
I get the following web page show:


This page is from WebServer Apache Tomcat/5.5.9
I have made a Network Disk named 'Y'

It show that C:\ exist
But,it show that Network Disk Y:\ not exist
C:\ exists()=true 
Y:\ exists()=false 


Why Network Disk Not Exist Under Tomcat-5.5.9 ?

Some one can help me, Thanks

By NanFei