Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6202561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:45:24+00:00 2026-05-24T04:45:24+00:00

I want to write in an xml file located under the conf directory of

  • 0

I want to write in an xml file located under the conf directory of jboss.

I open it like this:

public void initialiserXml() {
        sxb = new SAXBuilder();

        try {
                    String fileXml= System.getProperty("jboss.server.home.dir").concat("/").concat("/conf").concat("/exempleMessage.xml");
            System.out.println("Fichier xml " +fileXml);
            document = sxb.build(fileXml);
            racine = document.getRootElement();
            System.out.println("Fichier Xml trouvé");
        } catch (FileNotFoundException e) {
         System.err.println("Aucun fichier XML trouvé");
        } catch (JDOMException e) {
             System.err.println("Fichier XML mal construit");
        } catch (IOException e) {
             System.err.println("Impossible d ' ouvrir le fichier XML");
        }
   }

and after modification i write the change like this

public void enregistreFichier()
   {
         XMLOutputter sortie = new XMLOutputter(Format.getPrettyFormat());
         try {
            sortie.output(document, new FileOutputStream(fileXml));
        } catch (FileNotFoundException e) {
             System.err.println("Fichier XML source non trouvé");
        } catch (IOException e) {
             System.err.println("Impossible d ' ecrire dans le fichier XML");
        }
   }

This works on my test environment, but when I test this on a production environment (Linux server), it no longer works when
i pass on sortie.output(document, new FileOutputStream(fileXml));
(FileNotFoundException)

I don t understand , my file is found when i open it with saxbuilder , but when i write in , i have a filenotfoundexception

How to solve the problem please?

thank you very much

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:45:27+00:00Added an answer on May 24, 2026 at 4:45 am

    FileNotFoundException is also thrown when you don’t have all needed permission’s to the file. In this case you might be missing write permission from /conf/exempleMessage.xml file

    You should check which user is running jboss by giving command “ps -ef | grep jboss”, it gives you a list all process witch name contains string jboss. After this you change ownership of file to that user by “chown : /conf/exempleMessage.xml”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to write a XML file as below: <?xml version=1.0 encoding=UTF-8?> <books xmlns:xsd=http://www.w3.org/2001/XMLSchema
I want to write a .xml file using the following code into the App_Data/posts.
I want to write a xml file with C#. It is a basic file
I want to write the bulk of data into xml file ,the data coming
I need to generate an XML file in C#. I want to write the
I want to read an xml file, apply a transform, then write to another
I have a string which has an xml inside. I want to write this
I want to write an XML file. I have created an XSD file named
I want to write a java code to read the input XML file and
I recently databounded an xml file to a listbox. Now I want to write

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.