0

I managed to get this running but I'm facing a lot of problems that only occur when the application is running with java web start. When I run it from within my IDE it runs fine.

  1. Static content that should be served out of the box from within a folder named 'static' is not found in the jar. I wrote a mapping method to get it with getClass().getResourceAsStream() and write it to the response.
  2. On my Win 7 & Java 8 machine, the used socket is not closed when shutting down. I see jp2launcher.exe that keeps running and probably prevents spring boot getting the shutdown hook called to clean up.
  3. Apparently there are some jars in the class path that aren't found.

    java.io.FileNotFoundException:Jar URL cannot be resolved to absolute file path 
        because it does not reside in the file system: 
        https://mysite/webstart/org.springframework.boot-spring-boot.jar
    

Someone an idea what causes this?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Bart
  • 11
  • 1
  • 2
  • *"from within a folder"* DYM a directory on the local file system? How does it get there for the clients that are launching this app. off the internet? How do the contents of the directory get there? – Andrew Thompson Mar 23 '16 at 02:58
  • It's in the main jar. As described here : [27.1.4 Static Content](http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-web-applications.html) – Bart Mar 23 '16 at 07:44
  • *"It's in the main jar."* A 'folder' is a GUI concept. Please stop using it. A directory is what a 'folder' on screen will show, but a Jar does not contain directories in any useful sense, they are merely a collection of `ZipEntry`s that might include a directory path-like prefix. Even if you have managed to get the 'main Jar' to the client using Java Web Start, none of those resources will be available as `File` (or directory). An [tag:embedded-resource] must be accessed by URL. To access the directory and files as `File` it will be necessary to expand it to a path on the local file system. – Andrew Thompson Mar 23 '16 at 08:13
  • OK, it's a directory. But it should be available according to the spring-boot docs. – Bart Mar 23 '16 at 09:11

0 Answers0