Search code examples
javaswingweb-applicationsjava-web-start

Webstart Not reading Local file


HI guys I have this swing Application that connects to a hosted DB. It reads the Database Parameters from a Local File "Parameters". When I run it Locally, it is able to read the Parameters from the Parameters file but When I launch it using Java Webstart I get this Exception:

java.io.FileNotFoundException: parameters.param(The system cannot find the File Specified)

Is there a favourable way to make the java Webstart read that file because the Application will not connect to the Db without it.??

When I double CLick Direactly on the JNLP file the Validation does not come But I cannot run it using the Html Page: My Html looks like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

</head>
<body>
    <h3>Test page for launching the application via JNLP</h3>
    <script src="http://java.com/js/deployJava.js"></script>
    <script>
        deployJava.createWebStartLaunchButton("launch.jnlp")
    </script>
    <!-- Or use the following link element to launch with the application -->
    <!--
    <a href="launch.jnlp">Launch the application</a>
    -->
</body>


Solution

  • Placing the file in the jar and accessing it using getresource() Solved the Problem as suggested by trashgod.