3 Replies Latest reply on Nov 7, 2002 10:26 PM by renjith

    applet error

    jagra


      I'm trying to access jboss 2.4.7 from an applet and I get this error :

      java.lang.ClassFormatError: org/jboss/security/SecurityAssociation (Bad magic number)

      If I try to run the same client standalone all works fine. Can anyone help on that ?

      Thanks in advance
      - Jorge Agra

        • 1. Re: applet error
          renjith


          try to recompile the source code.
          bad magic number error is caused because of bad class file format.

          The magic number is a special number indicating that that file is a class file. its value is CAFEBABE in hex.
          if this value is changed it will give bad magic number error

          Or you can change the java plug in/ jre of browser and test it



          • 2. Re: applet error
            jagra


            About the suggestion of recompiling the source, I've thought about it, but gave up. If the jars I use in applet work well in Jboss server and in a standalone client with same code, they should as well work in applets, right ? I will try it though ... just in case.

            I've also tried several plugins from 1.3.01/02/03 to 1.4.0 with same results.

            Probably this is a plugin problem but knowing that doesn't help.

            When I use the jboss/client/jboss-j2ee.jar ( which works well in a standalone client ) in the applet , the plugin doesn't seem to find the EJBObject class and throws that 'Bad Magic Number' error, but when I use ejb.jar from sun, the class is correctly located ( though I get the same error in class org.jboss.security.SecurityAssociation ).

            It's a big problem. I will probably abandon the use of direct EJB access in favour of Web Services. But that will mean a lot of work and a serious delay in my project :(

            Anyway thanks for the tip.

            • 3. Re: applet error
              renjith



              >but when I use ejb.jar from sun, the class is correctly >located ( though I get the same error in class >org.jboss.security.SecurityAssociation ).

              Try with signed applet.
              In fact i have ported an applet from orion to JBoss it works fine , it is a signed applet. When signing sign all the corresponding jar files also. ( what i mean is all the jar files specified in the archive )

              When i tried to port the applet one of my archive jar files was not signed so i got the some Security error.

              Renjith