Loading applet from host

Hi, my problem isn't pure programming but it's about applets. I've started blog with all my projects. i thought that puting applet on it will be easy but it's no. I cant upload files to blogs host, so i've done that: allpets are on my host - for example myhost.com/applet1.class . next step is to format blog post, so i use html format and put line
<applet code=http://myhost.com/applet1.class width=100 height=50 viewastext>
</applet>
When i try to lunch it, there is applets frame, but i have information "applet not found". Any idea how can i do that?

Hi Eric
Sorry I am sure that I was not clear.
This has to pull in Pages from different intranet
livelink sites hosted on different places and are
served by livelink servers.I meant showing up the pages of livelink application in one of the frame of my dashboard via URL on my Dashboard(my intranet site), which is sitting on tomcat and the livelink application is sitting on a different host. These livelink pages have applets.
I am calling these livelink pages by an html link, like the one below
Single sign on to Livelink
if I click on the above link in my dashboard the livelink applets wont show up.
but if I do paste the url in the browser address space.
Like this-------->
http://livelinkhost/livelink/livelink.exe?func=ll.login&NextURL=/livelink/livelink.exe?Redirect=1&username=viren&password=viren
then all the livelink applets which are on that page show up.
My Internet Explorer version is 5.5.
I have not tried it on netscape.
I really appreciate the help.
thanks
viren

