Note that there are some explanatory texts on larger screens.

plurals
  1. POJavaFX native packaging: https request throws "SunTlsRsaPremasterSecret KeyGenerator not available"
    primarykey
    data
    text
    <p>I am using the new "native packaging" feature of JavaFX 2.2 Developer preview (Build 19). I can build successfully an installer (.exe). However, once I started the JavaFX application that was deployed using that installer, I get the following exception for every HTTPS-request I do:</p> <pre><code>javax.net.ssl.SSLKeyException: RSA premaster secret error at sun.security.ssl.RSAClientKeyExchange.&lt;init&gt;(RSAClientKeyExchange.java:114) ... Caused by: java.security.NoSuchAlgorithmException: SunTlsRsaPremasterSecret KeyGenerator not available at javax.crypto.KeyGenerator.&lt;init&gt;(KeyGenerator.java:158) ... </code></pre> <p>When I start my code from Eclipse, or when I start the application form command line, everythings works just fine. The problem only appears when I start the application deployed by the installer.</p> <p>How can I avoid this exception?</p> <p>I wrote some demo code to show the problem.</p> <p>Java FX Application:</p> <pre><code>package dk.bundleDemo; import java.net.HttpURLConnection; import java.net.URL; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.layout.AnchorPane; import javafx.stage.Stage; import org.apache.log4j.Logger; public class RunBundleTest extends Application { private static Logger log = Logger.getLogger(RunBundleTest.class); @Override public void start(Stage primaryStage) throws Exception { AnchorPane root = new AnchorPane(); Label statusLable = new Label(); String statusText = "Status is: "; root.getChildren().add(statusLable); Scene scene = new Scene(root, 200, 200); primaryStage.setScene(scene); primaryStage.show(); try { URL url = new URL("https://www.google.com"); HttpURLConnection conn = (HttpURLConnection)url.openConnection(); Integer responseCode = conn.getResponseCode(); statusLable.setText(statusText + responseCode.toString()); } catch (Exception e) { log.error("error while connecting", e); } } public static void main(String[] args) { launch(args); } } </code></pre> <p>Ant script for creating installer:</p> <pre><code>&lt;project name="JavaFXSample" default="build and deploy" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant"&gt; &lt;target name="build and deploy"&gt; &lt;property name="applet.width" value="500"/&gt; &lt;property name="applet.height" value="500"/&gt; &lt;property name="application.title" value="BundleTest"/&gt; &lt;property name="application.vendor" value="TestVendor"/&gt; &lt;property name="build.classes.dir" value=".\bin"/&gt; &lt;property name="basedir" value="."/&gt; &lt;property name="dist.dir" value="..\..\BundleTest"/&gt; &lt;property name="javafx.lib.ant-javafx.jar" value="C:\Program Files\Java\jdk1.7.0_06\lib\ant-javafx.jar"/&gt; &lt;taskdef resource="com/sun/javafx/tools/ant/antlib.xml" uri="javafx:com.sun.javafx.tools.ant" classpath="${javafx.lib.ant-javafx.jar}"/&gt; &lt;fx:application id="bundleTest" name="bundleTest" mainClass="dk.bundleDemo.RunBundleTest" /&gt; &lt;fx:resources id="appRes"&gt; &lt;fx:fileset dir="lib" includes="*.jar"/&gt; &lt;/fx:resources&gt; &lt;fx:jar destfile="lib\RunBundleTest.jar"&gt; &lt;fx:application refid="bundleTest"/&gt; &lt;fx:resources refid="appRes"/&gt; &lt;manifest&gt; &lt;attribute name="Implementation-Vendor" value="${application.vendor}"/&gt; &lt;attribute name="Implementation-Title" value="${application.title}"/&gt; &lt;attribute name="Implementation-Version" value="1.0"/&gt; &lt;/manifest&gt; &lt;fileset dir="${build.classes.dir}"/&gt; &lt;/fx:jar&gt; &lt;fx:deploy width="${applet.width}" height="${applet.height}" outdir="${basedir}/${dist.dir}" embedJNLP="true" outfile="${application.title}" nativeBundles="all" &gt; &lt;fx:application refId="bundleTest"/&gt; &lt;fx:resources refid="appRes"/&gt; &lt;fx:info title="${application.title}" vendor="${application.vendor}"/&gt; &lt;/fx:deploy&gt; &lt;/target&gt; &lt;/project&gt; </code></pre> <p>More about JavaFX Native Packaging: <a href="https://blogs.oracle.com/talkingjavadeployment/entry/native_packaging_for_javafx" rel="nofollow">https://blogs.oracle.com/talkingjavadeployment/entry/native_packaging_for_javafx</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload