create new tag
, view all tags


I am trying to install TWikiDrawPlugin. I unzipped the file and added it to the list of installed pluggins. When I put a %DRAWING{TestDraw1}% mark on my page and save it, then try to view the page, I get this error:

java.lang.ClassFormatError: CH/ifa/draw/twiki/TWikiDraw (Bad magic number)
   at java.lang.ClassLoader.defineClass0(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:493)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
   at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:143)
   at sun.plugin.security.PluginClassLoader.findClass(PluginClassLoader.java:269)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
   at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:112)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
   at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:468)
   at sun.applet.AppletPanel.createApplet(AppletPanel.java:586)
   at sun.plugin.AppletViewer.createApplet(AppletViewer.java:1316)
   at sun.applet.AppletPanel.runLoader(AppletPanel.java:515)
   at sun.applet.AppletPanel.run(AppletPanel.java:293)
   at sun.plugin.navig.motif.MotifAppletViewer.maf_run(MotifAppletViewer.java:131)
   at sun.plugin.navig.motif.MotifAppletViewer.run(MotifAppletViewer.java:127)
   at java.lang.Thread.run(Thread.java:484)

Now if this is the kind of magic number I'm thinking about (a number near the beginning of a file to make sure the file is the kind of file an application is expecting), then I'm wondering if there is a problem with me being on Linux, or with the version of "unzip" I'm using, idunno.

I tried doing the install twice, the second time with a copy of twikidraw I just downloaded. I I also tried it in a different twikiweb and on a different page.

  • TWiki version: 01 Dec 2001
  • Perl version: 5.6.1
  • Web server & version: Apache 1.3.27
  • Server OS: Red Hat Linux 7.3
  • Web browser & version: Tried Konqueror and Netscape
  • Client OS: Same machine

-- DavidKramer - 07 Jan 2003

Just a note here to say I'm getting the exact same error message on a fresh install of the new Feb 03 release of TWiki. I've tried downloading the plugin archive on both my Mac and on a Win2000 machine and then reinstalled all files - but still get the same error message.

  • TWiki version: 01 Feb 2003
  • Perl version: 5.006001
  • Web server & version: Apache Version 1.3.27 (Unix)
  • Server OS: Linux Kernel Version 2.4.18-10smp
  • Web browser & version: IE 6.028
  • Client OS: Win2000

-- LynnwoodBrown - 09 Feb 2003


It appears that a common cause of this problem is that the standard installation of TWikiDrawPlugin assumes it is installed in Plugins web. If you have the plugin topic (and corresponding pub files) installed in the TWiki web, try installing the revised template file and see if that doesn't clear up the problem.

-- LynnwoodBrown - 03 Feb 2004

It looks like the class file is corrupt. Docs:

Make sure that the twikidraw.jar has the correct size, it could be a CR/LF vs. LF issue. Download the zip file to another platform (e.g. Windows), unzip it, and compare the size to the one you have. It might be a MIME setting problem on Apache, make sure Apache does not deliver .jar files as ASCII files.

-- PeterThoeny - 18 Jan 2003

Followup from DavidKramer

Sorry for the delay, I was on vacation.

I unzipped the file on a Windows machine and got the same thing. I also tried using dos2unix and unix2dos to convert line feeds, and both made things worse, as I would expect. I examined the zip file, and the file is marked as a binary, so unzip shouldn't be doing translation anyway.

Could it be that I need a specific release of Java?

Could you post what size the file should be, and possibly a checksum? ( I use the "sum" command).


-- DavidKramer - 30 Jan 2003

I have the same problem. I've tried to install it locally, and get that error. It's not a client Java version issue, though, because I can use the one installed at twiki.org. In fact, I downloaded the jar file installed on the twiki site directly, and didn't work.

Could it be a problem with htpasswd authentication, or with SSL connections? I guess the browser's Java interpreter could have problems with that. Any idea?

I've just compared the one downloaded directly with wget and the one in the ZIP file, and they aren't equal :-?. But none of them work.

The one in the ZIP file is 191079 bytes, and its MD5 is c08e600c4476cd2bf66298e67e66c8b6. The one downloaded with wget, at http://twiki.org/p/pub/TWiki/TWikiDrawPlugin/twikidraw.jar is 173411 bytes long and its MD5 is 092291b0afb8e8921f0dbbda41d5b3fc. The weirdest thing is that it seems to be sent as text/plain. ?

-- EstebanManchado - 04 Apr 2003

The jar should not be sent as text/plain, this could damage the file (platform dependent CR - CR/LF conversion). Configure the MIME settings in your web server, usually file mime.types. Set it to:

application/java-archive        jar

-- PeterThoeny - 06 Apr 2003

The problem was with paths. I installed the plugin in the TWiki web, because I had no Plugins web. Sorry for the noise.

However, now I have a problem with the save option, but I'll look more into that before asking again.

One more thing: the server that regards the jar file as a text/plain file is twiki.org, not mine :-).

-- EstebanManchado - 07 Apr 2003

I am revisiting this problem because it seems to be preventing me from being able to use TWikiDrawPlugin or PowerEditPlugin. I have tried everything I can think of to deal with possible corruption of the jar file (as discussed above), including upziping the archive directly on my unix server, but still the problem remains. I don't think the problem has to do with paths (as Esteban mentioned above) since at least the PowerEditPlugin is speced to install in the TWiki web. Anyone else have suggestions for locating source of problem?

-- LynnwoodBrown - 17 Apr 2003


I meant that the problem I was having was because of paths. IIRC, there is some hardcoded URL somewhere that says Plugins explicitly in the applet call, hence the need to install TWikiDrawPlugin in the Plugins web rather than in TWiki.

What problem are you experiencing exactly? Still the "Bad magic number" one? Can you compute the MD5 of your jar file?

-- EstebanManchado - 26 Jun 2003

I've finally figured out that my problems were related to ChangeInstallationOfTWikiDrawPlugin. Once I made the required change to the twikidraw.tmpl, the problems cleared up. Although the change is trivial, I've gone ahead and uploaded the revised template file at TWikiDrawPluginDev.

-- LynnwoodBrown - 03 Feb 2004

Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r11 - 2004-02-03 - LynnwoodBrown
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.