Applet loading classes in client machine
I want my Applet load a class that is stored in the client machine, but not in the server.
Is this possible?
In which directory i must place the class file?
The applet must be signed?
Thanks in advance, el tano. <aguante boca, che>
One way to load a class from a file on a client's machine would be to read the class file bytecodes into your own ClassLoader and have it convert them to a JVM class. Your applet would have to have FilePermission to read files on the client machine. To keep the plugin from trying to get the class from the server, you would probably have to use reflection.
I don't know how to tell the java plugin to do it.
Similar Messages
-
IE Applet: load: class jreCheck.class not found.
Applets are not working in IE. The console gives the following trace
Java Plug-in 1.6.0_05
Using JRE version 1.6.0_05 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\adf
load: class jreCheck.class not found.
java.lang.ClassNotFoundException: jreCheck.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)
Exception in thread "Thread-13" java.lang.NullPointerException
at sun.plugin.util.AnimationPanel.createTranslucentImage(Unknown Source)
at sun.plugin.util.AnimationPanel.createGradientShapeImage(Unknown Source)
at sun.plugin.util.AnimationPanel.initBackground(Unknown Source)
at sun.plugin.util.AnimationPanel.preloadResources(Unknown Source)
at sun.plugin.util.AnimationPanel.doPaint(Unknown Source)
at sun.plugin.util.AnimationPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
load: class jreCheck.class not found.
java.lang.ClassNotFoundException: jreCheck.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)
I have tried uninstalling, reinstalling, restarting IE etc, tried removed the sun folder from application data, none of which has not helped.
IE version 7.0.5730.11
How can I fix this?
ThanksThis line from your error next could require control for the version in the "java control panel" of the jre(s).
network: Connecting http://www.cmol.nbi.dk/models/epitrans/transcript.class with proxy=HTTP @ <REMOVED>
note the proxy= and look in Network Settings in the *"java control panel"* (not the output panel). -
I have an applet that loads over the internet. It is realtively small but it needs to load class libraries like oracle, com, and javax. The question I have is it possible for the applet to look locally on the pc that is requesting this applet to load theses libraries instead of loading it over the network.
Thanks,
EricYes but you would need to use your own class loader...and sign the applet OR make mods to your java.policy file for the applet to work proplerly. We do just this in an applet we wrote that can either be used online, offline and it runs as an applet and application.
-
Copying client machine files into the Server BY Using APPLET
Hi there,
I created an applet which is DRAG and DROP enabled. In this applet content page i am dropping some file and trying to copy the same files in to the server. But when i am trying to save the files my code is saving the files in clients machine.
I thought we are embedding the applet in a browser and the applet is running in clients machine, so for the applet SERVER is the local machine and if we create any files then they will be created in SERVER machine.
But here the files are going to be saved in clients machine.
I SIGNED THE APPLET TO ACCESS THE CLIENT MACHINE FILES TO DRAG AND DROP INTO MY APPLET. THAT IS NOT A PROBLEM , BUT COPYING THE FILES FROM CLIENT MACHINE TO SERVER HAS BECOME A BIG PROBLEM
please any body can help in this regards?
THANKS IN ADVANCE.
battaI cannot see how you will copy files From the Applet to the Server.
The only method I know to transfer data from a Java-Applet-Client to a Server and back is with the named method "HTTP-Tunneling".
This means your, your applet made a connection e.q with a Java-Servlet wich resides on a Web-Server.
This Servlet than can write to the Server-Filesystem and respond to the Applet.
May be you can reach a Server with PHP, but I have not yet experience with this (I did not found anything about Servlet-Response to the Applet).
Regards Dieter -
Opening a text file in server from an applet running in the client
Friends,
I want to open a text file in the server(The server machine uses tomcat 4.1.12 server)from an applet running in the client machine;
The applet invokes a servlet that opens the text file;this text file is opened in the server machine; but I want it to be opened in the client machine where the applet is running.
Plese help me to get around this.You can open the textfile on the servlet and then send the information to the client (applet) as stirngs. The must then applet convert the stirngs into some object or simply display the information in someway. But then the text file that you are opening must be stored in some relevant tomcat directory e.g. on the server. If you want to open a file on the clients computer, you get into signed applets.
-
How to 'deploy' an Applet when class files are on client machine?
Hi all,
I've searched through these forums and I can't find where my specific question has been asked before, so please accept my apologies for any duplication.
I am trying to develop an applet for use on an intranet. (The specific requirement is that the applet must operate a scanner, and upload the scanned images to the database - we want it to be an applet so that it seamlessly integrates with the rest of the web application from the user's POV).
Therefore the applet needs to run outside of the sandbox, but I don't want to go to all the hassle of getting a certificate from Verisign and signing the applet - that doesn't seem like it should be necessary, since there is no problem getting access to the client PC to install the class files by hand!
I have read on this tutorial page that applets "that are loaded from the local file system (from a directory in the user's CLASSPATH) have none of the restrictions that applets loaded over the network do," so I don't think I am barking up the wrong tree:
http://java.sun.com/docs/books/tutorial/deployment/applet/security.html
That is exactly what I want to do! But whenever I try to run the applet, I get a no class definition found exception. However, if I run the applet as a standalone application (using its static main method) then the JRE has no trouble locating the class file - so I know that my CLASSPATH environment variable is set ok.
Therefore I think the problem must be in my JNLP file. This is what mine looks like at present:
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/JGNS008" href="http://localhost:8080/JGNS008/scanner-applet.jnlp">
<information>
<title>Scanner Applet Prototype</title>
<vendor>Fooware</vendor>
</information>
<resources>
<!-- Application Resources -->
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se" />
<jar href="ScannerApplet.jar" main="false" />
</resources>
<applet-desc
name="Scanner Applet Prototype"
main-class="uk.co.fooware.ScannerApplet"
width="72"
height="20">
</applet-desc>
<update check="background"/>
</jnlp>How do I rewrite this so that it doesn't try to download the class files from the network?
Many thanks,
Richard.richardwild wrote:
..I am trying to develop an applet for use on an intranet. (The specific requirement is that the applet must operate a scanner, and upload the scanned images to the database - we want it to be an applet so that it seamlessly integrates with the rest of the web application from the user's POV).
Therefore the applet needs to run outside of the sandbox, but I don't want to go to all the hassle of getting a certificate from Verisign and signing the applet - that doesn't seem like it should be necessary,.. Code can be digitally signed without a 'verified' certificate from Versign.
..since there is no problem getting access to the client PC to install the class files by hand!
I have read on this tutorial page that applets "that are loaded from the local file system (from a directory in the user's CLASSPATH) have none of the restrictions that applets loaded over the network do," so I don't think I am barking up the wrong tree:
http://java.sun.com/docs/books/tutorial/deployment/applet/security.html
Huh. I had never heard of that, but since I do not have access to my end user's classpath it is not that important to me.
BTW - I am guessing they mean the path indicated by [http://pscode.org/prop/all.html?prop=java.class.path].
And putting classes into JRE folders seems very hackish to me.
That is exactly what I want to do! But whenever I try to run the applet, I get a no class definition found exception. However, if I run the applet as a standalone application (using its static main method) then the JRE has no trouble locating the class file - so I know that my CLASSPATH environment variable is set ok.Huh?
Therefore I think the problem must be in my JNLP file. Huh?!? Why not deploy the applet using a standard applet element? The only way to configure an applet using a JNLP is ..
a) If the applet is intended to be free floating.
b) If the applet is intended to be embedded in a plug-in2 architecture JRE. Why impose that restriction, when it seems unnecessary and unproductive?
Note that the second option is very new, and I would not expect all the things mentioned in the document you linked, to apply equally to JNLP embedded applets. If you want this applet embedded, I suggest you drop the entire JNLP approach and use a standard applet element. -
Hi there
I have recently installed App Server 10.1.2.0 on a new machine.
Copied all my forms to an appropriate directory. Set up formsweb.cfg to allow them to run and have attempted to run them.
Unfortunately I get stuck at the Loading Java Applet screen, and in the status bar at the bottom it says :
load: class oracle.forms.engine.Main not found
I have taken a look at the Java Console, and the 2 things that jump out at me are that it appears to be looking for a forms90 directory, which seems odd since I am using App Server 10.1.2.0.2 and Forms Builder 10.1.2.0.2 meaning it should be looking in a forms directory not forms90 directory shouldnt it ?
And also, it mentions class with no proxy, so on looking around the forums it has been suggested that put the proxy details into jinitiator, which I have done, but this has made no difference either.
Can anyone suggest anything else please ?
Java Console log follows.
Thanks a lot
Scott
Oracle JInitiator: Version 1.3.1.9
Using JRE version 1.3.1.9 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\hilliers
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
q: hide console
s: dump system properties
t: dump thread list
x: clear classloader cache
0-5: set trace level to <n>
Unregistered modality listener
Removed trace listener: sun.plugin.ocx.ActiveXAppletViewer[oracle.forms.engine.Main,0,0,914x613,layout=java.awt.BorderLayout]
Sending events to applet. STOP
Sending events to applet. DESTROY
Sending events to applet. DISPOSE
Sending events to applet. QUIT
Finding information...
Releasing classloader: sun.plugin.ClassLoaderInfo@d9850, refcount=0
Caching classloader: sun.plugin.ClassLoaderInfo@d9850
Current classloader cache size: 1
Done...
Registered modality listener
Referencing classloader: sun.plugin.ClassLoaderInfo@d9850, refcount=1
Added trace listener: sun.plugin.ocx.ActiveXAppletViewer[oracle.forms.engine.Main,0,0,914x613,invalid,layout=java.awt.BorderLayout]
Sending events to applet. LOAD
Sending events to applet. INIT
Sending events to applet. START
Determine if the applet requests to install any HTML page
HTML Installation finished.
Opening http://appserver008/forms90/java/oracle/forms/engine/Main.class
Connecting http://appserver008/forms90/java/oracle/forms/engine/Main.class with no proxy
Opening http://appserver008/forms90/java/oracle/forms/engine/Main.class
Connecting http://appserver008/forms90/java/oracle/forms/engine/Main.class with no proxy
load: class oracle.forms.engine.Main not found.
java.lang.ClassNotFoundException: 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)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at sun.plugin.security.PluginClassLoader.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)You're a star, thanks.
In my haste I had cut too much out of my old formsweb.cfg file and not realised I'd done it.
Thanks Francois. -
Unable to view Applet in client machine.
I have one jsp (Main.jsp) in which i am embedding One.Class file by using the following tag:
<applet codebase = "http://localhost:8080/ExceleRATE/" code="One" height="350" width="650" alt="Applet Not Supported by this Browser" archive="http://localhost:8080/ExceleRATE/dom4j-1.6.1.jar,http://localhost:8080/ExceleRATE/One.jar">
This applet (One.java) reads the XML file and displays the data in tree structure.
I kept the One.class file, and all the jar files in the same folder where jsp is there. All the files are in tomcat/webapps/ExceleRATE (project folder).
This is working fine in the machine where i am running tomcat(for running applets separate setting neet to be made for java.policy file ..that i did in my machine and client machine....), but not working from the different machine, i.e client machine (here my machine will act as server).
I am getting the following error in client machine:
load: class One not found.
java.lang.ClassNotFoundException: One
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.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
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.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown 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: One
Can you please help me where I am doing wrong.
Thank in Advance..Wherever you use http://localhost:8080 in your applet tag, it means:
"Browser, would you please download the applet from the web server running on the same machine as yourself on port 8080".
But you want it to come from the web server from where you downloaded the page. All the details here: [http://java.sun.com/j2se/1.4.2/docs/guide/misc/applet.html]. -
How to retrieve system Information on client machine Using Applets
How to retrieve video card information on client machine using applets and JNI, please suggest me on this
Thanks
GReddy1. Research platform specific OS API to do whatever you want with video cards
2. Write C/C++ code to wrap the functionality in 1 into something looks closer to what you want to see in java
3. Write a class that models the functionality of 2 with native methods.
4. Write the native methods of 3 such that they call the methods of 2.
Note that steps 1 and 2 have NOTHING to do with jni nor java. So you start by looking somewhere else for the answers to that. -
Can applet load own security class, class loader
i tried this own security class extends SecurityManager class but exception thrown as applet cannot initate new security manager class.
i have done throw policy file entry to allow applet to write file in client machine.
i feel this extra burden novice user...
what is alternative way....
plz..An applet should never be allowed to install its own security manager. That is why it is burdensome.
-
Is thr way to applet write file, client machine without entry in policy
hi,
is there any way to allow applet write file in local machine (client ) without entry in policy file... i feel this extra step to clients...
To achieve this what are class i have to implements...No, thank God there isn't.
-
I can successfully view and control a VI remotly. However, the remote VI dinamically loads another VI, this VI loaded dinamically is a VI that allows open others VIs, I want to see the files that contains the server machine, in the client machine, but the front panel of the dinamic VI appears only on the server and not on the client, How can I display the fron panel with the files of the server machine of the dinamically loaded VI on the client computer?
Attachments:
micliente.llb 183 KB
miservidor.llb 186 KB
rdsubvis.llb 214 KBI down loaded your files but could use some instructions on what needs run.
It seems that you are so close yet so far. You need to get the data on the server machine over to the client. I generally do this by doing a call by reference (on the client machine) of a VI that is served by the server. THe VI that executes on the server should pass the data you want to diplay via one of its output terminals. You can simply wire from this terminal (back on the client again) to an indicator of your choosing.
Now theorectically, I do not think that there is anything that prevents use from getting the control refnum of the actual indicator (on the server) of the indicator that has the data, and read its "Value" using a property node. I have never tried this idea but it seems t
hat all of the parts are there. You will need to know the name of the VI that holds the data as well as the indicator's name. You will also have to serve all VI's. This is not a good idea.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
Apparent gap in java applet security on client machine
I know about signing applets, and both the new and original security models for applets. For my purposes, the original security model for applets is just about perfect. My applets do not need access to the client machine hardware, nor do they need to access any machine other than that which provides them to the client (at least at present).
What I have been told is that it is not possible for a server of any kind (DB, servlets, &c.) to authenticate an applet. The claim was made that all the security was designed for client security and that a developer's only option is to trust the client machine.
I can exchange information among my servers over SSL, and secure communications between by servers and applet clients. However, what is there to prevent a bad guy from breaking into a client machine and then capturing and modifying the applet I am relying on to protect the client's sensitive data? Signing the applet tells the user that the applet has not been modified from what I have produced, and so the user should feel confident enough to run it. But what if the applet and related web page is cached, and someone who has, legitimately or not, access to the machine and tries to use the cached copy for inappropriate purposes?
If my servers can not verify that the applet code accessing them is mine, rather than a variant created to mimic my applet, then that certainly creates a risk for my code, but doesn't it also create a security risk for the client? After all, it is the client's sensitive data I am trying to protect, and I can envision a situation in which a bogus applet mascerades as mine and sends that sensitive data to a bad guy's machine; all this while giving the user the illusion that his data is safe.
The gap here is either in my understanding of this technology or a gap in java security, so I'll put the question another way also. Is it possible for a server (e.g. an application server such as Tomcat or Sun's application server) to verify that the applet code used to try to connect with them is in fact the applet code that was signed on and served from the same machine and not malicious code masceraing as my code? If so, how does that work, and how does the programmer do it?
Thanks,
Tedthe jar file reqiured is jmf.jar this jar file will there in
jmf_home/lib
for example in my mechine
C:\Program Files\JMF2.1.1e\lib this jar file contain all the file reqired to run the application
i think you may need some of the dll files also to run see
if reqiured the then it may throw exception
java.lang.UnsatisfiedLinkError then put respective dll file to workiing folder or the system32 folder -
Copying the PKCS#11 wrapper dll to the client machine in a signed applet
Hello,
I'm implementing in a signed Java Applet using the IAIK PKCS#11 Wrapper and the PKCS#11 module of my hardware token to communicate with it.
I have to copy the pkcs11wrapper.dll to the client machine. All things works perfectly under Windows XP but when the client have Windows Vista as OS, it's not possible to copy the needed dll.
Thank You for any help
NizarUse JNLP for this.
-
Error loading class problem with applet (Newbie)
Hi,
I am new to Java applets. I try to display a simple sample. I put this into html file: <APPLET codebase="classes" code="NewApplet.class" width=350 height=200></APPLET>
And it always appears one problem:
Error loading class: NewApplet
java.lang.NoClassDefFoundError
java.lang.ClassNotFoundException: NewApplet
at com/ms/vm/loader/URLClassLoader.loadClass
at com/ms/vm/loader/URLClassLoader.loadClass
at com/ms/applet/AppletPanel.securedClassLoad
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.run
at java/lang/Thread.run
Can anybody help please? Thanks in advance.Now I am able to load the applet on MAC OS X 10.4.11. This is due to network issue.
Now my problem with the applet functionality. My applet will display the map image. Applet contains the navigation arrow keys at the top left of my applet. These keys will be used to navigate through the map.
The problem is while user using the navigation buttons, the image got squash and stretch.
This is happened only on MAC OS X 10.4.11 and Its working fine on PC and MAC OS X 10.5.5.
Please anyone help in this regard. Thanks in advance.
Maybe you are looking for
-
Bug/No full support for GLUT on macbook pro retina
Hi, We have a software that makes use of GLUT, the openGL utility library. This is multiplatform so it conveniently let's our software compile to many platforms. We are now thinking of compiling it for macs but there seems to be some bug in the OSX i
-
I've just taken over support of an Exch 2010 system on 2008r2. It seems like the name of the self signed certificate has been set to the internal node name of the server. When O/L 2007 autoconfigures it enables rpc over https with the external FQDN o
-
Is it possible to submit a concurrent program through self service res
Hi Gurus, I have a requirement in which when a user logs in and concurrent program run which basically generates online payslip for an employee.Is it possible to submit the concurrent program with the required parameters through the employee self ser
-
Slide Title Export from iPhoto to iMovie
iPhoto has a selection to "show titles" in "Settings." How do I get the slide titles to export to iMovie?
-
JCheckBox as a Title for the Panel
I have a group of checkboxes which will get enabled when their parent is checked. I want to put all the child checkboxes in a panel and the panel tile should hold the parent checkbox. So that whenever user checks/unchecks the parent checkbox, the chi