0

I used Eclipse to deploy my Java web application on AWS Elastic Beanstalk which uses a UNIX 64-bit environment. And my application needs to read a file from the same project folder. However, after I run the project, the log in the Management Console shows that the directory cannot be found. I tried to resolve this by either using a relative path or a absolute path. But neither worked.

One weired thing is that I cannot find the Tomcat folder in the ec2 instance. Does anyone have an idea about how I can set up my file path in the application or where I should put my file to make it found?

Thank you!

D.Q.
  • 547
  • 2
  • 9
  • 19
  • Add more relevant tags to get people's attention on this question. The current 2 tags dont have many people following them. – Pavan Manjunath Jul 11 '12 at 14:46
  • I hope you find the answer to this. I have the same issue. I can see a tomcat7_deploy_app.sh under tmp, I'll keep looking. – MikeW Sep 05 '12 at 11:19
  • @MikeW, unfortunately, I haven't found out the solution.. – D.Q. Sep 21 '12 at 20:00
  • Try over here. http://stackoverflow.com/questions/12280372/where-can-i-find-the-tomcat-7-installation-folder-on-linux-ami-in-elastic-beanst – MikeW Sep 23 '12 at 12:54

1 Answers1

0

I'm not certain what you're doing with your file, but I had the same problem finding a path to an image to use in a class. I hope this helps!

Preface: I'm deploying my .war to my elastic beanstalk instance via the AWS-Elastic Beanstalk console. I moved my image into the exact same package/folder as the class I'm referencing it in.

BufferedImage imBuff = ImageIO.read(MyAwesomeFooBarClass.class.getResourceAsStream("foobar.png"));

And that's it! I'm sure this isn't the most elegant solution, but it certainly works/I'm a bit crunched for time ;)

vath
  • 153
  • 1
  • 9