java - FileNotFoundException thrown when the file does exists -


I am facing this strange problem.

I am trying to read a file which is located in another machine as a shared machine:

  \\ Remote-machine \ dir \ MyFileHere Txt  

When I run a standalone application (a 16-line Java file) everything is fine. But when I try to read the same file using the same file and in the same way a server "engine" (this is an application engine, much like the Java AE application server where you can run Java programs ) "FileNotFoundException" is thrown.

However, I will allow some kind of permission, so I map the resource as a drive: K: \

My Java file runs again, reads, OK is.

"Engine" -> FileNotFoundException.

Run my Java file again when I copy the file to a local machine (C: \ MyFileHere.txt), no exception is thrown.

Question

Could this be due to FileNotFoundExccption?

I am using Java 1.5

As far as I know the engine uses Java very transparently

to anyone Have suffered similarly?

Additional questions? What would be a good attitude for this solution? I am beginning to think about serving those files and they are read through http, but I think it is too much, this is the reason why the SMB protocol is in the first place, right?

Could also be a security manager (I have not used it before, but I know that it exists)

Wounds' if this happens in case of security Instead of throwing a security exemption?

Thank you very much.

Edit

Resolve Thanks Steve W.

It has been discovered that this engine has been launched from Jiroji with "launch anneve". Therefore, an .exe is created which will in turn run a JVM with the specified app.

This application is self-launcher when it starts the engine, in some way (I do not understand that the user or the owner of the JVM process) is the system AS Steve said, this user's There is no access to nearby networks, and thus can not be read from shared resources or mapped drives.

Solution (manual reporting to the manufacturer manually) One for the engine manually The CMD file is for creating. Since it will be launched manually, the user must have access to the network.

I have used "Processor Explorer" from SSINNnnels, so that the command line address to be used to run the engine app.

What could happen!

Thanks for the posters.

Is shared resource protected by username and password? And if so, is your app engine running as that user? If your app engine is running as a Windows service, then the Windows service is not running as a "Local System Account". This account can not access the network. To run as a user with the right to access the shared drive, you have to configure your service.


Comments