I have made a java program that fetches the bitcoin value every minute and prints it on a png image. I've added this program to a Tomcat server and I can see that it runs. mypimage.png gets updated. But while tomcat is running, I can't access the picture with localhost:8080/MyAppFolder/myimage.png. It just keeps loading forever or says connection refused.
The java program is a infinity loop, since I want the picture to keep being updated while Tomcat is running.
MyAppFolder contains the WEB-INF folder and myimage.png. WEB-INF contains classes folder which contains two folders myPackage and images. My package contains the class, and images contains the original image, which I add the bitcoin value to.
WEB-INF also contains a lib folder and web.xml which I'll paste the code to below.
I have tried to remove the WEB-INF folder from MyAppFolder and restart Tomcat. And then it works to access the picture through localhost:8080/MyAppFolder/myimage.png.
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> myDisplayName
<servlet>
<servlet-name>myServlet</servlet-name>
<servlet-class>myPackage.Btc</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>