Hi all,
In the
java Program i try to create a file in network drive and it works fine when it run as a java application.When i try to run the same program as an window service it not able to create a file.
I used Java wrapper service for the window service and used this reference
https://coderanch.com/t/328372/java/java/Map-drive-access-through-Java I installed the service and create a new user account with the adminstative rights and add user in start-->Administative tool-->Local security policy-->User Right Assignment-->Log on service
Then Start-->Administative tool-->Service seleted my service and right click properties and went to Log on Tab.In Log On Tab selected "This account" and selected the created user account and given password for the users.
Now i started the service, it started without any error.But when i try to access the network drive it throws Exception like this:
INFO | jvm 1 | 2008/08/26 14:35:52 | java.io.IOException: An unexpected network error occurred
INFO | jvm 1 | 2008/08/26 14:35:52 | at java.io.WinNTFileSystem.createFileExclusively(Native Method)
INFO | jvm 1 | 2008/08/26 14:35:52 | at java.io.File.createNewFile(File.java:850)
i have given the UNC Path for file creation and the mapped network drive is accessible from windows explorer.
Please help me to create the file in the network drive when the program is running as a service.
Thanks,
Jayam