I tried to launch Java Applet from XHTML, but classnotfoundexception occurs if hoge.class does not exist.Local Eclipse environment boots, but error occurs when deployed to Glassfish.
Below is the index.xhtml that you will call when you boot up.
Both class, jar, and xhmtl are in the WebContent folder.
<div style="margin:0 auto;">
<object type="application/x-java-applet"codebase="."width="200px"height="50px">
<param name="code" value="hoge.class"/>
<param name="codebase" value="."/>
<param name="archive" value="signedHoge.jar"/>
<param name="archive" value="hoge.jar"/>
</object>
Thank you for your cooperation.
編集Edit
·Folder configuration
WebContent
- index.xhtml
- hoge.class*1
- signedhoge.jar
- hoge.jar
11
The hoge.class moved the one created below for this project.
build
- test
-- hoge.class
·The jar file was created using the following command:
keytool-genkey-keyalgrsa-storepass changeit-alias appletkey-keypass changeit-validity365
jar cfM hoge.jar hoge.class
jarsigner-storepass changeit-keypass changeit-signedjar signedHoge.jar hoge.jar appletkey
·Contents of manifest file
Manifest-Version: 1.0
Created-By: 1.8.0_45 (Oracle Corporation)
Permissions:sandbox
Name—hoge.class
SHA-256-Digest: RZ71edQJoTbT9OHsDBLcXXJ+fMthkHIynfD/+mzXfRk=
archive
Specifies only signed jar containing hoge.class.
<param name="archive" value="signedHoge.jar"/>
Manifest
7u51 and later require the Permissions attribute in the MANIFEST.MF file.
[Java 7u51 Related Information (1)]About RIA's new security requirements for Java 7 Update 51
Signing
After 7u51, self-signed is blocked and you must purchase a certificate or add it to the exception site.
Generating a Certificate Signing Request (CSR) for a Public Key Certificate
How can I configure an exception site list?
archive
Specifies only signed jar containing hoge.class.
<param name="archive" value="signedHoge.jar"/>
manifest
7u51 and later require the Permissions attribute in the MANIFEST.MF file.
[Java 7u51 Related Information (1)]About RIA's new security requirements for Java 7 Update 51
Signing
After 7u51, self-signed is blocked and you must purchase a certificate or add it to the exception site.
Generating a Certificate Signing Request (CSR) for a Public Key Certificate
How can I configure an exception site list?
914 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
610 GDB gets version error when attempting to debug with the Presense SDK (IDE)
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.