Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

java code to export file from java application which is deployed in Unix Server to windows PC

I have a java application which I runs as expected on localhost (Windows 7). Basically the purpose of this application is to pull the data from database and display's on screen, if user wants this content to export it to his local machine then he can export it. This working as expected from my local machine (windows 7). After deploying the WAR file in Unix server and run it, then it is looking for location that I gave, it's not downloading the file. Here is the exception that I'm getting...

Error while generating report: C:/ArchieveTool/ArchieveTool/output/02012014020842.xls (No such file or directory)



at com.sw.sirax.process.MainServlet.exportFile(Unknown Source)

at com.sw.sirax.process.MainServlet.doPost(Unknown Source)

at javax.servlet.http.HttpServlet.service(

at javax.servlet.http.HttpServlet.service(

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(

at org.apache.catalina.core.ApplicationFilterChain.doFilter(

at org.apache.catalina.core.StandardWrapperValve.invoke(

at org.apache.catalina.core.StandardContextValve.invoke(

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(

at org.apache.catalina.core.StandardHostValve.invoke(

at org.apache.catalina.valves.ErrorReportValve.invoke(

at org.apache.catalina.valves.AccessLogValve.invoke(

at org.apache.catalina.core.StandardEngineValve.invoke(

at org.apache.catalina.connector.CoyoteAdapter.service(

at org.apache.coyote.http11.AbstractHttp11Processor.process(

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(


at java.util.concurrent.ThreadPoolExecutor.runWorker(

at java.util.concurrent.ThreadPoolExecutor$


Here is the piece of code that I'm using to export the file:

enter code here

public String createExcelReport(DataHelper helper) throws Exception{


Workbook wb = new HSSFWorkbook();

setCellData(helper, wb);

SimpleDateFormat format = new SimpleDateFormat("MMddyyyyhhmmss");

String filePath = "C:/ArchieveTool/ArchieveTool/output/" + System.getProperty("file.separator") + "ArchiveUtility_" + format.format(new Date()) + ".xls";

FileOutputStream stream = new FileOutputStream(filePath);




return filePath;


private String generateReport(DataHelper helper){

String filePath = null;


ExcelGenerator generator = new ExcelGenerator();

filePath = generator.createExcelReport(helper);

}catch(Exception ex){

logger.severe("Error while generating report: " + ex.getMessage());


return filePath;


Please let me know what to change in the code If I need to download that file to downloads folder in win 7 from application which is running on UNIX server...

please someone assist me here.

1 answer

0 votes

Could you explain what this has to do with Atlassian products?

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events