Problem embedding an applet

software development

#1

Hi guys

I am trying to install a java applet in my web page (that I have checked working fine in my local machine), but I am getting all sorts of error messages. Wondering what can be the reason that an applet is working in my local machine, but not in the server.

Any help?
Thanks.

Web’s ultimate debate center - www.SharpDebate.com


#2

I can think if at least a small number of reasons, but if you could post us up a copy of at least the HTML source and a more detailed description of the error you’re getting, might be able to narrow it down to one or two.

It could be something as simple as file permissions. Or even browser or firewall permissions, for that matter.


#3

Well, the problem may be coming as the JDK path is not defined in my server environment. Can you tell me how can I define the JDK path in my server?
Thanks

Web’s ultimate debate center - www.SharpDebate.com


#4

It may be any number of things, but I suspect a missing path to the java interpreter isn’t one of them. But without the source tags or the actual error condition, I can’t even hazard a reasonable guess. In any case, I think you’ll find that other than the java interpreter “/usr/bin/java”, there is no “JDK” on the server unless you install it in your own diskspace; production servers tend to only have the runtime environment (JRE) installed.

You can set any environment variable usting the “SetEnv” option in .htaccess. Lookee here for instructions.


#5

Hi, thanks

Well, I have no knowledge of Java personally (do php primarily), and the applet I am speaking about is working well in my local machine.

Well, this is what I have done, don’t no it was good or bad. From SSH, I have added these lines this morning:
PATH=${JAVA_HOME}\bin
CLASSPATH=${JAVA_HOME}\lib

Before I have added export JAVA_HOME=/usr/local/dh/java thro’ SSH again, and these information I have got by surfing the net.

For the errors, here they are (the java console)
//*******************************************
Java Plug-in 1.5.0_07
Using JRE version 1.5.0_07 Java HotSpot™ Client VM
User home directory = C:\Documents and Settings\Choudhury Familly


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
p: reload proxy configuration
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

load: class http://www.venteonline.com/ImageUploader/ImageLoader.class not found.
java.lang.ClassNotFoundException: http:…www.venteonline.com.ImageUploader.ImageLoader.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.IOException: open HTTP connection failed.
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
//*********************************************

Thanks again.
Best.

Web’s ultimate debate center - www.SharpDebate.com


#6

Hah - wondered what that might be.
I have good news and bad news for you.

The good news is: The applet on the server is working fine on my machine at home. I uploaded ya a South Park cartoon of what I look like. I’ll have a go from the $DAYJOB machine tomorrow just to doublecheck, if ya like.

The bad news is: Your JRE client on you workstation is very unhappy. Try re-installing the JRE from Sun and see if it works at all for ya.


#7

Hi, you mean that this is because the JRE installed in my local machine is not installed properly?

Thanks

Web’s ultimate debate center - www.SharpDebate.com


#8

Well, I have solved some of the problems, regarding setting path in my server … but I am still having some errors, it is telling that class not found, when class is there …

//*************************
Java Plug-in 1.5.0_07
Using JRE version 1.5.0_07 Java HotSpot™ Client VM
User home directory = C:\Documents and Settings\Choudhury Familly


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
p: reload proxy configuration
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

load: class http://www.venteonline.com/ImageUploader/ImageLoader.class not found.
java.lang.ClassNotFoundException: http:…www.venteonline.com.ImageUploader.ImageLoader.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.IOException: open HTTP connection failed.
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
load: class http://www.venteonline.com/ImageUpload/ImageLoader.class not found.
java.lang.ClassNotFoundException: http:…www.venteonline.com.ImageUpload.ImageLoader.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.IOException: open HTTP connection failed.
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
load: class http://www.venteonline.com/ImageUpload/ImageLoader.class not found.
java.lang.ClassNotFoundException: http:…www.venteonline.com.ImageUpload.ImageLoader.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.IOException: open HTTP connection failed.
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
load: class http://www.venteonline.com/ImageUploader/ImageLoader.class not found.
java.lang.ClassNotFoundException: http:…www.venteonline.com.ImageUploader.ImageLoader.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.IOException: open HTTP connection failed.
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
//***************************

Any suggestion?
Thanks.

Web’s ultimate debate center - www.SharpDebate.com


#9

Precisely.
The URL here works fine in Firefox browser for me on both home and office machines.

Not a server-side problem, near as I can see.


#10

Hi there

Well, thanks. I uninstalled my java things and reinstalled again, with the help of somebody. And this is working now. There was indeed some problem with my previous installation.

However, there is a new problem now … :frowning:

//**************************
No ConnectionUnable to get Connection: java.sql.SQLException: null, message from server: “Host ‘86.69.194.251’ is not allowed to connect to this MySQL server”
//**************************

The applet need to take user’s input and store in a database. But here’s the problem. Any tips from that?

Thanks a lot.

Web’s ultimate debate center - www.SharpDebate.com


#11

Hi there!

Just wondering if you’ve had any luck with this issue yet? I’m running into this exact same security issue and it’s probably because DreamHost’s MySQL servers only accept connections from IPs that are explicitly specified in the configuration. If you’re writing an applet for yourself, this is fine - just add the IP to the list of accept connections - but for building an applet that your visitors can download and run, this creates a huge headache.

Does anyone know of any workarounds?

Thanks,