Classnotfoundexception at Java Applet startup

Asked 2 years ago, Updated 2 years ago, 140 views

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=

java jsf

2022-09-30 20:17

1 Answers

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?


2022-09-30 20:17

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.