Hi all

Discussion in 'Java' started by --jubs-->, Dec 5, 2005.

  1. --jubs-->

    --jubs--> Guest

    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
     
    --jubs-->, Dec 5, 2005
    #1
    1. Advertising

  2. --jubs-->

    Chris Uppal Guest


    > 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
     
    Chris Uppal, Dec 5, 2005
    #2
    1. Advertising

  3. --jubs-->

    --jubs--> Guest

    ya i did that... I got fedup with the problem Now I trying to
    imlplement it using JNLP. hope that atleast works.
     
    --jubs-->, Dec 5, 2005
    #3
  4. Thomas Weidenfeller, Dec 6, 2005
    #4
  5. --jubs-->

    --jubs--> Guest

    how do u do that???
     
    --jubs-->, Dec 6, 2005
    #5
  6. --jubs--> wrote:
    > 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.

    --
    "Thomas:Fritsch$ops:de".replace(':','.').replace('$','@')
     
    Thomas Fritsch, Dec 6, 2005
    #6
  7. --jubs-->

    Roedy Green Guest

    On 6 Dec 2005 06:54:51 -0800, "--jubs-->" <> wrote,
    quoted or indirectly quoted someone who said :

    >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.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
     
    Roedy Green, Dec 6, 2005
    #7
  8. --jubs--> wrote:

    > 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> ]


    --
    Andrew Thompson
    physci, javasaver, 1point1c, lensescapes - athompson.info/andrew
     
    Andrew Thompson, Dec 7, 2005
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrzej Wegrzyn
    Replies:
    2
    Views:
    735
    John Saunders
    Aug 18, 2003
  2. vivek
    Replies:
    2
    Views:
    6,236
    pushp
    Jun 14, 2007
  3. Al Hatch
    Replies:
    3
    Views:
    978
    Johannes Koch
    Jun 5, 2006
  4. Moderator
    Replies:
    0
    Views:
    319
    Moderator
    Aug 7, 2006
  5. PokerMan
    Replies:
    3
    Views:
    336
    Mark Rae
    Apr 9, 2007
Loading...

Share This Page