Pregunta

Este tema ha sido cubierto de una forma u otra, pero ninguno de los otros hilos ha podido ayudar. Mi problema es muy similar a esta publicación, estoy haciendo un gráfico de jung con una funcionalidad agregada, pero ninguna de las soluciones ayudó:

japplet falla en la página html

Tuve una aplicación Java que me convertí en un japplet. El japplet funciona bien en el Visor de applet en Eclipse, pero no funcionará cuando intento abrirlo en una página web (he intentado, IE, Firefox y Chrome). Tengo mi página HTML y la carpeta de archivo en el mismo directorio. Cuando cargue la página HTML, simplemente trae nada.

Aquí está mi código HTML:

<html>
<title>Applet</title>
<head>

</head>
<body>

<applet code="prerna.blueprint.main.BPTester.class" 
        archive="applet1.jar"
        width="800" height="800">
</applet>

</body>
</html>

Cuando intento tener código="BPTESTER.CLASS", le da java.lang.classnotFoundException: BPTTester.class, pero cuando uso Code="prerna.blueprint.main.bptester.class", no me da ningún error, no hay errores que no hay errores. sucede (Prerna / Blueprint / Main / BPTTester.class es la ruta del archivo en mi carpeta SRC). Exporté mi proyecto Java como un archivo JAR RUNNABLE, ¿es correcto? Creé un simple japplet que funcionó bien cuando hice todos los mismos pasos, pero no funcionará para BPTESTER.CLASS.

Si necesito publicar mi código BPTESTER.CLASS, puedo.

No entiendo por qué no puedo ver el japplet en una página web, cualquier ayuda es muy apreciada.

¿Fue útil?

Solución

What ended up working for me was adding every single jar I used in the japplet to the HTML archive tag then had to sign every jar. I then had an issue with accessing my database within the applet1.jar so I just put an absolute path for its location.

Otros consejos

java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read)

The applet needs to be digitally signed (by you) and trusted (by the end user, when prompted) before it can obtain such information. Given this applet is being deployed using a traditional applet element (i.e. not using web start), all jars need to be signed.

You need to sign every jar. You can sign all the jars with the jarsigner utility. Example:

jarsigner.exe "nameofthejar.jar" "alias"

Remove .class from the end. You either use a file path with slashes and .class at the end or you only use periods and no .class at the end.

Try turning on tracing in the java control panel. It will then produce a log file in the following path that may help: %USERPROFILE%\AppData\LocalLow\sun\java\Deployment\log

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top