473,378 Members | 1,364 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

problem loading applet

112 100+
this is rather frustrating...i have tried numerous different things in a futile attempt to get a japplet packaged in a jar file to load on my site.

everytime i try a new thing i get:

Expand|Select|Wrap|Line Numbers
  1. load: class NetCasino.class not found.
  2. java.lang.ClassNotFoundException: NetCasino.class
  3.     at sun.applet.AppletClassLoader.findClass(Unknown Source)
  4.     at java.lang.ClassLoader.loadClass(Unknown Source)
  5.     at sun.applet.AppletClassLoader.loadClass(Unknown Source)
  6.     at java.lang.ClassLoader.loadClass(Unknown Source)
  7.     at sun.applet.AppletClassLoader.loadCode(Unknown Source)
  8.     at sun.applet.AppletPanel.createApplet(Unknown Source)
  9.     at sun.plugin.AppletViewer.createApplet(Unknown Source)
  10.     at sun.applet.AppletPanel.runLoader(Unknown Source)
  11.     at sun.applet.AppletPanel.run(Unknown Source)
  12.     at java.lang.Thread.run(Unknown Source)
  13. Caused by: java.io.IOException: open HTTP connection failed.
  14.     at sun.applet.AppletClassLoader.getBytes(Unknown Source)
  15.     at sun.applet.AppletClassLoader.access$100(Unknown Source)
  16.     at sun.applet.AppletClassLoader$1.run(Unknown Source)
  17.     at java.security.AccessController.doPrivileged(Native Method)
  18.     ... 10 more
  19.  
could it be wrong with my html?

Expand|Select|Wrap|Line Numbers
  1. <p>
  2. <applet width="955" height="587" code="NetCasino.class"
  3.                                     codebase="http://drsmooth.ipower.com/public_html/"
  4.                                     archive="netCasino.jar"
  5.                                     width="600" height="600">
  6.   You need Java Support to view this page
  7. </applet></p>
  8.  
or perhaps i am compiling it wrong...i use the latest netbeans and basically jus built a basic applet to try with...anyone can visit that and see if theyd liike, but all that is there is an x in a box, and the error i posted above comes when i right click and say open java console...

any help would be appreciated. i have already googled for hours and found no success

thanks,
ken
Jun 22 '08 #1
8 3227
JosAH
11,448 Expert 8TB
Are you sure your archive attribute value can be resolved? There is no
code base specified so how is it supposed to find your .jar file? Either specify
an absolute URL for your archive or specify your code base.

kind regards,

Jos
Jun 22 '08 #2
drsmooth
112 100+
isnt:

codebase="http://drsmooth.ipower.com/public_html/"

that the code base?

that is the path where the jar is, it would be

http://drsmooth.ipower.com/public_html/netCasino.jar
Jun 22 '08 #3
JosAH
11,448 Expert 8TB
isnt:

codebase="http://drsmooth.ipower.com/public_html/"

that the code base?

that is the path where the jar is, it would be

http://drsmooth.ipower.com/public_html/netCasino.jar
My bad: I missed that line completely because of that funny indentation, sorry.
I don't know whether or not that codebase is relative to some web server base
directory. Check it out. If it is, that is not the absolute path to your jar file.

kind regards,

Jos (just guessing now)
Jun 22 '08 #4
drsmooth
112 100+
im afraid the problem might be in
Expand|Select|Wrap|Line Numbers
  1. Caused by: java.io.IOException: open HTTP connection failed.
  2.     at sun.applet.AppletClassLoader.getBytes(Unknown Source)
  3.     at sun.applet.AppletClassLoader.access$100(Unknown Source)
  4.     at sun.applet.AppletClassLoader$1.run(Unknown Source)
  5.     at java.security.AccessController.doPrivileged(Native Method)
  6.     ... 10 more
  7.  
is there some special setup required in the code when you put an applet online?

if you dont mind taking a peek at my code:

Expand|Select|Wrap|Line Numbers
  1. package netcasino;
  2.  
  3. import javax.swing.JApplet;
  4.  
  5. /**
  6.  *
  7.  * @author Ken
  8.  */
  9. public class NetCasino extends JApplet {
  10.  
  11.     /**
  12.      * Initialization method that will be called after the applet is loaded
  13.      * into the browser.
  14.      */
  15.     public void init() 
  16.     {
  17.         Player p = new Player("Ken");
  18.         SlotMachine sm = new SlotMachine(p);
  19.         SlotMachineDisplay d = new SlotMachineDisplay(p,sm);
  20.  
  21.         getContentPane().add(d);
  22.         setVisible(true);
  23.     }
  24. }
the slotmachine display is a jpanel and all this stuff compiled and ran when i used a jframe, but now i want to portal the game to the net.

another update, i was using the wrong path to my jar file, this is my updated html stuff:

Expand|Select|Wrap|Line Numbers
  1. <p>
  2. <applet width="955" height="587" code="NetCasino.class"
  3.                                     codebase="/home/users/web/b2263/ipw.drsmooth/public_html/"
  4.                                     archive="netCasino.jar"
  5.                                     width="600" height="600">
  6.   You need Java Support to view this page
  7. </applet></p>
thanks for your help,
ken
Jun 22 '08 #5
JosAH
11,448 Expert 8TB
another update, i was using the wrong path to my jar file, this is my updated html stuff:

