Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Invoking Java Applet from SAP Netweaver Eportal using java webdynpro

Hi ,

We are using SAP Netweaver portal version 7.0.WE want to invoke java applet into webdynpro java application on button click.

The Applet should open in a new window when the particular parameter is selected and the button is clicked

The code is given below:

String html = "<HTML> <HEAD></HEAD> <BODY><APPLET code=\"org.faceless.pdf2.viewer2.PDFViewerApplet\" type=\"application/x-java-applet;version=1.4.2_05\" archive=\"bfopdf.jar\" width=800 height=600></APPLET></BODY></HTML>";

IWDCachedWebResource resource = WDWebResource.getWebResource(html.getBytes("UTF-8"), WDWebResourceType.HTML);

resource.setResourceName("HTML_inline.html");

IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.getAbsoluteURL(),"Image");

window.removeWindowFeature(WDWindowFeature.TOOL_BAR);

window.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);

window.removeWindowFeature(WDWindowFeature.STATUS_BAR);

window.open();

But after clicking on button new html window is opening and the applet is not showing properly. The java console showing the error:

java.lang.ClassFormatError: Truncated class file

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClassCond(Unknown Source)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)

at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)

at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)

at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)

at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)

at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception: java.lang.ClassFormatError: Truncated class file

Please suggest how to solve this error.

Regards,

Dhruba

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question