1

after web starting the .jnlp file from localhost and tomcat-apache running locally I always get the error that a .jar file is missing from java. The message given reveals that the .jnlp file tries to locate the .jar file wrongly by "translating" the forward slash '/' I have defined in the .jnlp located in the tomcat webapps directory.

Specifically the .jar file I am referring to is in \lib directory (Windows) of the root directory where the application is deployed on the apache-tomcat server "\lib\mysql-connector-java-8.0.19.jar". When running the Web App from the server and even that in the .jnlp I have altered those back slashes to slashes the error comes out showing a forward windows slash in the path.

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0" xmlns:jfx="http://javafx.com" codebase="http://localhost:8080/sfp_levels/" href="JavaFX_SFP_db_levels_GUI.jnlp">
  <information>
    <title>JavaFX_SFP_db_levels_GUI</title>
    <vendor>usr</vendor>
    <description>Test App</description>
    <offline-allowed/>
  </information>
  <resources>
    <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
    <jar href="JavaFX_SFP_db_levels_GUI.jar" size="389828" download="eager" />
    <jar href="lib/mysql-connector-java-8.0.19.jar" size="2464011" download="eager" />
  </resources>
<security>
  <all-permissions/>
</security>
  <applet-desc  width="800" height="600" main-class="com.javafx.main.NoJavaFXFallback"  name="JavaFX_SFP_db_levels_GUI" >
    <param name="requiredFXVersion" value="8.0+"/>
  </applet-desc>
  <jfx:javafx-desc  width="800" height="600" main-class="javafx_sfp_db_levels_gui.JavaFX_SFP_db_levels_GUI"  name="JavaFX_SFP_db_levels_GUI" />
  <update check="always"/>
</jnlp>

And the error comes back looking the .jar as "http://localhost:8080/sfp_levels/lib\mysql-connector-java-8.0.19.jar"

I have cleared all caches (Browser's and Java's) reinstalled Tomcat-Apache copied several times the correct .jnlp file to the webapps path in the server and signed the .jar files correctly from NetBeans (then Clean&Build)

I cannot understand where this windows forward slash comes into the href declaration after executing the Web App.

Version of Tomcat is 8.5.50 Version of Java (JDK&JRE) is 1.8.0_241 OS Windows 10

webprogrammer
  • 2,393
  • 3
  • 21
  • 27
markman8
  • 31
  • 4
  • Are u hutting this issue https://bugs.openjdk.java.net/browse/JDK-8144165 ? – Optional Feb 03 '20 at 16:02
  • Yes! It is the exact error I get also – markman8 Feb 03 '20 at 16:06
  • Ok. After looking into the .html file generated by NetBeans there is an entry under – markman8 Feb 04 '20 at 07:49

1 Answers1

0

Success! After generating a single .jar file following stack overflow's single_jar_instructions and mkyong's signing .jar file and generating a .jnlp file, I have managed to make my WebStart application to work. Files where deployed on the same Tomcat Server I have tried all day yesterday to make it run with no success (Using NetBeans generated files in /dist directory). This time it worked!

Edit: looking more into it I found that in the original project as it comes out of NetBeans /dist directory if I eliminate all entries for scripting in the original html generated file and correct the '\' to '/' in the .jnlp file it runs correctly. WebStart application appears and runs fine. Scripting from html file calls for /web-files/dtjava.js JavaScript auto generated file yet I cannot find where in that script it checks for the path of the jar it keeps getting wrong. I am using SeaMonkey as a browser launching the WebStart application.

markman8
  • 31
  • 4