Solved

create a text file from jsp using JBOSS

Posted on 2009-03-31
3
758 Views
Last Modified: 2013-12-02
Hello Experts,

I am trying to create a text file from jsp in jboss , it is working fine if i run standalone java program but from jsp it says Access Denied exception, please help

Thanks,
Kothakotha
Writer output1 =null;
            String text = "JBOSS";
           String PROD2 = "abcd-web-server";
 
String fileLoc1 = "\\"+PROD2+"\\d$\\";
            File file1 = new File("\\"+fileLoc1+"write.txt");
            
            System.out.println("Chk file read" +file1.canRead());
            output1 = new BufferedWriter(new FileWriter(file1));
    output1.write(text);
    output1.close();

Open in new window

0
Comment
Question by:kothakotha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
ramazanyich earned 250 total points
ID: 24036727
the problem is that jboss server could be run as another user (or even localsystem user if it is run as windows service). And also you are trying to save to network shared folder which has to be mapped then jboss server is running.
I would suggest to create file not using absolute path but relative path and use some other programs to transfer created files, eg. some batch files which will do transfer files using FTP (or you can also do FTP using JAVA if you want)
0
 

Author Comment

by:kothakotha
ID: 24041592
Thanks for the solution...i modified my jboss userto use my user credentials, it worked fine..

0
 

Author Closing Comment

by:kothakotha
ID: 31565091
checking the jboss credentials helped me to solve the problem, thanks
0

Featured Post

Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Verbose logging is used to diagnose garbage collector problems. By default, -verbose:gc output is written to either native_stderr.log or native_stdout.log.   It is also possible to redirect the logs to a user-specified file. This article will de…
This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question