problem runing OOoBeanViewer as an applet in the server

Mangagm
Mangagm used Ask the Experts™
on
I managed to make the OOoBeanViewer class run as an applet from an HTML, it works perfect when I open the file directly but when I access it through the server with something like:

http://localhost/Folder/OOBean.html

the jwt stuff initializes but when I want to make a new OO document it throws the next error:


note: OO == OpenOffice
the folowing lines are the complete stack trace:

java.lang.ClassFormatError: Truncated class file
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.access$100(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at sun.applet.AppletClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.applet.AppletClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.applet.AppletClassLoader.loadCode(Unknown Source)
      at sun.applet.AppletPanel.createApplet(Unknown Source)
      at sun.plugin.AppletViewer.createApplet(Unknown Source)
      at sun.applet.AppletPanel.runLoader(Unknown Source)
      at sun.applet.AppletPanel.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Java Developer
Top Expert 2010
Commented:
look like you haven't uploaded the classes/jars to the server correctly

Author

Commented:
I didnt upload them to the server Im working local, I copied the whole folder i was using as a test to my server folder, then I opened the file directly and it still worked, but when I open the same file from the explorer using http// instead of c:/ .... it throws that error.
Mick BarryJava Developer
Top Expert 2010

Commented:
>  but when I open the same file from the explorer using http// instead of c:/ .... it throws that error.

when you do that it will try and load the classes and jars from the same place, via http
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
I just downloaded all the jars used from the server via http, so they're all there
Mick BarryJava Developer
Top Expert 2010

Commented:
whats your applet tag look like?

Author

Commented:
<applet code="com.sun.star.comp.beans.OOoBeanViewer.class" width="800" height="600"
archive="ridl.jar, unoil.jar, officebean.jar, jurt.jar, juh.jar"
></applet>
Mick BarryJava Developer
Top Expert 2010
Commented:
turn on full logging, load it and post the console output

http://helpdesk.objects.com.au/java/applet-failed-to-load

Author

Commented:
Nivel de rastreo establecido en 5: todos... terminado.
network: Conectando http://localhost:8080/SJ3Kweb/oOEditor/Prueba%20Makefile/jurt.jar con proxy=DIRECT
basic: Carga de http://localhost:8080/SJ3Kweb/oOEditor/Prueba%20Makefile/jurt.jar desde la antememoria
basic: Reading cached JAR file from JRE 1.5 release
basic: Los certificados para http://localhost:8080/SJ3Kweb/oOEditor/Prueba%20Makefile/jurt.jar se leen desde la antememoria JAR
security: Carga de certificados del almacén de certificados de la sesión de despliegue
security: Certificados cargados del almacén de certificados de la sesión de despliegue
security: Cargando certificados del almacén de certificados TrustedPublisher de Internet Explorer
security: Certificados cargados desde el almacén de certificados TrustedPublisher de Internet Explorer
security: Comprobar si el certificado está en el almacén permanente de certificados de despliegue
basic: httpCompression = true
network: Conectando http://localhost:8080/SJ3Kweb/oOEditor/Prueba%20Makefile/unoloader.jar con proxy=DIRECT
network: Conectando http://localhost:8080/SJ3Kweb/lib/msvcr70.dll con proxy=DIRECT
network: Conectando http://localhost:8080/SJ3Kweb/oOEditor/bin/msvcr70.dll con proxy=DIRECT
network: Conectando http://localhost:8080/SJ3Kweb/oOEditor/Prueba%20Makefile/juh.jar con proxy=DIRECT
basic: Carga de http://localhost:8080/SJ3Kweb/oOEditor/Prueba%20Makefile/juh.jar desde la antememoria
basic: Reading cached JAR file from JRE 1.5 release
basic: Los certificados para http://localhost:8080/SJ3Kweb/oOEditor/Prueba%20Makefile/juh.jar se leen desde la antememoria JAR
network: Conectando http://localhost:8080/SJ3Kweb/oOEditor/Prueba%20Makefile/sandbox.jar con proxy=DIRECT
basic: Carga de http://localhost:8080/SJ3Kweb/oOEditor/Prueba%20Makefile/sandbox.jar desde la antememoria
basic: Reading cached JAR file from JRE 1.5 release
basic: Los certificados para http://localhost:8080/SJ3Kweb/oOEditor/Prueba%20Makefile/sandbox.jar se leen desde la antememoria JAR
network: Conectando http://localhost:8080/SJ3Kweb/oOEditor/Prueba%20Makefile/msvcr70.dll con proxy=DIRECT
network: Conectando http://localhost:8080/SJ3Kweb/lib/msvcr71.dll con proxy=DIRECT
network: Conectando http://localhost:8080/SJ3Kweb/oOEditor/bin/msvcr71.dll con proxy=DIRECT
network: Conectando http://localhost:8080/SJ3Kweb/oOEditor/Prueba%20Makefile/msvcr71.dll con proxy=DIRECT
network: Conectando http://localhost:8080/SJ3Kweb/lib/uwinapi.dll con proxy=DIRECT
network: Conectando http://localhost:8080/SJ3Kweb/oOEditor/bin/uwinapi.dll con proxy=DIRECT
network: Conectando http://localhost:8080/SJ3Kweb/oOEditor/Prueba%20Makefile/uwinapi.dll con proxy=DIRECT
network: Conectando http://localhost:8080/SJ3Kweb/lib/jawt.dll con proxy=DIRECT
network: Conectando http://localhost:8080/SJ3Kweb/oOEditor/bin/jawt.dll con proxy=DIRECT
network: Conectando http://localhost:8080/SJ3Kweb/oOEditor/Prueba%20Makefile/jawt.dll con proxy=DIRECT
network: Conectando http://localhost:8080/SJ3Kweb/lib/officebean.dll con proxy=DIRECT
network: Conectando http://localhost:8080/SJ3Kweb/oOEditor/bin/officebean.dll con proxy=DIRECT
network: Conectando http://localhost:8080/SJ3Kweb/oOEditor/Prueba%20Makefile/officebean.dll con proxy=DIRECT
network: Conectando http://localhost:8080/SJ3Kweb/lib/com/sun/star/lib/uno/helper/UnoUrl.class con proxy=DIRECT
Exception in thread "AWT-EventQueue-2" java.lang.ClassFormatError: Truncated class file
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.access$100(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at sun.applet.AppletClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.applet.AppletClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClassInternal(Unknown Source)
      at com.sun.star.comp.beans.LocalOfficeConnection.setUnoUrl(LocalOfficeConnection.java:200)
      at com.sun.star.comp.beans.LocalOfficeConnection.<init>(LocalOfficeConnection.java:168)
      at com.sun.star.comp.beans.OOoBean.getOOoConnection(OOoBean.java:283)
      at com.sun.star.comp.beans.OOoBean.getMultiServiceFactory(OOoBean.java:303)
      at com.sun.star.comp.beans.OOoBean.loadFromURL(OOoBean.java:573)
      at com.sun.star.comp.beans.OOoBeanViewer.createBlankDoc(OOoBeanViewer.java:320)
      at com.sun.star.comp.beans.OOoBeanViewer.access$000(OOoBeanViewer.java:58)
      at com.sun.star.comp.beans.OOoBeanViewer$1.actionPerformed(OOoBeanViewer.java:128)
      at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
      at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
      at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
      at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
      at javax.swing.AbstractButton.doClick(Unknown Source)
      at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
      at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
      at java.awt.Component.processMouseEvent(Unknown Source)
      at javax.swing.JComponent.processMouseEvent(Unknown Source)
      at java.awt.Component.processEvent(Unknown Source)
      at java.awt.Container.processEvent(Unknown Source)
      at java.awt.Component.dispatchEventImpl(Unknown Source)
      at java.awt.Container.dispatchEventImpl(Unknown Source)
      at java.awt.Component.dispatchEvent(Unknown Source)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
      at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
      at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
      at java.awt.Container.dispatchEventImpl(Unknown Source)
      at java.awt.Window.dispatchEventImpl(Unknown Source)
      at java.awt.Component.dispatchEvent(Unknown Source)
      at java.awt.EventQueue.dispatchEvent(Unknown Source)
      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.run(Unknown Source)
Mick BarryJava Developer
Top Expert 2010

Commented:
looks like it can't find UnoUrl.class

Author

Commented:
Ok again only found half the answer, apparently the ClassFormatError is thrown usually when a third party software has done something on the jar, modifying its regular estructure or inserted a weird character, I thought the third party software was just the jarsigner , the UnoUrl.class its in the  juh.jar, I switched this jar for the unsigned and it worked only until I erased both explorer and JVM cache, along with the miniaplications where the jvm was saving the old jar.

This seeme to solve the problem although it doesnt explain why it works when I open the file directly and also I dont think the keytool or the jarsigner is considered third party software , prolly its just the version of them, I think this jars are older. Thx again for the help.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial