Results 1 to 12 of 12
  1. #1
    marksu988 is offline Member
    Join Date
    Jul 2012
    Posts
    10
    Rep Power
    0

    Default Load applet from REMOTE directory

    Hi all, first i'm sorry for my bad english then i've a simple problem.

    My applet works perfectly in local with this code (html file and hofstra directory are in the same folder):

    Java Code:
    <applet
    height="350" width="600" 
    code="hofstra\matsrc\Graf.class"> 
    <p>WARNING! Enable Java<p> 
    </applet>
    I want the applet to work on any html editor online, then i suppose that i need remote acces at my hofstra directory.
    I've uploaded it on google docs here https://docs.google.com/folder/d/0B4...JyM1Z4YUU/edit

    and my code now:

    Java Code:
    <applet
    codebase="https://docs.google.com/folder/d/0B42fMMkZAkITNWtXb1JyM1Z4YUU/edit"
    height="350" width="600" 
    code="hofstra\matsrc\Graf.class"> 
    <p>WARNING! Enable Java<p> 
    </applet>
    It dosnt work :( wrong upload directory? or what?
    Last edited by DarrylBurke; 08-02-2012 at 04:48 PM. Reason: Solved

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default Re: Load applet from REMOTE directory

    For the code= attribute, use a dot (.) to separate the parts of the package name, not the slash (/)
    The codebase= attribute should point to where the package path starts.

    What package is the class in? What is the path to Where is the class file located?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    marksu988 is offline Member
    Join Date
    Jul 2012
    Posts
    10
    Rep Power
    0

    Default Re: Load applet from REMOTE directory

    Quote Originally Posted by Norm View Post
    For the code= attribute, use a dot (.) to separate the parts of the package name, not the slash (/)
    The codebase= attribute should point to where the package path starts.
    Done, now i've ClassFormatError: Incapatible magic value 1008813135 in class file..[] ?!? never seen this before

    Quote Originally Posted by Norm View Post
    What package is the class in? What is the path to Where is the class file located?
    Uhm, I'm not the author of this applet so i've only .class files (not .java) and they are all in hofstra directory (public shared on google at preview link).
    Then i suppose that Graf.class (applet class with main() ) is in hofstra.matscr package.

    Really thanks 4 help.

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default Re: Load applet from REMOTE directory

    ClassFormatError: Incapatible magic value 1008813135 in class file
    That means the .class file is invalid. That value says the first 4 bytes of the class file is: "<!DO"

    Does the server allow .class files? Read the .class file directly into the browser and look at the source.
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    marksu988 is offline Member
    Join Date
    Jul 2012
    Posts
    10
    Rep Power
    0

    Default Re: Load applet from REMOTE directory

    Quote Originally Posted by Norm View Post
    That means the .class file is invalid. That value says the first 4 bytes of the class file is: "<!DO"

    Does the server allow .class files? Read the .class file directly into the browser and look at the source.
    I have to make a correction, FormatError appears only with this code (point at archive .zip) .zip obivsly is online always on google docs:

    Java Code:
    <applet
    [B]archive="hofstra.zip"[/B]
    codebase="https://docs.google.com/file/d/0B42fMMkZAkITZ2wyYkc4ZkZnUTA/edit"
    height="350" width="600" 
    code="hofstra.matsrc.Graf.class"> 
    </applet>
    If i use the old code (with no archive) i've again ClassNotFoundException.
    I dony know if it is considerable or not.

    For server uhm i dont know if .class is allowed. I've opened .class file and response is: "Preview not available" "Click here 4 donwload". So i suppose that itz doesnt work :(
    Last edited by marksu988; 07-31-2012 at 04:31 PM.

  6. #6
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default Re: Load applet from REMOTE directory

    Many sites do not allow class files to be used for applets. Check if your site does.
    If you don't understand my response, don't ignore it, ask a question.

  7. #7
    marksu988 is offline Member
    Join Date
    Jul 2012
    Posts
    10
    Rep Power
    0

    Default Re: Load applet from REMOTE directory

    Quote Originally Posted by Norm View Post
    Many sites do not allow class files to be used for applets. Check if your site does.
    Do u know any upload site that allows it?

    Pf i've tryed altervista and skydrive both with archive and not, always "ClassNotFoundException".
    ClassFormatError appears only with source by .zip from google docs.

    I think that i'm not able to load this applet :(

    I'm sorry 4 disturb

  8. #8
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default Re: Load applet from REMOTE directory

    Sorry, I don't know any sites that allow java applet classes.
    If you don't understand my response, don't ignore it, ask a question.

  9. #9
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,236
    Rep Power
    19

    Default Re: Load applet from REMOTE directory

    I have an Applet in a .jar on FileDen.com in a HTML page hosted on Google Sites. Both services are free.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  10. #10
    marksu988 is offline Member
    Join Date
    Jul 2012
    Posts
    10
    Rep Power
    0

    Default Re: Load applet from REMOTE directory

    Quote Originally Posted by DarrylBurke View Post
    I have an Applet in a .jar on FileDen.com in a HTML page hosted on Google Sites. Both services are free.

    db
    Ok, so i hope to create .jar by .class files; unfortunately i've no .java files.
    I will try this.

  11. #11
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default Re: Load applet from REMOTE directory

    You can use the jar command to create a jar file containing class and other files. You do not need the .java files to create a jar file.
    If you don't understand my response, don't ignore it, ask a question.

  12. #12
    marksu988 is offline Member
    Join Date
    Jul 2012
    Posts
    10
    Rep Power
    0

    Default Re: Load applet from REMOTE directory

    Solved thanks a lot you can close :)

Similar Threads

  1. : Accessing remote directory???
    By vaskarbasak in forum AWT / Swing
    Replies: 3
    Last Post: 10-15-2009, 08:19 AM
  2. How to load a directory in JTree with Children(On expansion)
    By aneesahamedaa in forum AWT / Swing
    Replies: 0
    Last Post: 10-13-2008, 01:23 PM
  3. Applet and remote file
    By Preethi in forum Java Applets
    Replies: 0
    Last Post: 06-03-2008, 05:54 AM
  4. load all files in a directory
    By moomoo in forum New To Java
    Replies: 1
    Last Post: 04-21-2008, 10:18 AM
  5. how to load a file in remote machine
    By christina in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 09:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •