Applet can't be loaed

Hi,
I want to invoke an applet from jsp page.
my jsp page is like this:-
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h2>Hello World!</h2>
        <jsp:plugin type="applet" code="EchoApplet.class"
        width="200" height="200">
<jsp:fallback>
      <p> unable to start plugin </p>
   </jsp:fallback>
</jsp:plugin>
    </body>
</html>My applet code is like this:-
public class EchoApplet extends Applet {
public void init() {
setLayout(new GridBagLayout());
// add title          
Label title = new Label("Echo Applet", Label.CENTER);
}When I run the application, it shows "Loading Java Applet failed" in status bar. Please help me.

SandipGaikwad wrote:
no there is no error on server log.
When i run the application it just displays jsp page with status "Applet MyApplet Notinited" but when I move mouse cursor over the applet status becomes "Loading MyApplet failed".it is responsiblity of borwser not server to load the applet class, apparently your server wouldn't throw any error/exception.
usually, it is a good strategy to jar your applet class files and then try loading in web browser. because it makes loading faster and lessen the confliction of assigning the correct path for applet class to codebase attribut of applet tag.
so try this
1) package you applet class files
    package mypack;
    // your applet class 2) put your applet class file in a folder named mypack. if it's already not in.
3) put this folder in bin directory of your jdk. C:\Program Files\Java\jdk1.6.0_02\bin
4) open DOS and write following commond
jar cf myjar.jar mypack/5)put this myjar.jar in the same directory, your jsp file is in.
now use this
     <applet code="mypack.yourapplet.class" archieve="myjar.jar"></applet>cheers

Similar Messages

  • Applet can get arbitrary objects as a param tag?

    I wonder if I can get an ViewObject(which is in Info table ) as a value of value
    attribute in applet tag. I mean an object in the infotable of jsp containing the
    applet can be a value of value attribute in applet tag.
    I have this question, since I should give a viewobject to applet when I push
    submit button in jsp containing the applet.
    Help! please~

    Hi Sam,
    Instead of point 1, can you try poin 2 to see.
    1.
    <jsp:include page="test2.jsp" flush="true">
         <jsp:param name="fname" value="FirstName"/>
         <jsp:param name="lname" value="LastName"/>
         <jsp:param name="age" value="11"/>     
    </jsp:include>
    2.
    <jsp:include page="test2.jsp?fname=FirstName&lname=LastName&age=11" flush="true"/>
    3. test2.jsp
    <%=request.getParameter("fname")%>
    <%=request.getParameter("lname")%>
    <%=request.getParameter("age")%>
    -- Paul

  • Applet can not init camera on Windows XP embedded

    Under XP the Java JMF and the applet can work.
    Under XP_embedded SP2,the jmf-21_1e can work.(the JMStudio camera function is ok).
    But the Java applet running on JMF could not work.
    I also heard the same problem can happen on Windows 2000.
    Does JAVA applet can not work well under Windows XP embedded?

    Hi,
    I encounter the same problem using Windows XP embedded SP2.
    Have you resolve this problem ?

  • How an applet can connect to a data base?

    how an applet can connect to a data base?

    You need to set up a policy, it's a bit convoluted, see http://developer.java.sun.com/developer/onlineTraining/Programming/BasicJava1/dba.html#applet for more.

  • Applet can't be instantiated on IE browser.

    I have created an SWING Applet (JApplet). It works fine inside JDeveloper IDE using the Appletviewer but when I deploy it and I try to launch it through the Internet Explorer browser I get the following message:
    "Applet can't be instantiated".
    I'm working with JDeveloper 3.1.1.2
    Can somebody help me out with this? I will really appreciate it.
    null

    In the java console of IE are you getting any class not found errors?
    Please refer to the following URL (Swing Applet Test ) to check whether your browser supports swing classes or not.
    http://java.sun.com/products/jfc/tsc/articles/getting_started/applet_test.html
    Another way to create and run Swing applets in IE or netscape is to use Java Plug-in.
    null

  • Applet can't be instatiated

    I can not run Applet in Internet Browser. It does not work error mesages is "Applet can't be instatiated".
    But it works in appletviewer.

    If you're using Swing in your Applet (i.e. JPanel...etc), you cannot use the browser's default JVM. You must use the Java Plug-In. In order for the browser to know this, you must put a lot of extra information. I suggest you look up the HTML converter on Sun's page. It allows you to run your applet on various browsers. Good luck.

  • Applet can't read files

    Hello!
    I have developped ticker news applet
    A previous version was working fine. The applet had a thread. I used the pain method to display texte and logos. It took the news a logo from the applets parameters and printing them one by one on the html page.
    Now the problem was that I had to refresh the whole applet to change the news. That's why I developped another version that extract the news and links to images from 2 separated files. One file contains the news texts, the other the logos. Each one is uploads in a vector. The applet is working fine in textpad but not in the browser.
    The error I get in the console is array out of bound. The vector seems to be empty. My diagnotic is that the applet can't read the file. Am I right? Any solutions
    Here's the applet call and its parameters.
    mess.txt contains the news
    newsimage.txt the links to the images. Actually the images are in the home directory.
    <applet code="aTicker.class" archive="aTicker.jar"
              hspace=0 vspace=0 border=0 align="left" width=640 height=38 MAYSCRIPT>
         <param name="newsfile" value="mess.txt">
         <param name="imagefile" value="newsimage.txt">
         <param name="pas" value="650">
         <param name="cSep" value=";">
         <param name="speed" value="4">
         <param name="delay" value="30">
         <param name="xSpace" value="50">
         <param name="prepicdelay" value="1000">
         <param name="picdelay" value="2000">
         <param name="scrollingdelay" value="100">
         <param name="local" value="true">
         <param name="Font2" value="Verdana, 40, 0, 16776960">
         <param name="Font1" value="Serif , 40, 1, 16776960 ">
    </applet>
    I found this link but it didn't help me
    http://java.sun.com/sfaq/#read
    [email protected]

    All that can be said from the info you provide is that an array is being accessed with an invalid index value. Your guess may (or may not) be correct.
    Sprinkle some System.out.println statements through the code and do some diagnostics. The println's will output their data in the Sun Java Console.

  • Signed applet can't read image file..

    Hello
    My English ability is very poor.. sorry
    I make a signed applet
    and I open Internet Exploere
    I connect to my web page
    when I connect to my web page
    my signed applet upload "c:\blahbalh...\image.gif" automatically
    but It's not work
    java.security.AccessControlException: access denied (java.io.FilePermission C:\DOCUME~1\krict\LOCALS~1\Temp\Hnc\BinData\EMB00000cac2143.jpg read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkRead(Unknown Source)
         at java.io.FileInputStream.<init>(Unknown Source)
         at java.io.FileInputStream.<init>(Unknown Source)
         at EchoApplet.onSendData(EchoApplet.java:61)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin.javascript.invoke.JSInvoke.invoke(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)
         at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
    signed applet can't not read file..
    how can I solve my problem?

    Trace please.
    http://forum.java.sun.com/thread.jspa?threadID=656028
    Maybe some relevant code
    Signing applets:
    http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
    second post and reply 18 for the java class file using doprivileged

  • How applet can read continuous data stream

    How applet can read continuous data from server(like database update)

    You can keep opened a socket to the server. You can send any data from/to the applet in that way.

  • Applet can't load on browser

    my applet can't seem to load on safari 5.1.2 or google chrome on my mac osX 10.6.8 although I have tried updating all the softwares.

    Thanks, i'll give it a try...
    Do you also have an answer for the following problem?:
    My applet needs to retrieve several images from different servers. I load the images as ImageIcons. I don't want to add policy entries, because then i'll have to add them on every computer that uses the applet. Instead, what i would like is for the applet to retrieve the image from the server (the server has access to everything). Do you know how this is possible?

  • Applet can't Load a file from outside it's JAR??

    My loading code: (note: I have also tried ...getResourceAsStream("menu.properties");... )
    codeBase = getCodeBase();
    InputStream is = getClass().getResourceAsStream( new URL( codeBase, "menu.properties" ).toString() );
    if( is == null )
      System.err.println( "Couldn't load Menubar property file:: " + new URL( codeBase, "menu.properties" ).toString());
    else this.properties.load( is );
    is is always null. When 'menu.properties' is inside the JAR that contains my applet class files it loads it with the direct method (getResourceAsStream("menu.properties");) and everything is good.... but when it is outside the JAR no dice.
    Anybody see what is wrong or know something I need to know before I can do this?
    Thanks alot,
    seth

    >
    My loading code: (note: I have also tried
    ...getResourceAsStream("menu.properties");.. )
    codeBase = getCodeBase();
    InputStream is = getClass().getResourceAsStream( new
    URL( codeBase, "menu.properties" ).toString() );
    if( is == null )
    System.err.println( "Couldn't load Menubar property
    y file:: " + new URL( codeBase, "menu.properties"
    ).toString());
    else this.properties.load( is );
    is is always null. When 'menu.properties' is
    inside the JAR that contains my applet class files it
    loads it with the direct method
    (getResourceAsStream("menu.properties");) and
    everything is good.... but when it is outside the JAR
    no dice.
    Anybody see what is wrong or know something I need to
    know before I can do this?
    Thanks alot,
    seth
    Solved my own problem:
    docBase = getDocumentBase();
    InputStream is = new URL( docBase, "menu.properties" ).openStream();

  • Applet can not run in browser, but it wroks in appetviewer. Why?

    I wrote a very simple applet, and it works well when I use appletviewer. But when I use browser to open the html file which contains the applet, it always gives no class found error. My browsers are IE5.0 and Netscape4.77. Hwo can I make the applet run in browser?
    Quick response is greatly appreciated.

    see you have to put the proper code base in your html file.check if your browser is java enabled or not.Java plugin comes with IE 5 and it automatically get installed if you won't disagree with that.Check in optin menu of ur browser that java is enabled or not.
    Applet works fine with all browser.
    2nd thing when you r running applet through appletviewer,it runs as an application from your local JVM while running through browser means you are running applet through browser 's JVM.

  • JMF-based applet can not detect audio devices on Vista (?)

    Hi,
    As many people reported, I encountered the same issue - CaptureDeviceManager.getDeviceList does not detect any audio device on IE/Vista.
    Here is my testing environment:
    HP XW4600, RealTek HD Audio onboard sound card,
    Vista SP1 (Business, Home Premium, and Vista64)
    JRE1.5.0_16, JMF2.1.1e
    A recording Applet runs in IE7 (which works fine on XP and its Java application version always works fine on Vista)
    I have tried a number of things without success:
    1)Use different audio formats as the input parameter for getDeviceList
    2)Try CaptureDeviceManager.getDevice(new String("DirectSoundCapture"))
    3)CaptureDeviceInfo info = new CaptureDeviceInfo(com.sun.media.protocol.dsound.DataSource.NAME,new MediaLocator("dsound://"),null);
    4) Vector devices = (Vector) CaptureDeviceManager.getDeviceList(null).clone();
    5)Uncheck UAC(Vista User Access Control)
    6)Set IE settings least restrictive
    7)Try signed or unsigned recording Applet
    8)Pack the recording Applet to a jar and deploy to JRE\lib\ext
    9)Run JMFInit and copy the files in JMF\Lib to System32 folder
    On a few occasions, audio devices can be detected. For examples,
    10)Upgrading an HP XW4200 (XP machine with AC�97 codecs driver) to Vista,
    11)1/5 chance on the machines with both Sun JRE and MS Java SDK installed.
    12)Trying Item # 9. it worked once on one machine, but after rebuilding the machine, the same trick does not play.
    I am wondering if there is a way to let JMF-based applets detect audio devices on Vista or this is an inherent problem with JMF, IE and Vista.
    I would appreciate it very much if you�d kindly offer any help and suggestions.
    -Belfield

    >
    As many people reported, I encountered the same issue - CaptureDeviceManager.getDeviceList does not detect any audio device on IE/Vista.>(..in an applet)
    >
    I would appreciate it very much if you'd kindly offer any help and suggestions. >I suspect the basic problem here, is the installer that defaults to preventing the applet access to record sound (I am guessing that would 'spill over' into web-cam permissions). A quick test of that is to try the same code as an application.
    If the application works, one possible fix is to launch the application using webstart. Webstart will work from a web page, and offers many other advantages over a standard applet.

  • I need some help with my java game using applets, CAN SOMEBODY PLEASE HELP

    Hi,
    I am in the process of creating a RPG program using Java. I am not very experienced with java, however the problem i am currently facing is something i can't seem to figure out. I would like to draw a simple grid where a character (indicated by a filled circle) moves around this grid collecting items (indicated by a red rectangle). When the character moves on top of the grid with the item, i would like it to disappear. Right now i am not worrying about the fact that the item will reappear after the character moves away again, because sometimes, when the character moves over the item, nothing happens/another item disappears. i have been at this for 4 days and still cannot figure out what is goign on. can somebody please help me? it would be most appreciated.
    Thanks
    PS if i needed to send you my code, how do i do it?

    Thank you for replying.
    The thing is, I am taking java as a course, and it is necessary for me to start off this way (this is for my summative evaluation). i agree with you on the fact, however, that i should go in small steps. i have been doing that until this point, and my frustration caused me to jump around randomly for an answer. I also think that it may just be a bug, but i have no clue as to how to fix it, as i need to show my teacher at least a part of what i was doing by sometime next week. Here is my code for anybody willing to go through it:
    // The "Keys3" class.
    import java.applet.*;
    import java.awt.*;
    import java.awt.Event;
    import java.awt.Font;
    import java.awt.Color;
    import java.applet.AudioClip;
    public class Keys3 extends java.applet.Applet
        char currkey;
        int currx, curry, yint, xint;
        int itmval [] = new int [5],
            locval [] = new int [5],
            tempx [] = new int [5], tempy [] = new int [5],
            tot = 0, score = 0;
        boolean check = true;
        AudioClip bgSound, bgSound2;
        AudioClip hit;
        private Image offscreenImage;
        private Graphics offscreen;     //initializing variables for double buffering
        public void init ()  //DONE
            bgSound = getAudioClip (getCodeBase (), "sound2_works.au");
            hit = getAudioClip (getCodeBase (), "ah_works.au");
            if (bgSound != null)
                bgSound.loop ();
            currx = 162;
            curry = 68;
            setBackground (Color.white);
            for (int count = 0 ; count < 5 ; count++)
                itmval [count] = (int) (Math.random () * 5) + 1;
                locval [count] = (int) (Math.random () * 25) + 1;
            requestFocus ();
        public void paint (Graphics g)  //DONE
            resize (350, 270);
            drawgrid (g);
            if (check = true)
                pickitems (g);
                drawitems (g);
            g.setColor (Color.darkGray);
            g.fillOval (currx, curry, 25, 25);
            if (currkey != 0)
                g.setColor (Color.darkGray);
                g.fillOval (currx, curry, 25, 25);
            if (collcheck () != true)
                collision (g);
            else
                drawitems (g);
        } // paint method
        public void update (Graphics g)  //uses the double buffering method to overwrite the original
                                         //screen with another copy to reduce flickering
            if (offscreenImage == null)
                offscreenImage = createImage (this.getSize ().width, this.getSize ().height);
                offscreen = offscreenImage.getGraphics ();
            } //what to do if there is no offscreenImage copy of the original screen
            //draws the backgroudn colour of the offscreen
            offscreen.setColor (getBackground ());
            offscreen.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
            //draws the foreground colour of the offscreen
            offscreen.setColor (getForeground ());
            paint (offscreen);
            //draws the offscreen image onto the main screen
            g.drawImage (offscreenImage, 0, 0, this);
        public boolean keyDown (Event evt, int key)  //DONE
            switch (key)
                case Event.DOWN:
                    curry += 46;
                    if (curry >= 252)
                        curry -= 46;
                        if (hit != null)
                            hit.play ();
                    break;
                case Event.UP:
                    curry -= 46;
                    if (curry <= 0)
                        curry += 46;
                        if (hit != null)
                            hit.play ();
                    break;
                case Event.LEFT:
                    currx -= 66;
                    if (currx <= 0)
                        currx += 66;
                        if (hit != null)
                            hit.play ();
                    break;
                case Event.RIGHT:
                    currx += 66;
                    if (currx >= 360)
                        currx -= 66;
                        if (hit != null)
                            hit.play ();
                    break;
                default:
                    currkey = (char) key;
            repaint ();
            return true;
        public boolean collcheck ()  //DONE
            if (((currx == tempx [0]) && (curry == tempy [0])) || ((currx == tempx [1]) && (curry == tempy [1])) || ((currx == tempx [2]) && (curry == tempy [2])) || ((currx == tempx [3]) && (curry == tempy [3])) || ((currx == tempx [4]) && (curry == tempy [4])))
                return false;
            else
                return true;
        public void collision (Graphics g)
            drawgrid (g);
            for (int count = 0 ; count < 5 ; count++)
                if ((currx == tempx [count]) && (curry == tempy [count]))
                    g.setColor (Color.darkGray);
                    g.fillOval (currx, curry, 25, 25);
                else if ((currx != tempx [count]) && (curry != tempy [count]))
                    g.setColor (Color.red);
                    g.fillRect (tempx [count], tempy [count], 25, 25);
        public void drawitems (Graphics g)
            for (int count = 0 ; count < 5 ; count++)
                g.setColor (Color.red);
                g.fillRect (tempx [count], tempy [count], 25, 25);
        public void pickitems (Graphics g)
            check = false;
            for (int count = 0 ; count < 5 ; count++)
                if (locval [count] <= 5)
                    tempy [count] = 22;
                else if (locval [count] <= 10)
                    tempy [count] = 68;
                else if (locval [count] <= 15)
                    tempy [count] = 114;
                else if (locval [count] <= 20)
                    tempy [count] = 160;
                else if (locval [count] <= 25)
                    tempy [count] = 206; //this determines the y-position of the item to be placed
                if (locval [count] % 5 == 0)
                    tempx [count] = 294;
                else if ((locval [count] == 1) || (locval [count] == 6) || (locval [count] == 11) || (locval [count] == 16) || (locval [count] == 21))
                    tempx [count] = 30;
                else if ((locval [count] == 2) || (locval [count] == 7) || (locval [count] == 12) || (locval [count] == 17) || (locval [count] == 22))
                    tempx [count] = 96;
                else if ((locval [count] == 3) || (locval [count] == 8) || (locval [count] == 13) || (locval [count] == 18) || (locval [count] == 23))
                    tempx [count] = 162;
                else if ((locval [count] == 4) || (locval [count] == 9) || (locval [count] == 14) || (locval [count] == 19) || (locval [count] == 24))
                    tempx [count] = 228;
        public void drawgrid (Graphics g)  //DONE
            g.drawRect (10, 10, 330, 230); //draws the outer rectangular border
            int wi = 10; //width of one square on the board
            int hi = 10; //height of one square on the board
            for (int height = 1 ; height <= 5 ; height++)
                for (int row = 1 ; row <= 5 ; row++)
                    if (((height % 2 == 1) && (row % 2 == 1)) || ((height % 2 == 0) && (row % 2 == 0)))
                        g.setColor (Color.gray);
                        g.fillRect (wi, hi, 66, 46);
                    else /*if (((height % 2 == 0) && (row % 2 == 1)) || ((height % 2 == 0) && (row % 2 == 0)))*/
                        g.setColor (Color.lightGray);
                        g.drawRect (wi, hi, 66, 46);
                        g.setColor (Color.lightGray);
                        g.drawRect (wi, hi, 66, 46); //drawn twice to make a shadow effect
                    wi += 66;
                wi = 10;
                hi += 46;
            } //this draws the basic outline of the game screen
    } // Keys3 class

  • My applet can access an image in Eclipse, but not when I put it online...

    Basically, I have an applet that displays images among other things.
    I stuck the images in the bin directory, and when I run the applet from Eclipse, there's no problem.
    But when I put the applet on my webpage, it crashes with a NullPointerException because
    image = ImageIO.read( new File( imageName ) ) can't seem to get the image.
    The images are in the same directory as my class files. I tried turning on all permissions.
    My html code is very simple:
    <applet code="ImageGenerator.class" width=1000 height= 500> </applet>
    Am I missing anything?
    Any idea what the problem is?

    Meteor,
    Can you shed some light on how big these files are?
    If these images are 200K each and you have 10 of them, then you're loading 2MB across the network each time the application loads. Depending on what you are doing, that may not be a good design.
    If these slow-loading images are needed right away, then embed them with your applet (preferably a Jar) and they should load pretty fast.
    If these slow-loading images are needed later, then thread the loading of them to a background task and use some form of visual feedback (like a "please wait" image) until they're finished.
    Lastly, if these images are relatively small and you are experiencing a significant speed difference between accessing them locally (such as on the server's file system or through a mapped-drive) and accessing them through http (or url, etc) then make sure your web server is feeding them up in a timely fashion and that there's no outstanding issues with the URL loading method and the Java version you're using.
    Please read Andrew's posts closely as you should not be designing an applet that loads files as a local resource unless you really need to. Signing the applet will allow you to save them locally to the filesystem (as a "cached" version to be loaded later), but don't try to load the images as files directly from the web server's file system. The signed applet will only be able to access the local file system of the station it's being run on, hence, usually not the server!
    As far as caching the files locally, Java webstart has potentially a better ways of doing that sort of stuff for you.
    -Tres

Maybe you are looking for

  • Lumia 520,It get's hot

    Hi Nokia,I own a Nokia Lumia 520 and now in summer I have problem with my device.When I'm charging It and play games at the same time or sometimes just play It get's really hot the upper spot from the camera. I read that for safety reasons It will cl

  • How to create Services in ADF

    Hi , I have requirement to create independent services in ADF , which when called, independently complete the tasks of putting or fetching data from the Database., irrespective of the page defs from where it is called. For example a Look up service,

  • Move back and forth between frames in a sequence.

    I am developing a program that is a sequence with many frames (40 so far).  In each frame there is a VI that I have created.  Each of these VIs has an input terminal to which I wire a string constant that asks the user a question or gives the user a

  • Administrator login information error

    In setting up my niece's new MacBook Pro, I apparently mistyped her chosen password the same way twice. Now, we cannot install software updates because we are told the information is incorrect. Short of returning the computer to Apple, is there anyth

  • I have a gps case for my ipod touch How can I download a gps telenav for my ipod?

    I try to install but it's say is no compatible with this device... Thanks