Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Can Anyone Check This Link

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Can Anyone Check This Link

    Hello,
    Pls check this link,

    Custom Directory Creation On Server

    The thing deployed application does is, it allows the user of the web-app to create a folder on the server with a name of his/her choice and upload his/her files into that folder. Here is what I am getting as Exception

    Caught Exception: java.security.AccessControlException: access denied (java.io.FilePermission /var/chroot/home/content/b/r/i/bringlifeto/html/MyDemoDirApp/demodir/testdir write)

    Can any body explain me this issue and provide me a correct way to implement it.


  2. #2
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: Can Anyone Check This Link

    Its because the application server (tomcat, jboss or whatever) you are using is run as a certain user on the operating system. This user does not have access to write anything to the folder specified as /var/chroot/home/content/b/r/i/bringlifeto/html/MyDemoDirApp/demodir/testdir

    To solve this problem you need to make sure that the user you start your application server as has write access to the folder in question by using chmod or chown.

    // Json

  3. #3
    Junior Member
    Join Date
    Oct 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Can Anyone Check This Link

    Dear JSon,
    Thanks for replying. We are having an Hosting account with GoDaddy Server(A Shared Server). Which is based on Linux Server and Apache Tomcat 5.x. I changed permission to the deployed web-app to write via Control Panel then also I am getting the same exception. But everthing works fine on Windows locally.
    Attaching my code for your reference.

    I don't know what to do?What documents to refer.

    Please Help

    Regards,
    Arpit U. Gadle
    Attached Files Attached Files

  4. #4
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: Can Anyone Check This Link

    I don't think there is anything in your code that you can do to change this, you need to figure what user is running tomcat and then make sure that user can write to your directories.

    // Json

  5. #5
    Junior Member
    Join Date
    Oct 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Can Anyone Check This Link

    Is there anything which i can use in my code to change the permission of the directory.

  6. #6
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: Can Anyone Check This Link

    Not that I'm aware of.

    Maybe you could call a command line command like chmod or something.

    // Json

Similar Threads

  1. check if a number is an integer
    By rsala004 in forum Java Theory & Questions
    Replies: 3
    Last Post: August 15th, 2009, 04:51 PM
  2. Replies: 5
    Last Post: May 21st, 2009, 03:45 AM
  3. How to upload a file by clicking a link instead of button?
    By raghuprasad in forum Java Theory & Questions
    Replies: 2
    Last Post: May 3rd, 2009, 06:21 AM
  4. Problem in AWT and IFrame implementaion
    By AZBOY2000 in forum What's Wrong With My Code?
    Replies: 9
    Last Post: April 24th, 2009, 04:41 AM
  5. How to Hyper-link pages together in Java?
    By don.java1 in forum Java Applets
    Replies: 5
    Last Post: July 21st, 2008, 06:09 AM