• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Servlet can't write to a file on server

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having difficulty writing to a file on the server from within a servlet.
Whenever the servlet tries to open the file I get the following Tomcat exception report:

I must mention that I'm just using Sun's J2SDKEE1.3 to test this app.
I've set my .java.policy file (in my home directory) to the following:

Can anyone help me sort this out before I go insane.
Another question this leads to is when is the security policy loaded?
Thanks for your help.
Bartender, give my a whiskey.
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What user is your servlet container running as? Do they have RW permissions in that directory?
 
Lee Feder
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply.
I just tried the same test on my Mac and it worked fine straight away. Wierd
The file I was trying to write on Win2K was allowing Everyone Full Control. I even tried giving myself full control as well (that's how desperate I am).
The only obvious difference between my Win2K and MacOS X set up is the Mac is running Deploy Tool 1.3.1 and the Windows machine, v1.3.
I hate these problems that have no obvious reason. I thought, perhaps that servlets obeyed similar security restrictions as applets. It seems not.
[ April 13, 2002: Message edited by: Lee Feder ]
 
I'm gonna teach you a lesson! Start by looking at this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic