Applet JNLP not accessible in browser ?

Hello,
I am new to java and to programiing in general. Thanks in advance for your help. I can't get an Applet to work in any browser (Google, Mozilla, IE) while it works fine in appletviewer. Why?
The Source:
import java.awt.*;
public class Hwa extends java.applet.Applet {
public void init (){
     add(new Label("Hello World"));
compiled in Hwa.class, then in a Hwa.jar file,
The JNLP file:
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="" href="">
<information>
<title>Hw Applet</title>
<vendor>CCN</vendor>
</information>
<resources>
<j2se version="1.4+" href="http://java.sun.com/products/autodl/j2se" />
<jar href="http://www.ccca.eu/Hwa.jar" />
</resources>
</jnlp>
The HwaAPJNLP.html file:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html dir="ltr" lang="fr"><head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>CCCAEU</title>
<meta content="" name="author">
<style type="text/css"></style>
<link rel="stylesheet" href="CCCAEU.css" type="text/css">
</head><body>
<applet code="Hwa.class" ref_jnlp="Hwa.jnlp" height="50" width="150"></applet>
</body></html>
All files are copied on the http://ccca.eu/. of the server
Executing appletviewer HwaAPJNLP.html (local copy of the html file) works just fine BUT launching http://www.ccca.eu/HwaAPJNLP.html returns a blank rectangle with the JAVA console message "Detected from bootclasspath: C:\\PROGRA~1\\Java\\jre7\\lib\\deploy.jar" and "Incompatible magic value 1008812135 in class file Hwa". WHY ?
FYI, the ".htaccess" file on my WebServer is
AddType x-mapp-php5 .php
AddType application/x-java-jnlp-file JNLP
Thanks in advance for your support.

Thank you Baftos. It works but I still do not understand the logic. Before, my Hwa.class was only accessible through my Hwa.jar file on http://www.ccca.eu/Hwa.jar, itself defined as the reference if the jnlp file, see above. My understanding of the jnlp logic is that the html page will load the Hwa.class from the Hwa.jar file. Is that correct ? Thanks to your post, I copied the Hwa.class directly under http://www.ccca.eu/Hwa.class and yes, when accessed through the browser, I can download it. Even better, my previous html page above - unchanged - now WORKS. Thanks for letting me know where I think wrong.

Similar Messages

  • JavaFX applet JNLP not working in browser

    Hi,
    I have developed a JFX applet with multiple stages, which get visible and not visible at different times.
    I have a search bar on the main stage which shows up at the beginning. However, on searching, i am not getting any response from the widget when i search.
    I am running the jnlp in the browser.
    I am doing the right thing ? Anything more needs to be done in terms of creating the jnlp ?
    Kedar

    Perhaps you can make a simple mockup application illustrating how you do your stage management, so we can see how you do (if that's "the right thing"...).

  • 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.

  • Applet does not run in Browser

    Iam using Windows XP and IE 6.0. Applets do not run in my browser. Hovering the cursor where the applet should be in the browser, I get a Class not found message. Setting the CLASSPATH variable did not help. Any suggestions?

    You might find an answer in this new page
    [url http://java.sun.com/j2se/1.4.2/docs/guide/deployment/deployment-guide/upgrade-guide/index.html]Java Upgrade Guide: Migrating From the Microsoft JVM to the Sun JRE

  • Applet was not running in Browser

    I have wriiten one applet (using JMF for playing a song)program and it was run in appletviewer it's work perfectly.After that i was open this prog in browser it doen't work ,it gives following error :
    java.lang.NoClassDefFoundError: javax/media/ControllerListener
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         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)
    java.lang.NoClassDefFoundError: javax/media/ControllerListener
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         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)Any one help me,becaz past 4 days i have getting this error ,so i cann't move further any steps on my module ,so any one help me.
    Advance Thankx & Regards
    K.suresh

    Hai Manu
    I am using u r code,and change my applet tag like
    <APPLET CODE="SimplePlayerApplet.class" WIDTH = "300" HEIGHT = "300" ></XMP>
    <PARAM NAME ="FILE" VALUE = "artist - Track 01.mp3" >
    </APPLET>Now i am getting error as:
    APPLET tag missing CODE parameter.
    java.lang.NullPointerException: name
         at sun.applet.AppletClassLoader.getResourceAsStream(Unknown Source)
         at sun.applet.AppletPanel$6.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         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)
    the applet program below there
    import java.applet.Applet;
    import java.awt.*;
    import java.io.IOException;
    import java.io.PrintStream;
    import java.net.MalformedURLException;
    import java.net.URL;
    import javax.media.*;
    public class SimplePlayerApplet extends Applet
        implements ControllerListener
        public SimplePlayerApplet()
            player = null;
            visualComponent = null;
            controlComponent = null;
            progressBar = null;
            firstTime = true;
            CachingSize = 0L;
            panel = null;
            controlPanelHeight = 0;
            videoWidth = 0;
            videoHeight = 0;
            System.out.println("Hai");
    public void init()
            setLayout(null);
            setBackground(Color.white);
            panel = new Panel();
            panel.setLayout(null);
            add(panel);
            panel.setBounds(0, 0, 320, 240);
            String s = null;
            MediaLocator medialocator = null;
            Object obj = null;
            System.out.println("IT's from Init");
            System.out.println("S value is:" + s);
            if ((s = getParameter("FILE")) == null)
                 System.out.println("S value is:NULL");
                Fatal("Invalid media file parameter");
            try
                URL url = new URL(getDocumentBase(), s);
                System.out.println("URL Value is:" + url);
                s = url.toExternalForm();
            catch(MalformedURLException malformedurlexception) { }
            try
                if((medialocator = new MediaLocator("file:" + s)) == null)
                    Fatal("Can't build URL for " + s);
                    System.out.println("catch in malformed");
                try
                    player = Manager.createPlayer(medialocator);
                    System.out.println("it is from create player");
                catch(NoPlayerException noplayerexception)
                    System.out.println(noplayerexception);
                    Fatal("Could not create player for " + medialocator);
                player.addControllerListener(this);
                System.out.println("player add control");
            catch(MalformedURLException malformedurlexception1)
                Fatal("Invalid media file URL!");
            catch(IOException ioexception)
                Fatal("IO exception creating player for " + medialocator);
        public void start()
            if(player != null)
                player.start();
                System.out.println("This from start");
        public void stop()
            if(player != null)
                   System.out.println("This from stop");
                player.stop();
                player.deallocate();
        public void destroy()
            player.close();
            System.out.println("This from Destory");
        public synchronized void controllerUpdate(ControllerEvent controllerevent)
              System.out.println("This from cotrollerUpdate");
            if(player == null)
                return;
            if(controllerevent instanceof RealizeCompleteEvent)
                if(progressBar != null)
                    panel.remove(progressBar);
                    progressBar = null;
                int i = 320;
                int j = 0;
                if(controlComponent == null && (controlComponent = player.getControlPanelComponent()) != null)
                    controlPanelHeight = controlComponent.getPreferredSize().height;
                    panel.add(controlComponent);
                    j += controlPanelHeight;
                if(visualComponent == null && (visualComponent = player.getVisualComponent()) != null)
                    panel.add(visualComponent);
                    Dimension dimension = visualComponent.getPreferredSize();
                    videoWidth = dimension.width;
                    videoHeight = dimension.height;
                    i = videoWidth;
                    j += videoHeight;
                    visualComponent.setBounds(0, 0, videoWidth, videoHeight);
                panel.setBounds(0, 0, i, j);
                if(controlComponent != null)
                    controlComponent.setBounds(0, videoHeight, i, controlPanelHeight);
                    controlComponent.invalidate();
            } else
            if(controllerevent instanceof CachingControlEvent)
                if(player.getState() > 200)
                    return;
                CachingControlEvent cachingcontrolevent = (CachingControlEvent)controllerevent;
                CachingControl cachingcontrol = cachingcontrolevent.getCachingControl();
                if(progressBar == null && (progressBar = cachingcontrol.getControlComponent()) != null)
                    panel.add(progressBar);
                    panel.setSize(progressBar.getPreferredSize());
                    validate();
            } else
            if(controllerevent instanceof EndOfMediaEvent)
                player.setMediaTime(new Time(0L));
                player.start();
            } else
            if(controllerevent instanceof ControllerErrorEvent)
                player = null;
                Fatal(((ControllerErrorEvent)controllerevent).getMessage());
            } else
            if(controllerevent instanceof ControllerClosedEvent)
                panel.removeAll();
        void Fatal(String s)
            System.err.println("FATAL ERROR: " + s);
            throw new Error(s);
        Player player;
        Component visualComponent;
        Component controlComponent;
        Component progressBar;
        boolean firstTime;
        long CachingSize;
        Panel panel;
        int controlPanelHeight;
        int videoWidth;
        int videoHeight;
    }

  • Applet is not appearing in Browser

    I created a standalone application that works (uses Swing). I wanted to place it on a webpage as an applet.
    this is wrking in applet viewer, whn i tryed in HTML using the applet tag calling the class file the applet is still not showing. in the browser ..
    i am getting this error
    arning: running 1.2 version of SwingUtilities
    java.lang.InstantiationException: JApplet1
         at com/ms/applet/BrowserAppletFrame.newInstance (BrowserAppletFrame.java)
         at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
         at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
         at com/ms/applet/AppletPanel.run (AppletPanel.java)
         at java/lang/Thread.run (Thread.java)
    can u plz! tell me the solution for this
    nandhu

    so did you have a standalone application or an applet? they are totally different... also, check and see if you have java plug in for your broswer...

  • Applet will not load in browser Unsupported major.minor version 48.0

    I found this page, and many others like it from search the net:
    http://forum.java.sun.com/thread.jspa?forumID=421&threadID=345619
    When I first got java installed 1.4.2_02, and that is the directory I always work in.
    I HAVE installed:
    jre 1.5.0
    and
    JMF2.1.1e
    HOWEVER!!! When i go to the Java icon in the toolbar and dub-click it states:
    Java(TM) Plug-in: Version 1.3.1_13
    Using JRE version 1.3.1_13 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\javasojava
    Proxy Configuration: no proxyAdditionally, if I go to windows Control panel it states:
    Java Plug-in 1.3.1_13
    My very simple applet program does compile with appletviewer, but
    throws this error in browser.
    Needless to say, this is extremely frustrating.
    Have no other problems building java apps or anything classpath related that am aware of.
    Here it is:
    CLASSPATH=.;C:\PROGRA~1\JMF21~1.1E\lib\sound.jar;C:\PROGRA~1\JMF21~1.1E\lib\jmf.jar;C:\PROGRA~1\JMF21~1.1E\lib;.;.;C:\j2sdk1.4.2_04\jre\lib\ext\sound.jar;C:\j2sdk1.4.2\2
    Thank you!

    here is what I get when I open the page you mentioned:
    ==============================================
    Error loading class: ArcTest
    java.lang.NoClassDefFoundError
    java.lang.ClassNotFoundException: ArcTest
         at com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)
         at com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)
         at com/ms/applet/AppletPanel.securedClassLoad (AppletPanel.java)
         at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
         at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
         at com/ms/applet/AppletPanel.run (AppletPanel.java)
         at java/lang/Thread.run (Thread.java)Why.. because I refuse sun to run <applet tag applets. As with the msjvm the <applet
    tag is history so I don't understand why SUN would use depreceated html code in
    their 1.5 examples.
    Check what I said about versioning and use the object tag and try to run the following
    applet:
    http://forum.java.sun.com/thread.jspa?threadID=603571
    second post

  • Java applet will not install in browser

    My VI will not install a JAva Applet. I jsut keeps saying "Installing Java Applet" and it never prompts for an install or anything. Any ideas? Is there something extra that I need to do that I am not realizing? I attached a screenshot of the window where is says installing.
    Solved!
    Go to Solution.
    Attachments:
    Capture.PNG ‏54 KB

    How are you trying to install the java applet? Through a website? Calling an installer? 
    Could it be that the applet already installed on the computer?
    Has it ever worked? 
    Applications Engineer
    National Instruments
    CLD Certified

  • Applet with Image not working in Browser, works fine in Appletviewer

    Hi,
    I encountered a problem , running my Applet in a browser. (IE and Firefox, ame problem).
    When I use an ImageIcon, it doesnot work. in a browser.(When I remove the icon, it's oke)
    In Appletviewer it works fine. In the browser I first got a security-exception.
    I dealed with that by signing the jar (with the test certificate).
    Now the browser's java console is not showin any faults, but the applet is showing no picture at all.
    Only the text of the label is shown.
    Can someone help me?
    I downgraded the class to a very simple form, shown underneath. This runs fine in Appletviewer, but not in a Browser.
    Best Regards
    Remco

    I have recently had the same problem, after lots of searching, I found that only Java 1.1 is supported by browsers, leaving out everything else including swing. So if you cant play the applet through your browser you need to download the appropriate patch i think about 5mbs.
    You should find one at java.sun.com/getjava/download.html
    Mine worked fine afterwards

  • Applet not running in browser?

    Hi
    What is the reason why an applet will be running in appletviewer but not in a browser???

    Hi,
    Try out with this html file:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
    <html>
    <head>
    <title>Example</title>
    <script language="JavaScript">
    function MyToolBar()
    window.open("Login.html","LoginPage","toolbar=0,menubar=0,scrollbar=0,resizable=0,directories=0,width='110%',height='150%'");
    </script>
    </head>
    <body>
    <blockquote>
    <!--"CONVERTED_APPLET"-->
    <!-- CONVERTER VERSION 1.1 -->
    <SCRIPT LANGUAGE="JavaScript"><!--
    var info = navigator.userAgent; var ns = false;
    var ie = (info.indexOf("MSIE") > 0 && info.indexOf("Win") > 0 && info.indexOf("Windows 3.1") < 0);
    //--></SCRIPT>
    <COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
    var ns = (navigator.appName.indexOf("Netscape") >= 0 && ((info.indexOf("Win") > 0 && info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) | | (info.indexOf("Sun") > 0) | | (_info.indexOf("Linux") > 0)));
    //--></SCRIPT></COMMENT>
    <SCRIPT LANGUAGE="JavaScript"><!--
    if (_ie == true) document.writeln('<Center><OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "100%" HEIGHT = "150%" codebase="http://java.sun.com/products/plugin/1.1.2/jinstall-112-win32.cab#Version=1,1,2,0"><NOEMBED><XMP>');
    else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.1.2" java_CODE = "MyApplet.class" WIDTH = "110%" HEIGHT = "150%" pluginspage="http://java.sun.com/products/plugin/1.1.2/plugin-install.html"><NOEMBED><XMP>');
    //--></SCRIPT>
    <APPLET CODE = "MyApplet.class" WIDTH = "110%" HEIGHT = "150%" ></XMP>
    <PARAM NAME = CODE VALUE = "MyApplet.class" >
    </APPLET>
    </NOEMBED></EMBED></OBJECT></Center>
    <!--
    <APPLET CODE = "MyApplet.class" WIDTH = "110%" HEIGHT = "150%" >
    </APPLET>
    -->
    </body>
    </html>
    Hope this will help you.
    Anil
    Developer Technical Support
    Sun Microsystems Inc,
    http://www.sun.com/developers/support

  • Applet not viewable in browser

    Hi
    applet not viewable in browser any website that uses java code seems not to run on my browser though it runs normally well on my friends computer. The browser shows a screen area in grey colour with an error message like "Exception: java.lang.ClassNotFoundException:GUIDemo.class" (im using Win NT4 and IE 5.5) checked the tools/internet options/advanced seettings the browser support is enabled. tried installing the newer version of JRE still not working ..Please guide about any settings that need to be modified or how can i fix this problem ..
    Regards
    anant
    [email protected]

    Hi
    Just a thought, but what broswer are you and your friend using? Are they different by any chance?
    There is an inconsistency between browsers and java, and unfortunately it can result in the error you saw.
    Basically, bog standard Internet Explorer uses its own JVM, whereas Netscape, Mozilla, Opera etc tend to use the java plug-in. To make matters worse, if you install the plug-in on a machine that has Internet Explorer installed, it over-rules the Microsoft version to make itself the default (but this can be undone by looking in the Options menu for Java-plugin and un-ticking the box). Give that a try first.
    Another cause that I have encountered was when using NT on a network, which had been configured not to accept Java Applets at all! Are you on such a network, or stand alone?
    Hope that helps.

  • Applet does not get loaded when viewed in a browser

    Hi,
    I have an applet,which works fine when I use appletviewer to see it. But from the browser, the applet does not get loaded.
    An error appears at the bottom of the browser that load: class not found.
    Any suggestions...please..
    Thank you....
    Pooja

    If you are using Internet Explorer, you should check to see if your browser is set to use Sun's JRE that came with your download of the SDK. (If you didn't install the JRE, you need to go back and run that on your machine. You can check to see if you are using Java's runtime enviornment (JRE) in Internet Explorer by opening IE and going to Tools --> Internet Options... --> and then going to the Advanced tab. Scroll down and make sure the box next to Java Sun "use Java 2 for <applet>" is checked. If that option is not available, you need to install the JRE.
    If that doesn't help, try using the HTML converter that comes with the SDK. It'll take your current HTML page, and you can customize it to force a download and/or usage of the JRE for applet viewing if for your particular browser.
    Hope one of these helps!

  • Applet popping up in own window, not showing in browser

    Hello,
    I have created an applet which is, by nature, supposed to load in the browser window.
    In my case, it loads, but not in the browser, in its own window, outside of the browser.
    Any ideas?
    Haig

    It sounds like you're adding your components to a Frame and then setting it visible. If you want your applet to be embedded in the browser, you have to add your components directly to the applet itself.

  • Clear classloader when exit applet, but not browser

    Hi there,
    I've got some problems with the classloader.
    when i start my applet with the language de, it will correctly name the buttons etc. in german.
    in my site it is possible to change the language. after clicking on another lanuage, my applet
    restarts with the correct parameters (language=en), but the buttons and so on are still named in
    german.
    i figured out, that after clearing the classloader cache, the language is the correct one.
    how can i clear the classloader cache when i leave the applet, but not the browser?
    thanks in advance!

    Hi there,
    I've got some problems with the classloader.
    when i start my applet with the language de, it will correctly name the buttons etc. in german.
    in my site it is possible to change the language. after clicking on another lanuage, my applet
    restarts with the correct parameters (language=en), but the buttons and so on are still named in
    german.
    i figured out, that after clearing the classloader cache, the language is the correct one.
    how can i clear the classloader cache when i leave the applet, but not the browser?
    thanks in advance!

  • Some applets is not displayed in the ie6 browser

    Dear all
    Pls hlp me in this issue
    Some applets is not displayed in the ie6 browser
    it is displayed after enabling the Java sun "Use Java 2v1.4.0 for applet "
    but some applets is displayed without enabling Java Sun
    Insted of JavaSun we use MicroSoft Vm
    how is this possible

    Hi,
    As Julien said you can install the SQL Studio and check for the table starting with M followed by a number with your rootnode name. Similarly for the child node also. If you see that the data is present please check if you have written a BIND method for your table, form in the either the INIT or the supply function.
    Regards,
    Narayani

Maybe you are looking for