Similar Messages

  • NoClassDefFoundError  when loading Applets from IIS5.0

    Hi
    I am having trouble loading applets from IIS 5.0. Here is my html code
    <applet code="Appli/Loader.class" width="100%" height="100%">
    </applet>
    All my clases and packages reside in the same directory from where this html is loaded.
    The trouble is that it behaves erratically. At times the Applet works fine and at times, the browser cannot locate some class.
    The funny part is this behaviour is not consistent. Some times the browser is able to load all the classes and the applet function very well.
    Any suggestion/advice/tip will be great help
    Thanks

    Add the codebase parameter and see if it works.
    <applet code="Appli/Loader.class" codebase="DIRECTORY_WHERE_YOUR_CODE_RESIDES" width="100%" height="100%">
    </applet>

  • Problem loading Applets from Jar files on 64 bit machine

    I am developing an applet (extends Applet but uses swing components) using JDK 1.6 (Though these problems still happen in JDK 1.7) and I am unable to get the applet to load on a 64 bit machine in most cases. The web server(s) are running on localhost and I am connecting on the same machine using a local network ip address (such as 192.168.*.*)
    Below are all of my test results. Can someone provide a suggestion for repairing this? The Windows Server machine is a clients computer I access to it via remote desktop but I can't do much with it though I do have administrator rights. The Windows 7 machine is my development platform so I have been able to do extensive testing on it.
    This problem is presenting in the following environments when trying to load an applet from JAR files in a HTML document using the Applet or Object tag.
    Windows Server 2008 (Intel Chipset)
    Tested Browsers:
    Internet Explorer 9 (32 bit) - Shows it is blocked by default then simply shows an x when loaded from a web page, same result when loading from local drive.
    Windows 7 Home Premium (AMD Chipset)
    Tested Browsers:
    Firefox 6.0.1 (32 bit) - Java logo shows with spinner, after a few minutes there is finally an error that a class in the jar was not found
    Internet Explorer 9 (32 bit) - Java logo shows with spinner, after a few minutes there is finally an error that a class in the jar was not found
    Internet Explorer 9 (64 bit) - Java logo shows with spinner and most of the windows desktop manager freezes, keyboard is the only thing that responds so you can alt-tab to another app to regain control of the desktop.
    Chrome (32 bit) - Java logo shows with spinner, after a few minutes there is finally an error that a class in the jar was not found
    The only way I have been able to get a Java applet to run on a 64 bit machine are the following ways.
    Firefox 9 nightly (64 bit) works perfectly! Go Firefox!
    Internet Explorer 9 (32 bit) loading directly from drive (c:\...)
    Chrome (32 bit) loading directly from drive (c:\...)
    Firefox 6.0.1 (32 bit) loading directly from drive (c:\....)
    Can someone please help! I've been fighting with this bug for over a week and I can't find anything that will solve it, I have noticed that in some cases if my jar has very little code in it than it will run on the server, but the minute I start adding things to it the jar won't load anymore.

    jschell wrote:
    rritoch wrote:
    I am developing an applet (extends Applet but uses swing components) using JDK 1.6 (Though these problems still happen in JDK 1.7) and I am unable to get the applet to load on a 64 bit machine in most cases.
    To clarify...
    1. You have tried it on 32 bit machine? Exactly which OS?I tested this on Windows Vista Business which is in 32 bit mode and the applets run without any problems
    >
    2. Your only 64 bit tests have involved 2008/Win7?
    If so then I would suspect something with windows not java. Probably permissions.
    The web server(s) are running on localhost and I am connecting on the same machine using a local network ip address (such as 192.168.*.*)
    Yes, I haven't tried running the jars on other operating systems.
    >
    I don't understand that. If you are running on localhost then you should connect to localhost. If running on an IP then you should connect to that. Perhaps you meant that you have tested using both of those?I'm testing using the lan ip address but I'm connecting from the same machine. I've tried localhost and that didn't work so I tried lan ip since that will likely have a different java security context than localhost. At first I was blaming the IIS server but I downloaded the jar directly and using HTTP fox was able to verify that the jar is being sent with the correct mime-type and that the server can upload the jar file without a problem. This leaves me to believe the problem is with Java.

  • Problem loading applet from tomcat

    I am facing a problem loading the batik applet from tomcat. I have placed all the jar files of batik in ROOT directory in tomcat. Along with the folder containing the batik applet. Still i receive the following exception when trying to load the html page containing batik applet.
    Applet tag in html page is:
    <applet codebase = "." code="batik_applet.BatikApplet.class" name="myApplet" width="1600" height="1200" hspace="0" vspace="0" align="middle" archive="batik-swing.jar,batik-gvt.jar,batik-bridge.jar,xml-apis-ext.jar,batik-css.jar,batik-util.jar,batik-dom.jar,batik-svg-dom.jar,batik-anim.jar,batik-awt-util.jar,batik-codec.jar,batik-ext.jar,batik-extension.jar,batik-gui-util.jar,batik-parser.jar,batik-script.jar,batik-svggen.jar,batik-transcoder.jar,batik-xml.jar,js.jar,pdf-transcoder.jar,xalan-2.6.0.jar,xerces_2_5_0.jar,xml-apis.jar">
    </applet>
    I already have a folder named batik_applet containing BatikApplet.class in the ROOT directory.
    ========Exception===========
    network: Connecting http://localhost:8080/servlet/batik_applet/BatikApplet.class with proxy=DIRECT
    network: Connecting http://localhost:8080/servlet/batik_applet/BatikApplet.class with cookie "JSESSIONID=1A75299B77372108560B4DF8DC65A3A6"
    network: Connecting http://localhost:8080/servlet/batik_applet/BatikApplet/class.class with proxy=DIRECT
    network: Connecting http://localhost:8080/servlet/batik_applet/BatikApplet/class.class with cookie "JSESSIONID=1A75299B77372108560B4DF8DC65A3A6"
    load: class batik_applet.BatikApplet.class not found.
    java.lang.ClassNotFoundException: batik_applet.BatikApplet.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
    basic: Exception: java.lang.ClassNotFoundException: batik_applet.BatikApplet.class
    Any help would be appreciated.

    Assuming that your applet is not in a jar file (don't see a value for archive)
    you have a file callsed ProcessStatus.class in a folder WEB-INF\classes relative to
    the location of the jsp file.
    So if the jsp file is in
    myJSPFileFolder
    the class should be in:
    myJSPFileFolder\WEB-INF\classes
    If you want to see when the jre is trying to load and where it it trying to load it from you
    can inspect a full trace, to turn the full trace on (windows) you can start the java console, to be found here:
    C:\Program Files\Java\j2re1.4...\bin\jpicpl32.exe
    In the advanced tab you can fill in something for runtime parameters fill in this:
    -Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect
    if you cannot start the java console check here:
    C:\Documents and Settings\userName\Application Data\Sun\Java\Deployment\deployment.properties
    I think for linux this is somewhere in youruserdir/java (hidden directory)
    add or change the following line:
    javaplugin.jre.params=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    for 1.5:
    deployment.javapi.jre.1.5.0.args=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    The trace is here:
    C:\Documents and Settings\your user\Application Data\Sun\Java\Deployment\log\plugin...log
    I think for linux this is somewhere in youruserdir/java (hidden directory)
    The trace should show something like :
    Caused by: java.io.FileNotFoundException: http://server/location/filename.class (The system cannot find the path specified)

  • Problem in loading applet from non executable jar file

    hello ,
    I am new to jar concept plz help.. I am trying to call an applet from another applet through frame it is working fine but its download time is much more. now i want to store all my images , sound files and class files of other applets in a jar file and want to access these inner applets from this jar file so that it will make only one http connection with the server for this jar file only and can reduce the download time of applet.
    Can anyone can give me suggestion plz..
    Thanx

    You have to download what you have to download. You
    probably can't easily share images between 2 separate
    Jar files. Unless you can expose them through the
    other applet via a method that can be known once you
    have the reference to the other applet.Thanx but i think i have to elaborate the problem :
    my project structure is just like this ::
    on the top is ::
    Applet A---> from this applet i am callling Applet B & Applet C in frame
    and communication is established between these 3 applets successfully .
    now i have made a single non executable jar file which contains images , sound and class files of these applets .
    so i am referencing images and sound files in applets through this jar.
    but i wanted to load Applet B & C through this jar file only.
    How can i do this ??
    Thanx .. I hope now the problem is clear

  • Error loading applet from TINI

    when i try to load my applet from the TINI board i get an error saying
    Exception: java.lang.NumberFormatException: Tini OS 1.02e. also at the bottom of the window there is a message saying:
    Applet Test5Applet notinited
    i am new to this stuff, anyone any ideas?
    stevie

    did you every fine out how to do this??
    i am now having the same problem and at my wits end on what to do?
    thanks

  • Dynamic load applet from File or MSSQL trigger

    Hi,
    i have an interesting project that i am researching, i would greatly appreciate if someone can point out some tools to use inorder to reach the following scenario with java.
    I seeking to write data to a web applet whenever an insertion is done to a database or a new file is written to one directory on the server.
    i need to display the information in the applet without refreshing any page.
    i am very new to java, but i found that it could be done in a couple of ways....
    1- Opening a channel between the applet and the server that uses HTTP request and response to load and update the applet without refreshing the page.
    2-Programming a servlet on the server that communicates with the server and the client applet, it send the applet data when ever an insertion is done on the server.
    3-Doing an applet that gets data from a cookie text file on the client machine, using an open channel between the server an the client the server writes these data to a certain directory on the client.
    Please advice if any of these relates to the real world, and please provide tips of tools to do that.
    Greatly appreciated,
    Wafic

    OK, lets see how to accomplish that... :-)
    1- Opening a channel between the applet and the server
    that uses HTTP request and response to load and update
    the applet without refreshing the page.The idea of reloading the applet is not effective and leads to extreme performance losses.
    But you can use a URLConnection to send requests and retrieve any data on that channel.
    2-Programming a servlet on the server that
    communicates with the server and the client applet, it
    send the applet data when ever an insertion is done on
    the server.Here is the tricky part.
    To notify the applet you will have to set up some sort of server, as it does not know anything about operations on the web server side.
    So you either set up a socket connection to the server or (better) use remote method invocation (RMI) to let the server call the appropriate method and immediately send the data.
    This could be methods like (abstracted):
    myApplet.getData(String fileData);
    or
    myApplet.notifyMe(); //triggers the HTTP request to                get the data
    This is also not so easy as you will have to start a RMI registry inside the applet.
    3-Doing an applet that gets data from a cookie text
    file on the client machine, using an open channel
    between the server an the client the server writes
    these data to a certain directory on the client.This is the part I do not understand.
    Why are you sending a text file from the client to the server, which in turn should write the same file back in a client directory ?
    Why not using the applet for that ?
    Under any circumstances you will have to circumvent the applets security rectrictions on the client side by either signing it or deploying a policy file depending on the JAVA platform version you will be using.
    I hope this helps any further.
    Oliver

  • ClassNotFound error when loading applet from a NTLM authenticated  site

    Hi,
    I wrote a Java applet and put it into a JAR file and signed the JAR file. It works fine if the user doesn't need to be authenticated. However, when I place the same JAR to a site that uses NTLM (NT challenging) authentication. The applet failed to load and returns ClassNotFound exception. Does anyone know why?
    The following is the complete error message:
    java.io.IOException: Server returned HTTP response code: 401 for URL: http://unibox.MySite.com/fileupload/FileUpload.jar
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:697)
         at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:369)
         at sun.net.www.protocol.http.HttpURLConnection.getHeaderFields(HttpURLConnection.java:1139)
         at sun.plugin.net.protocol.http.HttpURLConnection.checkCookieHeader(HttpURLConnection.java:330)
         at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:367)
         at sun.plugin.net.protocol.http.HttpUtils.followRedirects(HttpUtils.java:39)
         at sun.plugin.cache.CachedJarLoader.download(CachedJarLoader.java:311)
         at sun.plugin.cache.CachedJarLoader.load(CachedJarLoader.java:131)
         at sun.plugin.cache.JarCache.get(JarCache.java:177)
         at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(CachedJarURLConnection.java:71)
         at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(CachedJarURLConnection.java:56)
         at sun.misc.URLClassPath$JarLoader.getJarFile(URLClassPath.java:498)
         at sun.misc.URLClassPath$JarLoader.<init>(URLClassPath.java:459)
         at sun.misc.URLClassPath$2.run(URLClassPath.java:255)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.misc.URLClassPath.getLoader(URLClassPath.java:244)
         at sun.misc.URLClassPath.getLoader(URLClassPath.java:221)
         at sun.misc.URLClassPath.getResource(URLClassPath.java:134)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:190)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
         at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:132)
         at sun.plugin.security.PluginClassLoader.findClass(PluginClassLoader.java:189)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:112)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
         at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:473)
         at sun.applet.AppletPanel.createApplet(AppletPanel.java:548)
         at sun.plugin.AppletViewer.createApplet(AppletViewer.java:1621)
         at sun.applet.AppletPanel.runLoader(AppletPanel.java:477)
         at sun.applet.AppletPanel.run(AppletPanel.java:290)
         at java.lang.Thread.run(Thread.java:536)
    load: class FileUpload.class not found.
    java.lang.ClassNotFoundException: FileUpload.class
         at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:151)
         at sun.plugin.security.PluginClassLoader.findClass(PluginClassLoader.java:189)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:112)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
         at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:478)
         at sun.applet.AppletPanel.createApplet(AppletPanel.java:548)
         at sun.plugin.AppletViewer.createApplet(AppletViewer.java:1621)
         at sun.applet.AppletPanel.runLoader(AppletPanel.java:477)
         at sun.applet.AppletPanel.run(AppletPanel.java:290)
         at java.lang.Thread.run(Thread.java:536)
    Caused by: java.io.IOException: open HTTP connection failed.
         at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:224)
         at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:40)
         at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:141)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:138)
         ... 10 more

    It appears that the latest jvm plugins use java to get the archive files instead of using the browser to download the archive files.
    In addition sun does not support NTLM authentication, because of this the latest jvms are unable to download the jar file containing the applet.
    I have been working on finding a way to replace suns http Handler, but have had no luck with setting the java.protocol.handler.pkgs for the plugin and having it retain the setting.
    I have achieved partial results using the appletviewer with -J-Djava.protocol.handler=com.nogoop
    you might try taking a look at http://www.nogoop.com

  • Can't load applet from a kerberized server

    Hi there,
    I have the following problem:
    There's a java applet served as part of a web application. The User accessing the java applet should be authenticated by the web application. When this is done with basic authentication - the applet works fine.
    However when a kerberos authentication is configured on the webserver(using spnego module) - the applet can't be loaded.
    I log in to Windows XP using my user and pass. Then using IE I am automatically logged into the web application. I open the page on which the applet is embed, but the JRE can't load it(saying a ClassNotFoundException) The server's access log reveal that the jar can't be loaded because of authentication error:
    - - [05/Oct/2011:15:19:54 +0200] "GET /peria/Grid.jar HTTP/1.1" 401 490
    - - [05/Oct/2011:15:19:54 +0200] "GET /peria/Grid.jar HTTP/1.1" 401 490
    - - [05/Oct/2011:15:19:54 +0200] "GET /peria/Grid.jar HTTP/1.1" 401 490
    It seems as if the JRE is having problems authentication itself in front of the server? Could it be that or it is another issue?
    Note that I can access the jar file directly via the browser. But when I open the page that has it embed - the applet could not be loaded due to ClassNotFound
    Would anyone be so kind as to point me in the right direction?

    One more question:
    Do I need to configure the JRE on the Client side in order to open the Applet on the kerberized server?
    Currently the JRE can't authenticate and the applet is not loaded due to Not authenticated (401) error.
    Any advice is greatly appreciated!

  • Loading Images from external website using Applet...

    Hello,
    I want to load an Image from an external website (image hosting site) but I seem to get an error using the following code:
    images.add(ImageIO.read(urlsToGet.pop()));The error is get is something with security...
    Is there any "safe" and usefull way to load an Image from an external website?
    Thanks

    The_Pointer wrote:
    The error is get is something with security...
    Is there any "safe" and usefull way to load an Image from an external website?You need to sign the applet. An applet is normally only allowed to load resources from the host that it came from.
    Kaj

  • Applet unable to load JARs from URL?

    Please let me preface my query with "I have not done applets ever for live business apps, only for uni and that was over a decade ago..." :)
    I've been doing a lot of reading the last couple days and have been trying to modify a currently existing applet which unfortunately currently depends on libraries being installed in the ext dir on the user's PC (!). I am modifying it such that 1. it will now make a web service call and 2. it will need to include all of the good libraries that come with making web service calls. My other goal is to change the way the applet is loaded (applet tag) so that the libraries need not be pre-installed in the user's ext dir.
    My trouble is, I cannot seem to persuade the applet to load the libraries that co-exist with it. I am loading the applet via a simple test harness page presently, where the HTML file resides in one directory (http://localhost/cis/dictation/test1.html) and the JARs in another (http://localhost/cis/common), but all at the same subdir level under the main web root. I know the applet is loading, as I have a test debug statement which prints out on each invocation.
    Note If I load all of the JARs in the dependency hierarchy into the extensions directory, everything works swimmingly.
    I have tried multiple variations on the applet tag, not completely sure of what it should look like. Please note when I load the URLs into the browser for each individual library, e.g. http://localhost/cis/common/axis.jar, the browser prompts me to download the JARs, so I know the browser can "see" them.
    <applet code="webmedx.client.applet.audio.TransferApplet.class"
         codebase="http://localhost/cis/common/"
         name=TransferApplet      
         width=10 height=10
         archive="audio.jar,axis.jar,jaxrpc.jar,jndi.jar,commons-logging.jar,commons-discovery.jar"
         MAYSCRIPT>
         <PARAM NAME="image" VALUE="images/webmedx_icon-32x32.gif">
         <PARAM NAME="boxmessage" VALUE="Loading the Webmedx Audio Player">
         <PARAM NAME="cache_archive" VALUE="../common/audio.jar">
         <PARAM NAME="DebugLevel" value="1">
         <PARAM NAME="userenterprise" VALUE="BHS">
         <PARAM NAME="userfacility" VALUE="BHS">
         <param name="scriptable" value="true">
    </applet>Using path relative to the browser URL (http://localhost/cis/dictation/test1.html):
    <applet
         codebase="../common"
         archive="audio.jar,axis.jar,jaxrpc.jar,jndi.jar,commons-logging.jar,commons-discovery.jar"
         code="webmedx.client.applet.audio.TransferApplet.class"
         name="TransferApplet"
         width="0" height="0"
         MAYSCRIPT>
         <PARAM NAME="image" VALUE="images/webmedx_icon-32x32.gif">
         <PARAM NAME="boxmessage" VALUE="Loading the Webmedx Audio Player">
         <PARAM NAME="cache_archive" VALUE="../common/audio.jar">
         <PARAM NAME="DebugLevel" value="1">
         <PARAM NAME="userenterprise" VALUE="BHS">
         <PARAM NAME="userfacility" VALUE="BHS">
         <param name="scriptable" value="true">
    </applet>Each of these results in the java console reporting a NCDFE for javax/xml/rpc/Service, which it should be able to locate in http://localhost/cis/common/jaxrpc.jar.
    Then on subsequent page reloads, the java console reports NCDFE's for the newly added class WITHIN the applet jar, webmedx/client/applet/util/cdsproxy/WSAudioArchiveLocator (assuming because it requires javax.xml.rpc.Service, and cannot load it).
    Any ideas/help will be very much appreciated :)
    Edited by: alexx_wmx on Jul 13, 2010 4:17 PM

    ejp wrote:
    Those JARs must be installed in the lib/ext directory of the JRE to work correctly. ..Do they? I am surprised to hear that, but have not dealt with them directly. Why?
    Note that I had asked the OP not to split what I feel is one question, into two threads. The other thread is at.. [http://forums.sun.com/thread.jspa?threadID=5444667], which had itself already been spawned from another thread.
    (sigh..) Following this topic is beginning to make my head hurt.

  • Loading an image into an Applet from a JAR file

    Hello everyone, hopefully a simple question for someone to help me with!
    Im trying to load some images into an applet, currently it uses the JApplet.getImage(url) method just before registering with a media tracker, which works but for the sake of efficiency I would prefer the images all to be contained in the jar file as oppossed to being loaded individually from the server.
    Say I have a class in a package eg, 'com.mydomain.myapplet.class.bin' and an images contained in the file structure 'com.mydomain.myapplet.images.img.gif' how do I load it (and waiting for it to be loaded before preceeding?
    I've seen lots of info of the web for this but much of it is very old (pre 2000) and im sure things have changed a little since then.
    Thanks for any help!

    I don't touch applets, so I can't help you there, but here's some Friday Fun: tracking image loading.
    import java.awt.*;
    import java.awt.image.*;
    import java.beans.*;
    import java.io.*;
    import java.net.*;
    import javax.imageio.*;
    import javax.imageio.event.*;
    import javax.imageio.stream.*;
    import javax.swing.*;
    public class ImageLoader extends SwingWorker<BufferedImage, Void> {
        private URL url;
        private JLabel target;
        private IIOReadProgressAdapter listener = new IIOReadProgressAdapter() {
            @Override public void imageProgress(ImageReader source, float percentageDone) {
                setProgress((int)percentageDone);
            @Override public void imageComplete(ImageReader source) {
                setProgress(100);
        public ImageLoader(URL url, JLabel target) {
            this.url = url;
            this.target = target;
        @Override protected BufferedImage doInBackground() throws IOException {
            ImageInputStream input = ImageIO.createImageInputStream(url.openStream());
            try {
                ImageReader reader = ImageIO.getImageReaders(input).next();
                reader.addIIOReadProgressListener(listener);
                reader.setInput(input);
                return reader.read(0);
            } finally {
                input.close();
        @Override protected void done() {
            try {
                target.setIcon(new ImageIcon(get()));
            } catch(Exception e) {
                JOptionPane.showMessageDialog(null, e, "Error", JOptionPane.ERROR_MESSAGE);
        //demo
        public static void main(String[] args) throws IOException {
            final URL url = new URL("http://blogs.sun.com/jag/resource/JagHeadshot.jpg");
            EventQueue.invokeLater(new Runnable(){
                public void run() {
                    launch(url);
        static void launch(URL url) {
            JLabel imageLabel = new JLabel();
            final JProgressBar progress = new JProgressBar();
            progress.setBorderPainted(true);
            progress.setStringPainted(true);
            JScrollPane scroller = new JScrollPane(imageLabel);
            scroller.setPreferredSize(new Dimension(800,600));
            JPanel content = new JPanel(new BorderLayout());
            content.add(scroller, BorderLayout.CENTER);
            content.add(progress, BorderLayout.SOUTH);
            JFrame f = new JFrame("ImageLoader");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setContentPane(content);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
            ImageLoader loader = new ImageLoader(url, imageLabel);
            loader.addPropertyChangeListener( new PropertyChangeListener() {
                 public  void propertyChange(PropertyChangeEvent evt) {
                     if ("progress".equals(evt.getPropertyName())) {
                         progress.setValue((Integer)evt.getNewValue());
                         System.out.println(evt.getNewValue());
                     } else if ("state".equals(evt.getPropertyName())) {
                         if (SwingWorker.StateValue.DONE == evt.getNewValue()) {
                             progress.setIndeterminate(true);
            loader.execute();
    abstract class IIOReadProgressAdapter implements IIOReadProgressListener {
        @Override public void imageComplete(ImageReader source) {}
        @Override public void imageProgress(ImageReader source, float percentageDone) {}
        @Override public void imageStarted(ImageReader source, int imageIndex) {}
        @Override public void readAborted(ImageReader source) {}
        @Override public void sequenceComplete(ImageReader source) {}
        @Override public void sequenceStarted(ImageReader source, int minIndex) {}
        @Override public void thumbnailComplete(ImageReader source) {}
        @Override public void thumbnailProgress(ImageReader source, float percentageDone) {}
        @Override public void thumbnailStarted(ImageReader source, int imageIndex, int thumbnailIndex) {}
    }

  • ClassFormatError when attempting to load an applet from within a JSP

    Greetings everyone.
    I have a problem that i seem unable to solve.
    I've created a web application. I'm using Java 1.4.2_05 and Tomcat. Right now i'm trying to load an applet from a JSP and i'm getting an error that, try as i might, i can't understand why it happens.
    Here is some detailed info:
    The applet's code:
    package smpb.myapp.controllers;
    import java.applet.Applet;
    import java.awt.Graphics;
    public class GUIApplet extends Applet
         public void init()
         public void stop()
         public void paint(Graphics g)
                  g.drawString("Hey hey hey",20,20);
               g.drawString("Hellooo World",20,40);
    The JSP's code:
    <%@ page language="java"
                   import="java.util.*"
                   session="true" %>
    <%
         String name = (String) request.getSession().getAttribute("userName");
    %>
    <html>
         <head>
              <title>Login</title>
         </head>
         <body>
              <h1><p align="center">Application</p></h1>
              <br>
              Welcome <%= name %>! Thank you for logging in!
              <br><br><br>
              <applet align="middle" code="smpb.myapp.controllers.GUIApplet.class" codebase="./" archive="MyApp_applets.jar">
                   Your browser does not support this feature.
              </applet>
              <br><br>
              <a href='<%=request.getContextPath() + "/LogOut"%>'>Log Out</a><br>
         </body>
    </html>-------------------------------------------
    When i reach this JSP the applet fails to load and i get the following error message at the java console:
    Loading applet ...
    Initializing applet ...
    Starting applet ...
    Connecting http://127.0.0.1/MyApp/MyApp_applets.jar with no proxy
    Connecting http://127.0.0.1/MyApp/MyApp_applets.jar with cookie "JSESSIONID=A8EECE5E39458739C760D8907762C507"
    Last modified time and/or expiration value is not available.  Jar file will not be cached.
    Connecting http://127.0.0.1/MyApp/MyApp_applets.jar with no proxy
    Connecting http://127.0.0.1/MyApp/MyApp_applets.jar with cookie "JSESSIONID=A8EECE5E39458739C760D8907762C507"
    Connecting http://127.0.0.1/MyApp/smpb/myapp/controllers/GUIApplet.class with no proxy
    Connecting http://127.0.0.1/MyApp/smpb/myapp/controllers/GUIApplet.class with cookie "JSESSIONID=A8EECE5E39458739C760D8907762C507"
    Last modified time and/or expiration value is not available.  Jar file will not be cached.
    Connecting http://127.0.0.1/MyApp/smpb/myapp/controllers/GUIApplet.class with no proxy
    Connecting http://127.0.0.1/MyApp/smpb/myapp/controllers/GUIApplet.class with cookie "JSESSIONID=A8EECE5E39458739C760D8907762C507"
    java.lang.ClassFormatError: smpb/myapp/controllers/GUIApplet (Bad magic number)
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
         at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:157)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
         at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:123)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
         at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:561)
         at sun.applet.AppletPanel.createApplet(AppletPanel.java:617)
         at sun.plugin.AppletViewer.createApplet(AppletViewer.java:1856)
         at sun.applet.AppletPanel.runLoader(AppletPanel.java:546)
         at sun.applet.AppletPanel.run(AppletPanel.java:298)
         at java.lang.Thread.run(Thread.java:534)
    Exception: java.lang.ClassFormatError: smpb/myapp/controllers/GUIApplet (Bad magic number)-------------------------------------------
    The JSP is in the root directory of the web application's path right along with the jar file. The jar file itself has the following structure:
    Archive:  HelpDesk_applets.jar
      Length     Date   Time    Name
            0  05-17-06 12:17   META-INF/
          106  05-17-06 12:17   META-INF/MANIFEST.MF
            0  05-10-06 17:14   smpb/
            0  05-10-06 17:14   smpb/myapp/
            0  05-12-06 16:50   smpb/myapp/controllers/
          794  05-12-06 17:15   smpb/myapp/controllers/GUIApplet.class
          900                   6 filesNow, i've tried loading the very same jar file that i use in the JSP through a static HTML which is virtually identical to the JSP i presented and everything works just fine. I've checked and rechecked to see if all the permissions to access the jar file were accurate, i checked to see if Tomcat had it's MIME settings correctly configured so that there was no chance that the files were being corrupted during the load (as that is a usual cause for the problem, or so i've gathered) but to no avail. I've searched the web, including these forums, and found similar problems but no conclusive solution. I can't seem to figure out, at all, what could possibly be wrong. Does anyone have any ideas? I've tried to be as thorough as i could from the start, so, any help would be deeply appreciated.

    Hi mshah101,
    This can happen if the applet is compiled using an higher version of java and the browser is pointing to an older version (even if minor version number is higher)

  • Loading data from XML hosted on a site accepted by Apple?

    I'm about to start working on an App that holds the template and code to build the stuff. It gets its level design, variables and other things from an XML hosted on a website/server. The app will also load pictures from the website/server to be displayed in the app. So, what people download is the "shell". Would Apple allow this app into the app store? Considering I've read how they don't allow external code to be loaded into the app, or is this only limited to code inside external swfs?

    I did search before I posted and read only the threads that seemed to cover what I wanted to know. As replies here are rare I decided to read ALL threads I got from my search and actually found one with the answer, sort of, as he doesn't say if he loads variables, which to me is like code , but I hope Apple will be ok with my app loading external stuff through an external xml aswell, like they were for this guy:
    http://forums.adobe.com/message/3868894#3868894
    * I'm loading xml-data and pictures (like icons for other apps) from an external server into the app, to promote our other apps. Works like a charm and apple had no problem with this.

  • Load jar from jar in applet

    hi i made an applet that read xml files.
    i using in jaxp.jar and in parser.jar currently i put them in ext folder in plug in. is there any other way to put them in my jar applet file and to load them from there.

    The xml stuff is one of the optional packages you can install and belongs in the /ext (extension) folder just like you have it. Possibly, this will be integrated in the v1.4 release, but I'm not sure about that. Anyway, my best advice for you is to follow the instructions Sun gives on exactly this situation:
    http://java.sun.com/j2se/1.3/docs/guide/extensions/extensions.html
    Also on this page is a link to Optional Package Versioning that I highly recommend you read, as it details how the v1.3 plug-in will automatically install the xml jars on the client machine for you. It doesn't get any easier than this! :-)
    -Ron

Maybe you are looking for

  • Form based login, iframes and session time out

    Hi all, I'm trying to create a site using form based login. The site contains a page protected page, default.jsp that have a logout button/link (clicking it invalidates the session), and a navigation bar with links linking opening them in iframes ins

  • Write data to table

    hallow i have table yhr_1 and i wont to write data to her how can i do that? just from progran or other option. regards

  • 0001 becomes 1 while downloading to Excel.

    Hi friends, While i download a Internal table to excel, the data 0001 is convreted into 1. Is there any way we can get the exact data to excel or CSV? Lijo Joseph

  • Server 3.2.2 authentication errors log locations

    I have trouble to find log files to where Calendar, Contacts, Profile manager and web server are logging authentication failures (wrong user name or password) for logging attempts made either trough web interface or caldav, carddav? Seems that corres

  • Adding a new DIV file to my website in order to add instafeed.min.js

    Hi all, I am in the midst of a major upgrade/facelift to our website at http://mauiandsonsretail.com I added quite a few new things but only modifying the previous .css, div and html code. I was wondering, how can I add/create a new div to contain my