2

こんにちは、APplet を含む Web アプリケーションを作成し、このタグを使用して Html ページでアプレットを開始します

<applet codebase="http://localhost:8084/WebForSpark" code="AppletBroadcaster.ZkusebniApplet" archive="AppletBroadcaster.jar, jave.jar " width="500" height="500"></applet> 

アプレットで外部ライブラリ javae.jar を使用する必要があるため、このファイルを Web プロジェクトの bulid/web フォルダーに手動で追加しました。だから、すべてうまくいきます。私のwebproject Javaコンソールを実行すると、これを書きます

Basic: Plugin2ClassLoader.getPermissions CeilingPolicy allPerms
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/ with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry found [url: http://localhost:8084/WebForSpark/jave.jar, version: null] prevalidated=false/0
cache: Resource http://localhost:8084/WebForSpark/jave.jar has expired.
network: Connecting http://localhost:8084/WebForSpark/jave.jar with proxy=DIRECT
network: ResponseCode for http://localhost:8084/WebForSpark/jave.jar : 304
network: Encoding for http://localhost:8084/WebForSpark/jave.jar : null
network: Disconnect connection to http://localhost:8084/WebForSpark/jave.jar
cache: Reading Signers from 1048 http://localhost:8084/WebForSpark/jave.jar | C:\Users\TTT\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\3\65f57583-24e73fd0.idx
cache: Done readSigners(http://localhost:8084/WebForSpark/jave.jar)
cache:  Read manifest for http://localhost:8084/WebForSpark/jave.jar: read=1001 full=1001
security: Validate the certificate chain using CertPath API
security: The certificate hasnt been expired, no need to check timestamping info
security: Found jurisdiction list file
security: No need to checking trusted extension for this certificate
security: The CRL support is disabled
security: The OCSP support is disabled
security: This OCSP End Entity validation is disabled
security: Checking if certificate is in Deployment denied certificate store
security: Checking if certificate is in Deployment permanent certificate store
security: Checking if certificate is in Deployment session certificate store
security: Checking if certificate is in Internet Explorer TrustedPublisher certificate store
basic: Dialog type is not candidate for embedding

したがって、build/web フォルダー内の javae.jar が作成されたことは明らかです。

しかし、jave.jar からいくつかの操作を実行するためのボタンをアプレットにプッシュすると、javaconsole はこれを書き込みます

network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/ with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Cache entry not found [url: http://localhost:8084/WebForSpark/lib/jave.jar, version: null]
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT
network: Connecting http://localhost:8084/WebForSpark/lib/jave.jar with proxy=DIRECT

javae.jarがすべきことはすべて正しく行われていますが、私の質問は、私のjave.jarが入っているときにlib/jave.jarが何度も呼び出されるのはなぜですか

http://localhost:8084/WebForSpark/

アプレットの起動中に正常にロードされました... lib/jave.jar を呼び出さないために何ができますか? また、なぜ呼び出されるのですか? どうもありがとう

4

1 に答える 1

1

現在のアプレット要素はに要約されます。

<applet
    codebase="http://localhost:8084/WebForSpark"
    code="AppletBroadcaster.ZkusebniApplet"
    archive="AppletBroadcaster.jar, jave.jar"
    width="500"
    height="500">
</applet>

これにより、JREは同じパス(またはパッケージによってはサブディレクトリ)からその中にあるすべてのクラスでJarを検索しますhttp://localhost:8084/WebForSpark(失敗します)。jave.jarは実際には別の場所だと思うので、属性archiveは次のようになります。

<applet
    codebase="http://localhost:8084/WebForSpark"
    code="AppletBroadcaster.ZkusebniApplet"
    archive="AppletBroadcaster.jar, /path/to/jave.jar"
    width="500"
    height="500">
</applet>

どこ/path/to/にあるか、/lib/または他のパス。

于 2012-11-28T01:23:58.857 に答える