• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Shared Drive access from WebSphere

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using JAVA IO API in my websphere application for accessing file located in shared drive. I am using absolute naming pattern as par JAVA IO specification which says "For Win32 platforms, the prefix of a pathname that contains a drive specifier consists of the drive letter followed by ":" and possibly followed by "\" if the pathname is absolute. The prefix of a UNC pathname is "\\"; the hostname and the share name are the first two names in the name sequence. A relative pathname that does not specify a drive has no prefix."

The application�s file access logic is like below:

********************************************************************************************************************************************************

String pdfStatementPath = "L:\\LOAN\\LOAN_PDF\\test.pdf";

Java.io.File l_file = null;

l_file = new Java.io.File(pdfStatementPath);

if(!l_file.canRead()){ //Tests whether the application can read the file denoted by this abstract pathname.

System.out.println("File " + pdfStatementPath + " can not be read from shared location.");

}

else{

//logic to read the file

}

********************************************************************************************************************************************************

Please note that if I put �LOAN� folder in websphere application server�s local drive it can be accessed using same application.

Success case:
C:\LOAN\LOAN_PDF\test.pdf

Failure case:
L:\LOAN\LOAN_PDF\test.pdf or
\\<server-name>\<shared folder name>\LOAN\LOAN_PDF\test.pdf

I am not getting any exception while executing above logic.

The same file can be read from the network drive if I use independent java file with the same logic.

Please guide..

Thanks-in-advance
Alok
 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe it's a good idea to post which version of WAS your using. I'm using Was 6.1 (currently only in a test environment) and somehow we cant get it to read from the shared drives, for which you've to be authenticated. The problem you experienced is not the same, but similar to our problem: not being able to "classload" (property files) from shared drives. We tried to tell the server that it should run under my account but that did not work. Next we're going to try to run the server normal (that is not in services mode). Which will be next week.

Regards,
Jeroen.
 
Anshul Jain
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks jeroen....

I am using WAS6.0.2. And I have resolved this issue by following these who steps:
1. I restarted was_nodeagent service as Administrator which was by default "Local System".
2. I changed folder path in UNC format as per Microsoft specification. Which says "A service (or any process that is running in a different security context) that must access a remote resource should use the Universal Naming Convention (UNC) name to access the resource."
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using RAD 7.0 with WAS 6.0 on my winodws desktop. I have an application that needs to access files(images) in a directory on a unix box. Under Tomcat I was able to create a project in Eclipse and map to the directory on the unix server. I don't think I can do that under WAS. I probably have to do something like what is mentioned in your message. Any ideas?

Thanks in advance.
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Alok Mahajan:
Thanks jeroen....

I am using WAS6.0.2. And I have resolved this issue by following these who steps:
1. I restarted was_nodeagent service as Administrator which was by default "Local System".
2. I changed folder path in UNC format as per Microsoft specification. Which says "A service (or any process that is running in a different security context) that must access a remote resource should use the Universal Naming Convention (UNC) name to access the resource."



Hi Alok,

We are facing the same problem with the shared drive and Websphere. Can you please let me know in detail what you did to get it working?

I am using WAS 6.0.2 on Win XP Java 1.4.2. We start the server using AppSever\bin\startServer.cmd. But we dont start nodes or node agents when we start the server.

We try to access the shared drive as in "J:\temp" where J is mapped to a folder to which the user has all rights.

Thanks in advance,
Vedhas
 
Anshul Jain
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

According to Microsoft, our issue is like below:
http://support.microsoft.com/default.aspx/kb/180362/en-us/

I did two changes and it worked fine:
1. Instead of accessing using shared drive name I used full system name
like instead of L:/temp/ I used \\fileservername\temp\
2.App server node should "log on as" administrator or admin user.
 
Vedhas Pitkar
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Alok Mahajan:
Hi,

According to Microsoft, our issue is like below:
http://support.microsoft.com/default.aspx/kb/180362/en-us/

I did two changes and it worked fine:
1. Instead of accessing using shared drive name I used full system name
like instead of L:/temp/ I used \\fileservername\temp\
2.App server node should "log on as" administrator or admin user.



Thanks for the info, Alok.

I forgot to mention that the above works on some m/cs and not on others (all Win XP SP2). This is what puzzles me and leads me to think that this may be an OS issue.

Any thoughts?
 
reply
    Bookmark Topic Watch Topic
  • New Topic