BetaONE will rise again!

BetaONE will rise again! (http:\\b1.hcanet.com\forum/index.php)
-   Coders Corner (http:\\b1.hcanet.com\forum/forumdisplay.php?f=57)
-   -   Cannot connect to MySQL Database from Java Applet (http:\\b1.hcanet.com\forum/showthread.php?t=14674)

*MO* 22nd Nov 04 09:29 AM

Cannot connect to MySQL Database from Java Applet
 
Hi

I've created a java applet that connects to a mysql database. When i run the applet from the JBuilder Applet viewer, it works fine. but once i load the applet into an HTML page, upload it to the server where it has to run, It gives an error the size to big for this page.

-------------------------ERROR I RECIEVE---------------------------------
load: class cms_applet.cms_start.class not found.
java.lang.ClassNotFoundException: cms_applet.cms_start.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: C:\CMS_Applet\cms_applet\cms_start\class.class (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connec t(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInp utStream(Unknown Source)
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more
---------------------------------
This was running the file on my machine, but i get same error when page is loaded on server. My connection passes when i run the page in my jbuilder9 software. But not anywhere else. Why is it doing this and how can i get it to work?

thanx,
MO

war59312 23rd Nov 04 01:41 AM

This is why:

Code:


Caused by: java.io.FileNotFoundException: C:\CMS_Applet\cms_applet\cms_start\class.class (The system cannot find the path specified

You are using the excat path to were your class file is found on your computer. But of course thats not where it is for the server. So you need to use virtual paths such as:

/home/war59312/public_html/

*MO* 23rd Nov 04 07:39 AM

huh?

I understand that you must set the classpath to indicate where the MySQL driver is sitting right.

So where do i specify it on the server?

Crap :(

I hate java :(

war59312 23rd Nov 04 04:36 PM

I have no idea I just know you do. lol

Sure someone knows around here.


All times are GMT +1. The time now is 04:43 AM.

Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.