+ Post New Thread
Results 1 to 14 of 14
Web Development Thread, Java Applet Error Code in Coding and Web Development; Afternoon everyone, Having some trouble with a java applet at our school. We have a clock applet that the students ...
  1. #1

    Join Date
    May 2013
    Posts
    18
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Java Applet Error Code

    Afternoon everyone,

    Having some trouble with a java applet at our school. We have a clock applet that the students must embed into a webpage. We received the applet from the moderators. Within the folder we received was a notepad file containing the relevant code to enter for the applet. The code is as follows;

    <APPLET CODE="clock.class" WIDTH="162" HEIGHT="28">
    <PARAM name="Image" VALUE="clock.jpg">
    <PARAM name="NumDigits" VALUE="14">
    <PARAM name="bgColor" VALUE="white">
    <PARAM name="MilitaryTime" VALUE="false">
    </APPLET>

    When we view the website in IE we get the following error message:

    NullPointerException

    With the error code of;

    java.net.MalformedURLException: no protocol: clock.jpg
    at java.net.URL.<init>(Unknown Source)
    at java.net.URL.<init>(Unknown Source)
    at com.sun.deploy.uitoolkit.impl.awt.AWTDefaultPreloa der$GrayBoxPainterStarter.run(Unknown Source)
    0
    Java Plug-in 10.45.2.18
    Using JRE version 1.7.0_45-b18 Java HotSpot(TM) Client VM
    User home directory = C:\Users\
    ----------------------------------------------------
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    ----------------------------------------------------

    We've tried everything we can think of, but none of us in our department are web design/java script experts. We've tested this applet on several machines and we've only managed to get it to work on one HP machine in our workshop so we don't think it's a problem with the applet we received. We think it's security settings somewhere. It just seems strange that it works on one HP and yet fails one the other HP machines under every account (staff, pupil, tech) which are the exact same model and image as the one machine we've managed to get it working on.

    Does anyone have any ideas?

    Thanks

    Rich

  2. #2

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,498
    Thank Post
    1,456
    Thanked 1,199 Times in 813 Posts
    Rep Power
    712
    Have you tried it in Chrome/Firefox?

  3. #3

    Join Date
    May 2013
    Posts
    18
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Yes, in Firefox.

    We get the same message. However the pupils are designing their websites for IE only.

  4. #4

    Join Date
    Sep 2012
    Location
    Somerset
    Posts
    24
    Thank Post
    2
    Thanked 2 Times in 2 Posts
    Rep Power
    5
    are you able to upload the source files?

  5. #5

    Join Date
    May 2013
    Posts
    18
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Not through here. I can upload them to cloud storage if you have one? Or I'll upload to box.com and give you a link?

  6. #6

    Join Date
    Sep 2012
    Location
    Somerset
    Posts
    24
    Thank Post
    2
    Thanked 2 Times in 2 Posts
    Rep Power
    5
    Box.com + link sounds easiest

  7. #7

    Join Date
    May 2013
    Posts
    18
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    https://app.box.com/s/8bezl45g0az4xq7myu43

    Try this link. You should be able to downlod the 'Candidate A' folder. That is the website root folder containing all you should need.

    Any help is much appreciated.

  8. #8

    Join Date
    Feb 2011
    Location
    Dudley
    Posts
    120
    Thank Post
    18
    Thanked 32 Times in 22 Posts
    Rep Power
    13
    I've downloaded your files and it all runs fine for me here on both Chrome and IE8.

    From your stack trace - java.net.MalformedURLException: no protocol: clock.jpg - it looks like the argument to the URL constructor is only the file name rather than the absolute URL but I have no clue why this is happening for you and not for me, sorry.

    Complete shot in the dark but try removing the space form the 'Candidate A' directory name and see if that makes any difference..

  9. #9
    Cache's Avatar
    Join Date
    Apr 2008
    Location
    Cumbria
    Posts
    1,224
    Thank Post
    455
    Thanked 177 Times in 174 Posts
    Blog Entries
    3
    Rep Power
    65
    What version of Java are you running?

    I know in school I've stuck to Java 6 Update 43, at home when I try to open your pages I get an error that Java Security is blocking the applet and that is using Java 7 Update 45.

    As you've got it working on one machine, does that machine have an older version of Java installed on it?

    (We have a similar applet, our code uses clock.gif however, not that that will make any difference)

    Edit: I can see your using Java 7 Update 45, be very interesting to see what version that workshop machine has on it. You could also try installing either an older version of Java 7 or the last version of Java 6 and see if that helps?
    Last edited by Cache; 10th December 2013 at 07:29 PM.

  10. Thanks to Cache from:

    richrogan (11th December 2013)

  11. #10

    Join Date
    May 2013
    Posts
    18
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks for the replies guys.

    I will check this out today and let you know!

  12. #11

    Join Date
    May 2013
    Posts
    18
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    The workshop PC was running v6, whilst the rest appear to be on v7.

    I dropped my machine back down to v6 and it worked a treat. However, I don't see dropping the machines down to v6 as a solution as surely this will create some compatibility issues with certain software/apps that are requiring v7? I'm of the understanding that v7 has been installed since at least September.


    I could be a mile away from being accurate though as I'm afraid my java knowledge is rather limited...

    I've tried using an older version of 7 and it still errors out, but it works on any version of 6.

    Our applet used to be .gif but the teachers changed it to .jpg for whatever reason.

    Any recommendations on where to go from here?

  13. #12
    Cache's Avatar
    Join Date
    Apr 2008
    Location
    Cumbria
    Posts
    1,224
    Thank Post
    455
    Thanked 177 Times in 174 Posts
    Blog Entries
    3
    Rep Power
    65
    I don't know sorry, all I can come up with is downgrading to Java 6, otherwise I would try contacting the Exam board and saying your using Java 7 and this doesn't work, what do they want you to do.

    It must be something to do with the coding of the applet.

  14. #13

    Join Date
    May 2013
    Posts
    18
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    I agree. I think it's the coding. From what somebody else has told me, the code is calling for Java version 6, which is why v7 is seeing it as untrusted and blocking it.

    We're going to get in touch with the moderators to see if they can send us the applets a couple of days early to test whether they'll work on v7 or whether we'll need to downgrade to v6.

    Thanks to all who've contributed.

  15. #14
    Cache's Avatar
    Join Date
    Apr 2008
    Location
    Cumbria
    Posts
    1,224
    Thank Post
    455
    Thanked 177 Times in 174 Posts
    Blog Entries
    3
    Rep Power
    65
    Assuming we're the same exam board and your talking about the practical exam, the resources for it should be available from 6 January.

SHARE:
+ Post New Thread

Similar Threads

  1. FireFox error code
    By leco in forum Windows
    Replies: 3
    Last Post: 16th June 2009, 09:27 AM
  2. 'Reason' error codes
    By LeonieCol in forum MIS Systems
    Replies: 5
    Last Post: 28th January 2009, 04:19 PM
  3. Scheduled Task Error code 0x35
    By Stuart_C in forum Windows
    Replies: 0
    Last Post: 25th November 2008, 10:27 AM
  4. Windows failed to start: error code 0xc000014c
    By HodgeHi in forum Windows Vista
    Replies: 0
    Last Post: 17th September 2008, 09:54 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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