Expand|Select|Wrap|Line Numbers
  1. <p>
  2. <applet width="955" height="587" code="NetCasino.class"
  3.                                     codebase="/home/users/web/b2263/ipw.drsmooth/public_html/"
  4.                                     archive="netCasino.jar"
  5.                                     width="600" height="600">
  6.   You need Java Support to view this page
  7. </applet></p>
Exactly what I thought (see my reply #4): that codebase URL is supposed to be
an absolute path to your jar, not a path relative to some web server base directory.

Can you elaborate on what is going wrong now because a JApplet is a JFrame
because the first class extends the latter. From the code snippet you've shown
us I can't tell you what the problem(s) might be.

kind regards,

Jos
Jun 22 '08 #6
drsmooth
112 100+
the problem now remains the same as the problem i had before, now i have just exausted one solution. the error that i posted with is still the same error i am getting.

i also tested it out in firefox and internet explorer and on multiple computers to the same avail.

on my girlfriends laptop in firefox i got something slightly different:
Expand|Select|Wrap|Line Numbers
  1. load: class NetCasino.class not found.
  2. java.lang.ClassNotFoundException: NetCasino.class
  3.     at sun.applet.AppletClassLoader.findClass(Unknown Source)
  4.     at java.lang.ClassLoader.loadClass(Unknown Source)
  5.     at sun.applet.AppletClassLoader.loadClass(Unknown Source)
  6.     at java.lang.ClassLoader.loadClass(Unknown Source)
  7.     at sun.applet.AppletClassLoader.loadCode(Unknown Source)
  8.     at sun.applet.AppletPanel.createApplet(Unknown Source)
  9.     at sun.plugin.AppletViewer.createApplet(Unknown Source)
  10.     at sun.applet.AppletPanel.runLoader(Unknown Source)
  11.     at sun.applet.AppletPanel.run(Unknown Source)
  12.     at java.lang.Thread.run(Unknown Source)
  13. Exception in thread "Thread-6" java.lang.NullPointerException
  14.     at sun.plugin.util.AnimationPanel.createTranslucentImage(Unknown Source)
  15.     at sun.plugin.util.AnimationPanel.createGradientShapeImage(Unknown Source)
  16.     at sun.plugin.util.AnimationPanel.initBackground(Unknown Source)
  17.     at sun.plugin.util.AnimationPanel.preloadResources(Unknown Source)
  18.     at sun.plugin.util.AnimationPanel.doPaint(Unknown Source)
  19.     at sun.plugin.util.AnimationPanel.run(Unknown Source)
  20.     at java.lang.Thread.run(Unknown Source)
  21.  
i wondered if maybe because all the classes were in a package? would that effect the way it finds them? i tried several alterations to the 'code' and to the 'codebase' tryin to think of how the class name might be affected by its package status but it didnt seem to change anything...

thanks,
ken
Jun 22 '08 #7
Nepomuk
3,112 Expert 2GB
A slightly different thought: I use an FTP-Server that has a directory public_html too - but it's not used in the actual http URL. So, it would be something like
Expand|Select|Wrap|Line Numbers
  1. codebase="http://nepomuk.whateverdomainitis.com" archive="blabla.jar"
instead of
Expand|Select|Wrap|Line Numbers
  1. codebase="http://nepomuk.whateverdomainitis.com/public_html/" archive="blabla.jar"
But that's just a thought, it might be quite different with your server.

Greetings,
Nepomuk
Jun 22 '08 #8
drsmooth
112 100+
i just tried that and still got the same problem.

this is getting rather frustratng lol....i will be calling my web host to see if perhaps they are to blame for this but i doubt that they are...
Jun 23 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Umashankar | last post by:
Dear Gurus, I am using listview control in a asp page to populate some database results.In some machines (which is having only OS and no other softwares installed) this control is not loading....
1
by: Nomad | last post by:
I'm trying to load an XML document into the DOM using the ActiveXObject I've succeeded in doing this on one machine. Which shouldn't becaus I've checked for the ActiveXObject and it doesn't...
1
by: Tom Vukovich | last post by:
I'm having a problem loading an xmldocument from the web. The xml i wish to bring into the application is generated from a request to an ASP page. The following code does not work. ...
2
by: NGM | last post by:
Hello All I have a unmanaged C++ DLL, which has been wrapped up with a manged C++ DLL. When i refer to this managed DLL in Windows form based applications it works out fine. But when i refer to...
5
by: Pete Marsh | last post by:
Wondering if anyone can recomend some sample code for dynamically loading the GD module. I have tried setting the extension dir in php.ini, and loading the GD module from there when apache is...
6
by: Shigun | last post by:
On a website I am working on I am trying to load another page into a div on the the page the user does his work from. What I have works correctly in FireFox, but not in IE. I've rummaged Google for...
2
by: rengaraj | last post by:
hi friends! i have a problem in watching applets in browser. when i write my applet with sun one studio (j2sdk 1.4.0_02), in the tools->advanced java(sun) option "use java2 v1.1.4.0_02 for applet...
0
by: ndedhia1 | last post by:
I am having trouble loading a property file and keep getting this error when running my shell script that loads and runs my jar files, etc: no property file loaded, using defaults......
1
ifedi
by: ifedi | last post by:
Hi guys, Kindly spare a moment to look at this page: http://gottkann.com Most of the page content is designed to be loaded by AJAX (mostly jQuery .post and .get) on clicking the menu links on top...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.