Solved

create a text file from jsp using JBOSS

Posted on 2009-03-31
3
749 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
tomat 8 server option not available in eclipse 8 110
Can't get intermediate Certificate to work in Tomcat 9 113
Load testing - websockets 1 417
Usiing_selfsigned_ssl_certificate 5 94
-Xmx and -Xms are the two JVM options often used to tune JVM heap size.   Here are some common mistakes made when using them:   Assume BigApp is a java class file for the below examples. 1.         Missing m, M, g or G at the end …
Configure Web Service (server application) I. Configure security for Web Services methods First, we need to protect Session bean which implements the service: 1. Open EJB deployment descriptor (ejb-jar.xml) in the EJB project that contains you…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

863 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now