Hi all

J

--jubs-->

Hi all, I just joined this group... hope I can be of any much help..

I have this problem with applets, when I run it on the appletviewer is
doesn't show any error but when I deploy the html to a server and acess
it from a browser it shows ClassFormatError : Truncated classfile. I
googled for it and some sites say its a bug in java 1.4 & 1.5. I tried
almost everything and Iam exhausted... .Other sites say I should
recompile and then deploy (doesn't work). One thig though my applet has
a lot of threads and inner classes. Does this have to do anything with
it??

Sincerely
jubs
 
C

Chris Uppal

I have this problem with applets, when I run it on the appletviewer is
doesn't show any error but when I deploy the html to a server and acess
it from a browser it shows ClassFormatError : Truncated classfile.

To me this sounds like a problem with the way you transfer the jar/classfiles
to the server. Have you verified that the file(s) on the server are identical
(not just the same length) to the ones on your local system ?

-- chris
 
J

--jubs-->

ya i did that... I got fedup with the problem Now I trying to
imlplement it using JNLP. hope that atleast works.
 
T

Thomas Weidenfeller

--jubs-- said:
I have this problem with applets, when I run it on the appletviewer is
doesn't show any error but when I deploy the html to a server and acess
it from a browser it shows ClassFormatError : Truncated classfile.

You did set your FTP client to binary transfer, didn't you?

/Thomas
 
T

Thomas Fritsch

--jubs-- said:
how do u do that???
If you use FTP from command-line, type "bin" (as opposed to "ascii")
after connecting to the server.
If you use a graphical FTP-client, there should be a toggle ("binary"
vs. "ASCII") somewhere in the GUI.
 
R

Roedy Green

how do u do that???

Every FTP utility does it a different way. Poke around in options for
auto/binary/ASCII. ASCII flips the line endings to match your server
convention e.g. \r\n -> \n for a Unix server. But if you upload a
class file that way or a jpg, it will scramble it.
 
A

Andrew Thompson

--jubs-- said:
I have this problem with applets, when I run it on the appletviewer is
doesn't show any error but when I deploy the html to a server and acess
it from a browser it shows ClassFormatError : Truncated classfile.

Are your classes jar'd?

If so, the class files themselves are not being truncated.

Note that
- Your classes will need to be jar'd for JWS.
- If it works with Jar'd classes for JWS, it should
also work for Jar'd classes as an applet.

[ And JWS'd applets suck. E.G.
Applet <http://www.physci.org/pc/jtest-applet.jnlp>
Application <http://www.physci.org/pc/jtest.jnlp> ]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top