2 Replies Latest reply on Sep 30, 2008 9:09 PM by hubery he

    Portlets and Applets

    Casey Boyd Novice

      Does anyone have a example of a portlet running an applet inside?

      My applet runs just fine with a static html file on the JBoss server...

      But, when I try to run the exact same applet within a JBoss portlet I get

      java.lang.ClassFormatError: JavaClock (Bad magic number)
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(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)

      I am running JavaServer Faces for my portlet's framework...

      Can someone please help...

      Thanks

      Indy

        • 1. Re: Portlets and Applets
          shiv b Newbie

          What I did was use the HelloWorldJSPPortlet at portletswap.com and modified the JSP pages within the src directory. I added my applet code block to the JSP page and it works well.

          • 2. Re: Portlets and Applets
            hubery he Newbie

             

            "kraptor" wrote:
            What I did was use the HelloWorldJSPPortlet at portletswap.com and modified the JSP pages within the src directory. I added my applet code block to the JSP page and it works well.


            I tried to do this at the same way, but I failed.

            The error is Genereal Exception.

            I think I have to declare what content-type the portlet will be responding in.

            But when I change rResponse.setContentType("text/html")

            to rResponse.setContentType("application/x-java-applet"),still failed.

            Anybody can give me some idea.thanks a lot.