Results 1 to 14 of 14
  1. #1
    oli22 is offline Member
    Join Date
    May 2011
    Posts
    7
    Rep Power
    0

    Default help with applet

    I am trying to instal a java news ticker.
    It worked fine when i tried a simple test page with applet in html index and java.class both in root folder.

    The problem is that i want to instal it in a complex cms and having them both in root is impossible, i have no idea how to have the pages get the class like i would get a javascript in a html header???

    Java Code:
    <APPLET code="ticker1.class" width=270 height=20 style=" float:right; margin-top:-2px">
    <PARAM name="FONT" value="ARIAL">
    <PARAM name="SIZE" value="14">
    <PARAM name="STEP" value="1">
    <PARAM name="DELAY" value="100">
    <PARAM name="TEXT" value="news articles latest twitter active">
    </APPLET>
    then there something called a 'CLASS file' that used, which i cannot access
    i get a error
    Java Code:
    oad: class ticker1.class not found.
    java.lang.ClassNotFoundException: ticker1.class
    	at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.SocketException: Unexpected end of file from server
    	at sun.net.[url]www.http.HttpClient.parseHTTPHeader(Unknown[/url] Source)
    	at sun.net.[url]www.http.HttpClient.parseHTTP(Unknown[/url] Source)
    	at sun.net.[url]www.http.HttpClient.parseHTTPHeader(Unknown[/url] Source)
    	at sun.net.[url]www.http.HttpClient.parseHTTP(Unknown[/url] Source)
    	at sun.net.[url]www.protocol.http.HttpURLConnection.getInputStream(Unknown[/url] Source)
    	at java.net.HttpURLConnection.getResponseCode(Unknown Source)
    	at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
    	at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
    	at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	... 7 more
    Exception: java.lang.ClassNotFoundException: ticker1.class
    sun.plugin2.main.client.PluginMain: unrecognized message ID 42
    load: class ticker1.class not found.
    java.lang.ClassNotFoundException: ticker1.class
    	at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.UnknownHostException: [url=http://www.vlogirls.com]test index[/url]
    	at java.net.PlainSocketImpl.connect(Unknown Source)
    	at java.net.SocksSocketImpl.connect(Unknown Source)
    	at java.net.Socket.connect(Unknown Source)
    	at sun.net.NetworkClient.doConnect(Unknown Source)
    	at sun.net.[url]www.http.HttpClient.openServer(Unknown[/url] Source)
    	at sun.net.[url]www.http.HttpClient.openServer(Unknown[/url] Source)
    	at sun.net.www.http.HttpClient.<init>(Unknown Source)
    	at sun.net.[url]www.http.HttpClient.New(Unknown[/url] Source)
    	at sun.net.[url]www.http.HttpClient.New(Unknown[/url] Source)
    	at sun.net.[url]www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown[/url] Source)
    	at sun.net.[url]www.protocol.http.HttpURLConnection.plainConnect(Unknown[/url] Source)
    	at sun.net.[url]www.protocol.http.HttpURLConnection.connect(Unknown[/url] Source)
    	at sun.net.[url]www.protocol.http.HttpURLConnection.getInputStream(Unknown[/url] Source)
    	at java.net.HttpURLConnection.getResponseCode(Unknown Source)
    	at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
    	at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
    	at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	... 7 more
    Exception: java.lang.ClassNotFoundException: ticker1.class
    load: class ticker1.class not found.
    java.lang.ClassNotFoundException: ticker1.class
    	at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.SocketException: Unexpected end of file from server
    	at sun.net.[url]www.http.HttpClient.parseHTTPHeader(Unknown[/url] Source)
    	at sun.net.[url]www.http.HttpClient.parseHTTP(Unknown[/url] Source)
    	at sun.net.[url]www.http.HttpClient.parseHTTPHeader(Unknown[/url] Source)
    	at sun.net.[url]www.http.HttpClient.parseHTTP(Unknown[/url] Source)
    	at sun.net.[url]www.protocol.http.HttpURLConnection.getInputStream(Unknown[/url] Source)
    	at java.net.HttpURLConnection.getResponseCode(Unknown Source)
    	at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
    	at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
    	at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	... 7 more
    Exception: java.lang.ClassNotFoundException: ticker1.class
    load: class ticker1.class not found.
    java.lang.ClassNotFoundException: ticker1.class
    	at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.SocketException: Unexpected end of file from server
    	at sun.net.[url]www.http.HttpClient.parseHTTPHeader(Unknown[/url] Source)
    	at sun.net.[url]www.http.HttpClient.parseHTTP(Unknown[/url] Source)
    	at sun.net.[url]www.http.HttpClient.parseHTTPHeader(Unknown[/url] Source)
    	at sun.net.[url]www.http.HttpClient.parseHTTP(Unknown[/url] Source)
    	at sun.net.[url]www.protocol.http.HttpURLConnection.getInputStream(Unknown[/url] Source)
    	at java.net.HttpURLConnection.getResponseCode(Unknown Source)
    	at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
    	at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
    	at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	... 7 more
    Exception: java.lang.ClassNotFoundException: ticker1.class
    Last edited by DarrylBurke; 05-24-2011 at 09:06 PM. Reason: Changed QUOTE tags to CODE tags

  2. #2
    cultclassic is offline Member
    Join Date
    Mar 2011
    Posts
    64
    Rep Power
    0

    Default

    Specify the location of the class by codebase parameter:
    Java Code:
    <APPLET codebase="/directory/to/the/class" code="ticker1.class" width=270 height=20 style=" float:right; margin-top:-2px">

  3. #3
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,583
    Rep Power
    23

    Default

    Where are the class files for your applet located? Are they in a jar file?
    If in a jar file, you would use the Applet tag's archive= attribute to reference the jar file.

    Another idea, remove the .class from the code= attribute. Some browsers think that code=ticker.class refers to the file class.class in the ticker folder. Ie it assumes that the .class was left off.

  4. #4
    oli22 is offline Member
    Join Date
    May 2011
    Posts
    7
    Rep Power
    0

    Default still not working

    I tried and applet still is not showing but error message is not exactly same as before.
    Added path as suggested and no results
    <APPLET codebase="/searchEngine/templates/default-pink/js/ticker1.class" code="ticker1.class" width=270 height=20 style=" float:right; margin-top:-2px">
    Javascripts on page are exactly in same folder and they all work

    Also tried by removing .class every which way and no results either
    this is Java console message error:
    load: class ticker1 not found.
    java.lang.ClassNotFoundException: ticker1
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed:http://www.mysite.com/searchEngine/t.../ticker1.class
    at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unk nown Source)
    at sun.plugin2.applet.Applet2ClassLoader.access$000(U nknown Source)
    at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknow n Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 7 more
    Exception: java.lang.ClassNotFoundException: ticker1
    load: class ticker1 not found.
    java.lang.ClassNotFoundException: ticker1
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed:http://www.mysite.com/searchEngine/t.../ticker1.class
    at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unk nown Source)
    at sun.plugin2.applet.Applet2ClassLoader.access$000(U nknown Source)
    at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknow n Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 7 more
    Exception: java.lang.ClassNotFoundException: ticker1
    load: class ticker1.class not found.
    java.lang.ClassNotFoundException: ticker1.class
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed:http://www.mysite.com/searchEngine/t...r1/class.class
    at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unk nown Source)
    at sun.plugin2.applet.Applet2ClassLoader.access$000(U nknown Source)
    at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknow n Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 7 more
    Exception: java.lang.ClassNotFoundException: ticker1.class
    load: class ticker1.class not found.
    java.lang.ClassNotFoundException: ticker1.class
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed:http://www.mysite.com/searchEngine/2...r1/class.class
    at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unk nown Source)
    at sun.plugin2.applet.Applet2ClassLoader.access$000(U nknown Source)
    at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknow n Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 7 more
    Exception: java.lang.ClassNotFoundException: ticker1.class

  5. #5
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,583
    Rep Power
    23

    Default

    Where is the ticker.class file located? Is it in the same folder with the HTML file?

    Are you able to load the applet in a browser from a local folder with the html and class file in that folder.
    With a simple applet tag:
    <APPLET code=ticker1 width=270 height=20>

  6. #6
    oli22 is offline Member
    Join Date
    May 2011
    Posts
    7
    Rep Power
    0

    Default

    The ticker.class is in same folder as my javascripts, not as html(there is no simple html, its made with php/js includes).

    I tried a simple test in the beginning with a html index and class file in same folder and it worked fine(is that your question?)
    but this complex cms does not allow it i will try it with the 'codebase=...' pointing to same folder as html(which is a combo of php sub files)
    Last edited by oli22; 05-31-2011 at 11:38 PM.

  7. #7
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,583
    Rep Power
    23

    Default

    What does the html that the browser receives look like?

    I misread the title for this thread. I thought you were having problems with an applet.
    It looks more like a server file configuration problem.

  8. #8
    oli22 is offline Member
    Join Date
    May 2011
    Posts
    7
    Rep Power
    0

    Default reply

    is that what you see in last copy/paste java error console?
    All this is due to a file config error?

    Thanks for your help by the way

  9. #9
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,583
    Rep Power
    23

    Default

    Sorry, I don't understand your questions.

  10. #10
    oli22 is offline Member
    Join Date
    May 2011
    Posts
    7
    Rep Power
    0

    Default works now

    yes it was a file path thingy, i finally got it right, i used the codebase param you showed me, but it was another file path then i thought.

    Thanks much cool guy on the beach picture and other guy.

  11. #11
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,583
    Rep Power
    23

    Default

    Can you post your <APPLET tag so others can see what you had to do?

  12. #12
    oli22 is offline Member
    Join Date
    May 2011
    Posts
    7
    Rep Power
    0

    Default

    The problem was resolved when i finally placed the ticker1.class that was to be called by the <applet> in the same folder as the associated php section that formed that page section where i have applet, not at root level index where all php sections gather to form index.

  13. #13
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,583
    Rep Power
    23

    Default

    Thanks for that.
    The problem also was with the server configuration.

  14. #14
    oli22 is offline Member
    Join Date
    May 2011
    Posts
    7
    Rep Power
    0

    Default

    Important to mention that if the applet is in right folder it did not work without the codebase="#" added to it

    <APPLET codebase="http://www.mySite.com/searchEngine/templates/default" code="ticker1.class" width=270 height=30 style=" floatleft; margin-bottom:5px">

Similar Threads

  1. Java Applet to Applet communication
    By jsman in forum Java Applets
    Replies: 3
    Last Post: 04-05-2011, 02:23 PM
  2. applet class inside java.applet.* or java.awt.*
    By Manish87 in forum Java Applets
    Replies: 1
    Last Post: 09-27-2010, 02:15 PM
  3. Replies: 2
    Last Post: 09-29-2009, 03:33 PM
  4. Calling another applet on click of button in one applet
    By niteshwar.bhardwaj in forum Java 2D
    Replies: 1
    Last Post: 02-19-2009, 12:54 PM
  5. Replies: 4
    Last Post: 06-08-2007, 06:15 AM

Posting Permissions

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