1

私はこのトピックに関して多くの質問を見てきましたが、私の特定の状況に答えたものはありませんでした。Googleサイトのウェブサイトに埋め込みたいJavaアプレットの作成が完了しました。アプレット全体を単一の.jarファイルにパックし、それを一般的な添付ファイルとしてサイトにアップロードし、CodeWrapperウィジェットを使用して、コードベースとアーカイブに適切な値を挿入することにより、アプレットをページにリンクしました(基本的に、添付ファイルのリンクをダウンロードして、「コードベース」のパスと「アーカイブ」のファイル名の2つに分割します。ただし、次のようになります。

Incompatible magic value 1008813135 in class file *my class file*

実行しようとするとエラーが発生します。この番号はASCII<!DOに対応しているように思われるため、実際にはXMLドキュメントの先頭を表していると多くの人に思わせ、これは404:ファイルが見つかりませんというエラーが表示されます。これはGoogleサイトの構造に関連しているのではないかと思い、パブリックドロップボックスフォルダに.jarファイルをアップロードしてみました。実際、上記と同じ操作(「コードベース」と「アーカイブ」の間でパスとファイル名を分割する)を実行することで、完全に機能します。ですから、問題は本当にGoogleサイトにあると確信しています。今のところ、Dropboxソリューションを利用しますが、実際には信頼したいものではありません。ファイルをサイト内に埋め込むことができれば、はるかに気分が良くなります。誰かがこれに関して何か提案がありますか?

4

1 に答える 1

0

Hosting .jar files on Google Sites results in a caching effect with googlegroups.com. I can't say right now why this is, but you can see evidence of it in the Java console if you set the tracing level to 5.

For some applets I have, this poses no problem. However, I encountered security exceptions with getSoundClip that I couldn't figure out in my applet. It always worked when I hosted it on a site set up by my ISP. I noticed the odd googlegroups.com URLs coming from some kind of cache, appearing in the console. Default console settings don't show caching, if I'm not mistaken.

Uploading the .jar file to code.google.com (and setting codebase, etc.) doesn't have any caching (that I can see) and my getSoundClip calls work with no security exceptions.

In the following extract from the console of an applet that works for me on Google Sites, you can see an example of a URL on sites.google.com and its corresponding cache in bab6424e-a-62cb3a1a-s-sites.googlegroups.com. Note: I replaced the true path in the URLs with X/Y and the jarfile with Z.jar

...
basic: Added progress listener: sun.plugin.util.ProgressMonitorAdapter@bc71bd
basic: Plugin2ClassLoader.addURL parent called for https://sites.google.com/site/X/Y/Z.jar
security: Accessing keys and certificate in Mozilla user profile: null
security: JSS is not configured
security: Blacklist revocation check is enabled
security: Trusted libraries list check is enabled
cache: Adding MemoryCache entry: https://bab6424e-a-62cb3a1a-s-sites.googlegroups.com/site/X/Y/Z.jar?attachauth=ANoY7cpwDuO2zcBBImZ-rJvrPReeiY0EyL874NTY538mtqnsfd-A6p4uVsSKbeO0jcW336bRzkmqoJSiKk3MgG6dxISu6iXodhaXlmyxEaZ2sZ8sSkEkABSMu89vHzugUVfF2m31qp3N5RFe5QSqVMoY2vMjf7HAjLVmObNEmp7J83khcV1jepHpudfPZXhYeXD89Bv6XbBaePhwoueUZT9ZPEwNvepaKwGIr2IsActrdYOtrjiRScAzyp2dr9EwhnZXXIv6KsKv&attredirects=0
network: Cache entry found [url: https://sites.google.com/site/X/Y/Z.jar, version: null] prevalidated=false/0
cache: Adding MemoryCache entry: https://sites.google.com/site/X/Y/Z.jar
...
于 2013-02-19T06:07:13.970 に答える