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

  • Home
  • SEARCH
  • 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 930981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:25:39+00:00 2026-05-15T20:25:39+00:00

I have a java class that I use to create a text file from

  • 0

I have a java class that I use to create a text file from a web application. I’m using the following code:

private void CreatePaymentFile(String QueryCriteria) {
BigDecimal TotalPay;
DecimalFormat df2 = new DecimalFormat("00000");
String RecordString = null;
try{
String fileName = "\\\\fileandprint\\Apps\\Jury\\SHARE\\Payment_" + shortdateToday + SeqID + "24400.txt";
File f = new File(fileName);
FileOutputStream fop = new FileOutputStream(f);
SetPaymentFileName("Payment_" + shortdateToday + SeqID + "24400.txt");
FileWriter PaymentStream = new FileWriter(fileName,true);
BufferedWriter out = new BufferedWriter(PaymentStream);

// TODO Auto-generated method stub
String RecordStringFormat = "%-220s%-3s%-4s%-3s%-5s%-5s%-5s%-5s%-30s%-287s%-10s%-150s%-1s%-30s%-1s%-80s%-10s%-6s%-6s%-10s%-20s%-5s%-12s%-43s%-2s%-10s%-70s%-3s%-1s%-1s%-10s%-4s%-6s%-10s%-10s%-5s%27s";
JurorPayDetails JurorpayDetails = new JurorPayDetails();
ArrayList<JurorPayDetails.JurorPayDetailsTable> JurorPayDetailsObjList = new ArrayList<JurorPayDetails.JurorPayDetailsTable>();
JurorpayDetails.setJurorPayDetailsSql("Select P.*, GroupAssignment, TermDateServed, LastName, FirstName, Street1, Street2, City, State, ZipCode, Mileage, PublicEmployee, PayTime, PayMiles from PayDetails P INNER JOIN Jurors J ON P.JurorID = J.JurorID INNER JOIN Address A ON J.JurorID = A.JurorID where AddressType = 'M' and J.TermDateServed IN (" + QueryCriteria +") ORDER BY GroupAssignment, LastName");
boolean indicator = JurorpayDetails.setListOfJurorPayDetails();

if (indicator == true)
{
int size = JurorpayDetails.getListSize();
JurorPayDetailsObjList = JurorpayDetails.getJurorPayDetailsList();
for (int i=0; i<size; ++i){
JurorPayDetails.JurorPayDetailsTable eachPayable = JurorPayDetails.JurorPayDetailsTable)JurorPayDetailsObjList.get(i);
TotalPay = eachPayable.HoursAmount.add(eachPayable.MilesAmount);
RecordString = String.format(RecordStringFormat, ((eachPayable.Street1.trim() + " " + eachPayable.Street2.trim()).trim()), "1","B","1","WFB10","00000","21801","21801",eachPayable.City,"",longdateToday,"", "N", "21801_" + eachPayable.JurorID,"N",((eachPayable.FirstName.trim() + " " + eachPayable.LastName.trim()).trim()),"",    "PYMTLD","0",longdateToday,"21801" + shortdateToday + SeqID,df2.format(i + 1),eachPayable.Zipcode,"","RE","0","","CHK","N", "Y",longdateToday,"PYMT",eachPayable.State, "","001","01200",Paymentdf.format(TotalPay));
out.append(RecordString);
out.newLine();
}
out.close();
}
}catch (Exception e) {
System.err.println("error: " + e.getMessage());
}
}

not a big thing, run a query, get the results and write them in a fixed format to a file and store it on one of our Windows servers.

This works fine when run locally, however, when we put the application on the Linux web server (and change the settings to Linux), the files are not stored in the correct network location.

I have tried using Windows file notation and Linux file notation:
\\fileandprint\Apps\Jury\SHARE\
and
//fileandprint/Apps/Jury/SHARE/

and yes the file location does exist, as I said when run locally in development it works, only when it’s on the Linux box does it not store the files correctly.

Any suggestions?

  • 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-15T20:25:40+00:00Added an answer on May 15, 2026 at 8:25 pm

    you need to explicitly mount the network share into a local directory. Please see http://linuxwiki.de/smbmount for an explanation on how to do this.

    Directly accessing the network share works in the Gnome and KDE file managers because they apply some magic themselves. On the operating system level those pathes don’t exist.

    If this does not solve the issue, please attach the exception output. You can change

    System.err.println("error: " + e.getMessage());
    

    to

    err.printStackTrace();
    

    This will include the exception name and stacktrace in addition to the message. This is especially helpful because the message may be null and you can easily see in which line of your code the exception occurred.

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

Sidebar

Ask A Question

Stats

  • Questions 499k
  • Answers 499k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The Flex SDK is free. You can use it, with… May 16, 2026 at 12:41 pm
  • Editorial Team
    Editorial Team added an answer I'd agree that this is driver related. The {SQL Server}… May 16, 2026 at 12:41 pm
  • Editorial Team
    Editorial Team added an answer Transactions in MySQL are always per-connection, there's no other way… May 16, 2026 at 12:41 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I support a legacy Java application that uses flat files (plain text) for persistence.
I have a little Java project where I've set the properties of the class
How can I have a text file (or XML file) represented as a whole
I'm trying to use Antlr for some text IDE-like functions -- specifically parsing a
Related: How do I create a static local variable in Java? Pardon if this
I make use of: NetBeans IDE 6.7.1, GlassFish v2.1, Oracle 10g XE, JAVA 6
Greetings, I have a complicated scenario to handle. I have a wsdl file which
I have a model that has several properties. The properties can be primitive (String)
I'm trying to use Circumflex ORM (as suggested on StackOverflow - here , here
I'm looking for the most basic description of how to draw text within a

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.