Dag Sunde said:
Darren...
Let's clear up this once and for all?
Your scenario is that:
* You have two web-servers
* Server A does NOT have server-side scripting available (B Does)
* On a web-page served from server A, you would like to inform
the user if server B is up and running.
* You tried to solve this by writing an Applet on the page from
server A. This Applet tried to open something on Server B.
If this was successful you would know that Server B was running.
* Your applet was stopped by a security-exception because it tried
to do a cross-domain request.
* I think it was I that lead you down the path to the .policy file.
That was wrong of me, and I just did it to verify that you
development machine didn't have any special setup.
* From this piont on, *forget* about .policy files.
* Create a jar file with a manifest from your original applet
* Use the following procedure to create a self-signed certificate
and sign your applet:
http://www.jensign.com/JavaScience/www/selfsigned/
* redeploy the applet, and things should be working.
* No need for any special security or permissino code.
(Or have I completely missed the point here?)
nope. Nail on head.
Al goes well until i try implemeting itthen i get a class not found
load: class Helloserver.class not found.
java.lang.ClassNotFoundException: Helloserver.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:\applets\Helloserver.jar\Helloserver\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.connect(Unknown Source)
at sun.net.
www.protocol.file.FileURLConnection.getInputStream(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
Exception in thread "Thread-5" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
"C:\applets\Helloserver.jar\Helloserver\class.class "
Something wrong there. the class is called helloserver.class not class.class
and it's located in c:\applets\ not in c:\applets\helloserver.
I tried to open the jar file with winzip and i got "failed to load
main-class manifest attribute from c:\archive\Helloserver.jar"
Am I right in thinking the manifestis something to do with the security of
the signature of the jar?
Also am I right in thinking that once i've created the signiture, I can sign
as many applets as I want with the same signiture?
TIA