i have an applet that was work fine in java version under 7u45 and in firefox ,but when i updated java to the latest version my applet loads but it does not appear except when I try to inspect the item with chrome, it will display.
Here are the console log:
févr. 02, 2014 11:56:46 AM mt.common.util.applet.myapplet init
Infos: isLoggable(ALL) : true
févr. 02, 2014 11:56:46 AM mt.common.util.applet.myapplet init
Infos: Loading of child applet successfull
févr. 02, 2014 11:56:46 AM mt.common.util.applet.myapplet init
Infos: OK : the child applet is an instance of myapplet
févr. 02, 2014 11:56:46 AM org.modula.applet.document.myapplet1 init
Infos: init() myapplet1 2.0
févr. 02, 2014 11:56:48 AM org.modula.applet.document.myapplet1 init
Infos: End init()
testmepl6
févr. 02, 2014 11:56:48 AM mt.common.util.applet.applet start
Infos: Start...
i call myapplet like this:
var attributes = {id:"appletInstance",
name:"appletInstance",
code:"mt.common.util.applet.myapplet",
codebase:"<%=urlCodeBase %>",
width:150, height:30};
var parameters = {jnlp_href: "<%=urlJnlp %>"};
<div style="text-align: center; float:right;">
<%= bordPanelState.getHTMLTop() %>
<div id="divPopupActions" style="text-align: center; padding: 2px 5px 2px 5px;">
<%if(vUrlFile.size()>0){ %>
<!---------------------------------------->
<!---------------- Applet ---------------->
<!---------------------------------------->
<!-- <script src="http://www.java.com/js/deployJava.js" type="text/javascript"></script> -->
<script src="<%= rootPath %>include/js/java/deployJava.js"></script>
<script type="text/javascript">
deployJava.runApplet(attributes, parameters, '1.6');
</script>
<%} %>
</div>
<%= bordPanelState.getHTMLBottom() %>
</div>
this is my jnlp file
<?xml version="1.0" encoding="UTF-8"?>
<jnlp href="appletContainer.jnlp">
<information>
<title>applet Container</title>
<vendor>MT</vendor>
</information>
<resources>
<!-- Application Resources -->
<j2se version="1.7+" href="http://java.sun.com/products/autodl/j2se" download="eager"/>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se" download="eager"/>
<jar href=myapplet.jar" download="eager"/>
</resources>
<applet-desc
name="Applet Container"
main-class="mt.common.util.applet.AppletContainer"
width="200"
height="300">
</applet-desc>
<update check="always"/>
</jnlp>
I think there might be an error in your applet base code
As JaNeLa correctly reports, there are several issues with your jnlp file. I fixed the problems, try the following:
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="6.0+" href="appletContainer.jnlp">
<information>
<title>applet Container</title>
<vendor>MT</vendor>
<offline-allowed />
</information>
<update check="always" policy="always"/>
<resources>
<j2se version="1.7+" href="http://java.sun.com/products/autodl/j2se"/>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="myapplet.jar" download="eager"/>
</resources>
<applet-desc
main-class="mt.common.util.applet.AppletContainer"
name="Applet Container"
width="200"
height="300"/>
</jnlp>
Interestingly JaNeLa also reports an error about those two j2se tags which is perfectly valid to do. Maybe Andrew Thompson can shed some light on this behaviour, which seem like a bug to me...
Related
My JavaWebStart(using Netbeans) application deploys and functions very well on the apache webserver(localhost), BUT when I connect it to its mysql DB, it only deploys but doesnt function. However, it is connecting very well in Netbeans.
I have tried signing in the jar files using 'keytool' but cmd cannot recognize 'keytool' either.
How do I connect this app to its database?
The JNLP:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jnlp codebase="http://192.168.0.10/JWS2" href="launch.jnlp" spec="1.0+">
<information>
<title>JavaWebStart2</title>
<vendor>Administrator</vendor>
<homepage href=""/>
<description>JavaWebStart2</description>
<description kind="short">JavaWebStart2</description>
<offline-allowed/>
</information>
<update check="background"/>
<resources>
<j2se version="1.8+"/>
<jar href="JavaWebStart2.jar" main="true"/>
<jar href="lib/mysql-connector-java-5.1.18.jar"/>
</resources>
<application-desc main-class="main.NewJFrame">
</application-desc>
</jnlp>
HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test page for launching the application via JNLP</title>
</head>
<body>
<h3>Test page for launching the application via JNLP</h3>
Launch the application
<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 --
>
<!--
-->
</body>
</html>
I am developing a Web page using jsp and html where in I need to read/write from/to a Device connected on Client's System who are accessing the Webpage. The Device is a Serial Device which is connected as COM1(Eg) in Windows. I went through different options available. I found this which serves my purpose. I started learning JNLP for the same. I imported the project and made changes according to my needs. (This project is using jssc.jar). I generated the jar (jSSC-Terminal.jar) and signed with self-generated key. The GUI is being loaded properly but I am unable to access the Serial port on client's machine. Here is my jnlp file launch.jnlp
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jnlp href="launch.jnlp" spec="1.0+" codebase="http://192.168.1.33:8080/abc"
href="launch.jnlp">
<information>
<title>jSSC-Terminal</title>
<vendor>scream3r</vendor>
<homepage href="scream3r.org"/>
<description>jSSC-Terminal</description>
<description kind="short">jSSC-Terminal</description>
</information>
<update check="background"/>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.5+"/>
<jar href="jSSC-Terminal.jar" main="true"/>
<jar href="jssc.jar" download="eager"/>
</resources>
<applet-desc height="500" main-class="applet.Main" name="Main" width="700">
<param name="separate_jvm" value="true"/>
<param name="draggable" value="true"/>
</applet-desc>
</jnlp>
Here is my html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>jSSC-Terminal</title>
<style type="text/css">
body {
margin-left: 10px;
margin-top: 10px;
margin-right: 10px;
margin-bottom: 10px;
}
</style>
</head>
<body>
<applet code="applet.Main" archive="http://192.168.1.33:8080/abc/jSSC-Terminal.jar, http://192.168.1.33:8080/amar/lib/jssc.jar" width="700" height="500">
<param name="separate_jvm" value="true"/>
<param name="draggable" value="true"/>
</applet>
</body>
</html>
I have placed all these files in Tomcat directory as below
/Tomcat/webapps/abc/launch.jnlp
/Tomcat/webapps/abc/jSSC-Terminal.jar
/Tomcat/webapps/abc/index.html
/Tomcat/webapps/abc/lib/jssc.jar
I am unable to get the SerialPort List when run as jnlp. Kindly help me out with a fix if available. Or are there any alternate things available in JSP. Thanks and Regards.
Edit :
Finally found out thank you. I replaced my applet tag and included jnlp location as below :
<applet code="applet.Main" archive="http://192.168.1.33:8080/abc/jSSC-Terminal.jar, http://192.168.1.33:8080/abc/lib/jssc.jar,"http://192.168.1.33:8080/abc/test.jnlp" width="700" height="500">
<param name="separate_jvm" value="true"/>
<param name="draggable" value="true"/>
</applet>
</body>
Your <applet> tag doesn't refer to the .jnlp file. You give access to COM ports in the jnlp file but it's not being used. You have to either use the jnlp file or set permissions in the <applet> tag.
Your link to the jssc example is a page that shows how to use the jnlp file from the <applet> tag.
I've done what you are trying to do with a Java Webstart app and the PureJavaComm library. I bet what you are doing will work once you get the permissions right, though. But if you want to have a look at how I set this up the jnlp file is here: https://bitminter.com/client/bitminter.jnlp (live app)
I try to test the JVM parameters with this JNLP file :
<jnlp spec="1.0+" codebase="" href="">
<information>
<title>Test Applet</title>
<vendor>D2D - Architecture - Composants</vendor>
</information>
<resources>
<!-- Application Resources -->
<!--<j2se version="1.7*" href="" java-vm-args="-ea -Xincgc -verbose -Xmx768m" />-->
<j2se version="1.6*" href="" initial-heap-size="512" max-heap-size="1024M" />
<jar href="Applet.jar" main="true" />
<!-- Si plusieurs jars : mettre plusieurs balises jar -->
</resources>
<applet-desc
name="Test Applet"
main-class="TestApplet"
width="600"
height="300">
</applet-desc>
<update check="always"/>
</jnlp>
When i launch the "jnlp", it taking in the account this but when i launch from a html page with this script :
<body>
<h1>Prototype Applet JRE</h1>
<!-- Script JavaScript pour le déploiement de l'applet -->
<script src="javaScript/deployJava.js"></script>
<!-- Les différentes informations sur l'applet -->
<script>
var attributes = { code:'TestApplet.class', archive:'Applet.jar'} ;
var parameters = {jnlp_href: 'applet.jnlp'} ;
deployJava.runApplet(attributes, parameters, '1.6');
</script>
</body>
The browser ignores this JVM parameters and launch the applet normally...but the jvm has "512" at the min...
I search a lot, test a lot, without results...
Test environment :
Browsers : Chrome 26.0.1410.43 m , IE 8.0.6..
JRE : 1.6.0_u22 / 1.7
Thanks for help!
I have a Javafx 2.0 Applet working well. This applet requires all security permissions. This applet has a Light Grey background (same color as html background page).
So my problem is: when Java security requests the user to allow the applet, the background of the unload-yet-applet is dark grey. When the user clicks on "Execute", the background becomes Light Grey as wanted. But this is because the applet is loaded.
I want this empty applet area to be Light Grey (as the background of the html page) when this Security warning pops up. Do you guys have an idea how to do this?
I'm using a preloader with a full rectangle filled with Light Grey, but the preloader seems to be launched after Java security all permissions allowed by the user.
Here the result to let you better understand:
HTML file without the stylesheet css (same problem if I remove the css):
<html><head>
<SCRIPT src="./web-files/dtjava.js"></SCRIPT>
<script>
function javafxEmbed() {
dtjava.embed(
{
url : 'Test.jnlp',
placeholder : 'app-placeholder',
width : 600,
height : 400
},
{
javafx : '2.0+'
},
{}
);
}
dtjava.addOnloadCallback(javafxEmbed);
</script>
</head><body>
<h2>Test page for <b>TEST</b></h2>
<center><div id='app-placeholder'></div></center>
</body></html>
And this is the JNLP file:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="Test.jnlp">
<information>
<title>Test</title>
<vendor>Test</vendor>
<homepage href="http://www.test.com/"/>
<description>I don't know where this appears</description>
<description kind="short">And I don't know where this appears too</description>
<icon href="icon.png"/>
<icon kind="splash" href="icon.png"/>
<offline-allowed/>
</information>
<resources os="Windows">
<jfx:javafx-runtime version="2.0+" href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
</resources>
<resources>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="lib/test-Preloader.jar" size="5096" download="progress" />
<jar href="test.jar" size="246346" download="eager" />
</resources>
<security>
<all-permissions/>
</security>
<applet-desc width="600" height="400" main-class="com.javafx.main.NoJavaFXFallback" name="Test" />
<jfx:javafx-desc width="600" height="400" main-class="testApp.IM" name="Test" preloader-class="test.preloader.im_Preloader">
</jfx:javafx-desc>
<update check="background"/>
</jnlp>
See the Loading Screen section of the Applet Deployment guide.
The new plug-in offers better customization of the image which is displayed before the applet is loaded. Animated GIFs are now supported as the target of the image parameter, as described in the Special Attributes section of the old Java Plug-In Guide. Additionally, the following new parameters are now supported: ...
I'm trying to deploy an applet using JNLP. The file structure is thus:
/
dbstats.html
dbstats.jnlp
dbstats.jar
lib/
substance.jar
trident.jar
guava-0.7.jar
Here's my HTML:
<html>
<head>
<title>Dreambearstatistieken</title>
<script src="http://www.java.com/js/deployJava.js"></script>
<script type="text/javascript">
var attributes = {
code:'dreambear.stats.viewer.DBStatsViewer',
width:900, height:600
};
var parameters = {jnlp_href: "dbstats.jnlp"};
var version = "1.6";
</script>
</head>
<body>
<script type="text/javascript">
deployJava.runApplet(attributes, parameters, version);
</script>
</body>
</html>
And the JNLP file:
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="" href="">
<information>
<title>Dreambearstatistieken</title>
<vendor>Weber</vendor>
</information>
<resources>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se" />
<jar href="lib/trident.jar" />
<jar href="lib/substance.jar" />
<jar href="lib/guava-r07.jar" />
<jar href="dbstats.jar" main="true" />
</resources>
<applet-desc
name="Dreambearstatistieken"
main-class="dreambear.stats.viewer.DBStatsViewer"
width="900"
height="600">
</applet-desc>
<update check="background" />
</jnlp>
As far as I can see, everything should be ok, but it's not. I get a ClassNotFoundException on org.pushingpixels.substance.api.skin.SubstanceNebulaLookAndFeel, which is in substance.jar. What am I doing wrong?
And wider, is there a good tutorial or book about using applets and JNLP in the 2010s?
First your codebase is empty. As far as I remember it should contain the absolute path to your application. Probably I am wrong but start from this. If it helps but you wish to reuse the jnlp file try codebase="." (although I am not sure it is legal.)
Next, try to download one of the jars under lib directory using browser. It is needed to be sure that this directory is accessible.
Good luck!
You have to put the jlnp's name on href="" as well. Do it like this:
<jnlp spec="1.0+" codebase="http://mydomain:5500/myapp" href="dbstats.jnlp">