craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > Applet Issues Post New Topic   Post A Reply
Bad Magic Number Error printer friendly version
next newest post | next oldest post
Author Messages
djeverson{@}mygolftrac.com
Unregistered
Edit or delete this message Reply w/Quote
Posted Wednesday, December 31, 1969 @ 23:59:59  

Hi,

I just downloaded your DBTable applet and it looks promising for providing our user with true spreadsheet functionality in a web app that we are developing using the Turbine framework (Jakarta.apache.org/turbine).

When I tried dropping a test applet in an HTML page within our application, I get an ?Exception: java.lang.ClassFormatError: com/smartdatasolutions/webapp/applets/QCGrid (Bad magic number).? exception.

We are running on Windows 2000, Tomcat 4.1, JDK 1.4.

Do you know how we can go about resolving this issue?

Thanks,

Dave

From what I got from others on this issue, if it may help:

?This is usually casued when the a class file is corrupted.

Was the class compiled with optimizations for a specific platform or did you
run any obscufation programs on the class file? Those can also (occassionally)
cause issues.

Another possible problem is that your applet may have been compiled with java2
in which case you will need to set up the page to load the java plug-in rather
than using the built-in java vm. Although, this is probably not the issue.?

admin{@}quicktable.org
Unregistered
Edit or delete this message Reply w/Quote
Posted Wednesday, December 31, 1969 @ 23:59:59  

Dave,

The quicktable2swing11.jar is compiled using the jdk 1.2. So that might be the reason why you are getting this error. If you don't want to use java plugin as suggested in the workaround, I can try to create a version for jdk 1.1.

But can you first make sure this problem is not due to corrupted class file. you can try to run it through appletviewer. If you get the error in appletviewer also, then it may be due to corrupted class file.

Ben

djeverson{@}mygolftrac.com
Unregistered
Edit or delete this message Reply w/Quote
Posted Wednesday, December 31, 1969 @ 23:59:59  

I am unfamiliar with the plugin workaround. Where is this documentated at? I may have overlooked something.

Thanks!

admin{@}quicktable.org
Unregistered
Edit or delete this message Reply w/Quote
Posted Wednesday, December 31, 1969 @ 23:59:59  

I understand your frustration. I will help my best to resolve your problem.

1) Exception: java.lang.ClassFormatError: com/smartdatasolutions/webapp/applets/QCGrid (Bad magic number).? exception.

If QCGrid is a applet class, then this is the first class loaded when you access the applet, so if you get this message during loading the first class, then you have a overall problem with your setup. Then this is not a problem with quicktable. But if QCGrid class is not an applet class and if this the class which uses quicktable and is instantiated in the applet class, then quicktable is the problem.

2) quicktable is compiled in jdk 1.2. But the default jdk available in browser is jdk 1.1. You are compiling your classes in jdk 1.4. If you really want to run the applet with the default jdk in browser , then you should compile all your classes in jdk 1.1, rather than jdk 1.4. The idea is, a jdk can use the classes compiled using the jdk version less than or equal to its version. so if you use 1.4 classes in jdk 1.1 it won't work. If you really want to use jdk 1.4, then there is no other option than using a java plugin. Have a look at the url http://java.sun.com/products/plugin/index-1.4.1.html to learn about plugin.

3) Please make sure you have ftped the file to server in binary mode.

If you are using the Quicktable jar file (instead of extracting the classes ) in the applet html, then you have ftped correctly. But if you have extracted the class files, then make sure you have ftped the class files to webserver in binary format. If that is incorrect, then Replace your class binary files on the web server, clean up (important) the cache of your browser, and reload your applet.

4) I've found that this error is caused by the web server giving
either an error message (like 404) or a strange MIME type for the class when
it returns the class. Sometimes the browser returns the class as text rather than binary, If you enter the URL for your applet class into
the browser directly, what does the server respond, and how does the
browser react? (ie: if your web page is http://www.somecompany.com/SomePage.html
and your class is SomeClass.class, then request http://www.somecompany.com/SomeClass.class
and see what you get.) I prefer using a MIME type like "application/octet-stream"
for class files.

Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios