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 9042013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:22:47+00:00 2026-06-16T10:22:47+00:00

I have created an application to generate barcode images which store the images in

  • 0

I have created an application to generate barcode images which store the images in public/images/barcode using the following code

String dir = Play.application().getFile("public/images/barcode").getAbsolutePath();
String barcode = "46062161";
BarcodePrinter.print(barcode,dir + "/"+barcode+".png"); 

public class BarcodePrinter{ 
  private static void Save_image(Image image,String filePath)
  {
    try 
    {
      BufferedImage bi = (BufferedImage) image;
      File outputfile = new File(filePath);
      ImageIO.write(bi, "png", outputfile);
    } catch (IOException e) 
    {
      Logger.info(e.getMessage());
    }
  }
}

and in my view file

@imgpath(barcode:String) = @{
"/assets/images/barcode/"+barcode+".png"
}
<img src="@imgpath(barcode)" />

this code work only on development and it does not work in heroku. I got this error from logs

java.io.FileNotFoundException: /app/target/../public/images/barcode/46062161.png (No such file or directory)

please help me to solve this problem. Thanks

  • 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-06-16T10:22:49+00:00Added an answer on June 16, 2026 at 10:22 am

    You probably don’t want to write to the file system on heroku anyway. Here is the relevant part of the documentation:

    Ephemeral filesystem

    Each dyno gets its own ephemeral filesystem, with a fresh copy of the
    most recently deployed code. During the dyno’s lifetime its running
    processes can use the filesystem as a temporary scratchpad, but no
    files that are written are visible to processes in any other dyno and
    any files written will be discarded the moment the dyno is stopped or
    restarted.

    The best solution would probably be a cloud storage service like S3.

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

Sidebar

Related Questions

I have created an application using Adobe Flex. I took all the files from
I have created an application which needs to have a profile box tab which
I have created an application that uses settings.settings to store some user specific settings
I have created a simple application using rails new simple_cms -d mysql2 After running
I have created one web application using PHP. I want know the IP randomly
Have started playing with Xcode 4.2, and created a single page application using storyboard
I have created a new silverlight business application in visual studio. It auto generates
I have created application where i just need to access data form assets folder.
I have created an application in windows form. Once I submit the application, the
I have created Windows Application. In this, I have multiple tables in dataset, now

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.