Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Access file denied  RSS feed

 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the following code from opencsv (http://opencsv.sourceforge.net/) to convert my resultset to CSV file. Basically using what this guys has used here (https://stackoverflow.com/questions/39180736/opencsv-sql-writes-only-the-header-and-not-the-table-content)



And I keep getting C:\myuser\file (Access is denied)

Caused by: java.io.FileNotFoundException: C:\myuser\file (Access is denied)

I created file folder inside myuser folder. How would I see what's causing this error? I am running Tomcat locally on Eclipse.
 
Saloon Keeper
Posts: 2476
317
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably the user which Tomcat is running as does not have permission to create folders or write to that directory.

Did you create the folder as an Administrator but are running Tomcat as a regular user?
 
Jack Tauson
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:Probably the user which Tomcat is running as does not have permission to create folders or write to that directory.

Did you create the folder as an Administrator but are running Tomcat as a regular user?



I created the folder as normal user and running Eclipse (which has tomcat linked) as a normal user.
 
Jack Tauson
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jack Tauson wrote:

Ron McLeod wrote:Probably the user which Tomcat is running as does not have permission to create folders or write to that directory.

Did you create the folder as an Administrator but are running Tomcat as a regular user?



I created the folder as normal user and running Eclipse (which has tomcat linked) as a normal user.



Just now I tried running my Eclipse as an Administrator and it still didn't work.
 
Rancher
Posts: 3986
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say that it has Tomcat linked, does that mean it's Eclipse launching Tomcat, or is it simply deploying to it?
 
Marshal
Posts: 6634
443
BSD Linux Mac OS X VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jack Tauson wrote:And I keep getting C:\myuser\file (Access is denied)

Caused by: java.io.FileNotFoundException: C:\myuser\file (Access is denied)

I created file folder inside myuser folder.


So what is the 'file' actually, file or folder?
 
Ron McLeod
Saloon Keeper
Posts: 2476
317
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Liutauras Vilda wrote:So what is the 'file' actually, file or folder?


That's a good question.  If C:\myuser\file is in-fact a folder/directory, you would see an Access is denied failure.
 
The problems of the world fade way as you eat a piece of pie. This tiny ad has never known problems:
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!