Cannot load an applet in a local file

With
Fedora Core 3
JDK 1.5.0_05
Firefox 1.0.7 or Appletviewer
I can load most applets loaded fron web sites. But I cannot load a simple file:
<html>
<head><title>diagnostics</title></head>
<body>
<h1>example applet1</h1>
<applet codebase="." code=Applet1" width=120 height=120>
</applet>
</body>
</html>
with a simple hello world applet like:
import java.awt.*;
import java.applet.*;
public class Applet1 extends Applet {
public void paint(Graphics g) {
g.drawString("Hello World", 10, 10);
Loading the page it reports a General exception:
java.lang.ClassNotFoundException: Applet1
Both files are in the same directory.
It happens both with firefox and appletviewer.
I would appreciate any help or feedback of similar behaviour.
Manchu.

I just let your code run in JCreator and I found 1 error in yout HTML code:
<applet codebase="." code="Applet1" width=120 height=120>(that is how the line should look like, corrected)

Similar Messages

  • Cannot load java applets in Safari

    I have several accounts on my machine. In one, the one I use most of the time, Safari will not load java applets. I have checked preferences and compared with those set on the other accounts. They are the same, including enabling javva and javascript. I have removed the Safari plist. I have repaired permissions. I have reset safari, cleared history and caches, used Cocktail to clear caches. I have rebooted.
    I set up a new test account and it works fine.
    What's going on, and how do I cure it?

    I will try the pram reset, though I am not confident of it since this problem affects only one account.
    On the new account business. I note that when I set up a new account, before I launch safari, there are no files in the Library related to Safari. They are created on the first launch. If I delete them all, then they are recreated on another launch. What if, in the affected user directory, I exported the bookmarks and/or dragged the bookmarks file to the desktop. Then deleted all evidence of safari from the account. I should now have, in effect, a virgin install of safari. Launching it would create all of the necessary files and directories. If safari works with java applets, or does not, I can simply move the bookmarks back in and be no worse off than I was in the beginning.
    Any serious fault with that? I am working at home today so cannot do this until I am in the office on Monday.

  • Signed applet to open local file problem with IE6 / Firefox

    Hello
    I have a signed applet to open a local file, with this code :
    try{
       URL destination=null;
       File f=new File(adresse);
       destination=f.toURL();
       AppletContext ac=applet.getAppletContext();
       ac.showDocument(destination,"_blank");
    catch (MalformedURLException e)
       System.out.println(e.toString());
    ...It works perfectly with Netscape 7.01 and IE 5.5, but not with IE6.0 or Firefox 1.0...
    (using SUN JVM 1.4.2_04), and there is no trace/error message
    With a http link, it works for all browsers...
    try{
       URL destination=new URL("http://my.site/mypage.htm");
       AppletContext ac=applet.getAppletContext();
       ac.showDocument(destination,"_blank");
    catch (MalformedURLException e)
       System.out.println(e.toString());
    ...Any idea ??
    Thanks

    Hello again
    There's something I don't undestand...
    java applet code
    import java.applet.*;
    import java.net.*;
    public class test extends Applet {
         public void init() {
              try {          
                   String path = "file:/C:/Temp/";
                   URL destination = new URL(new URL(path) ,"test.jpg");
                   System.out.println("URL is now: " + destination.getPath() );          
                   AppletContext ac = this.getAppletContext();
                   ac.showDocument(destination, "_blank");
              } catch (Exception e) {
                   e.printStackTrace();
    html code
    <html>
    <head>
    <title>test</title>
    </head>
    <body>
    <applet CODE = "test.class" ARCHIVE = "sTest.jar" width=350 height=200></applet>
    </body>
    </html>
    Signature
    javac -classpath ".;D:\Program Files\Java\j2re1.4.2_04\lib\plugin.jar" test.java
    keytool -genkey -keystore mag -keyalg rsa -alias harm -validity 3600 -keypass password -storepass password
    jar cf0 test.jar *.class
    jarsigner -keystore mag -storepass password -keypass password -signedjar sTest.jar test.jar harm With a debug the signature looks good in the logs (translation by google, not sure of the correct words...)
    The checking of the certificate using the certificates CA root failed
    Piled up method
    Unstacked method
    Selected user: 0
    The user granted the rights of access to the code for this session only
    Addition of the certificate in the storage section of the certificates of session JPI
    Certificate added in the storage section of the certificates of session JPI
    Recording of the certificates in the storage section of the certificates of session JPI
    Certificates recorded in the storage section of the certificates of session JPI
    URL is now: /C:/Temp/test.jpg
    Javascript: Activated UniversalBrowserRead
    Javascript: Activated UniversalJavaPermission
    What are the 2 last line ?? (appears only in firefox, not in IE55...don't have another browser yet 'cause my graphic card and motherboard are out of order :-(
    Why in firefox, in the javascript console, there is a "message" (again translation by google...) but everything is alright in the java console ??
    Error of safety: the contents located at http://www.distantserver.com/Demo/test/test.html cannot charge of data or establish a bond towards file:///C:/Temp/test.jpg.
    Thanks in advance (and sorry if I only don't understand something from your link because of my english level...)

  • Appletviewer cannot load Swing Applet

    Hi. there
    I'm facing the problem that appleviewer cannot load
    my swing applet.
    Acctually, a few days ago, before I implemented Button Event Handling, appleviewer work properly.
    But now It's not working.
    java -verbose appletviewer jadmin.html
    -> Exception in thread "main" java.lang.NoClassDefFoundError: appletviewer
    I already reinstall JDK1.3 because I chaged java.policy file.
    and then this is not a source-level problem, I put into source System.out.pritln(), but not printed.
    This is my classpath and path.
    [classpath]
    .;C:\jdk1.3\jre\lib\rt.jar;C:\jdk1.3\lib\tools.jar;C:\jakarta-tomcat-3.2\lib\servlet.jar;C:\jkjdbc\jkjdbc.jar
    [path]
    .;C:\jdk1.3\bin;C:\jdk1.3\Jre\bin;C:\Program Files\Microsoft SDK for Java 4.0\Bin
    Please Let me Know about it.
    Thank you for reading.
    p.s In Current source, several inner classes(event handling class), but appletviewer work properly with inner class prev. source that I mentioned.

    Hi,
    You don't have to call java to run the appletviewer. You'll onlyhave to run:
    appletviewer jadmin.html
    to make it work.
    Regards,
    Kurt.

  • How to make applet access a local file in intranet?

    I want to have my applet read from and write to a file on the user's PC. This is our company's intranet and security is not a concern so we don't want to go through the complicated certificate procedure.
    Our application server is weblogic. The jsp containing the applet can be accessed at http://10.150.20.100:7001/slfweb/jsp/Home.jsp. According to Core Java (Volume II), I put the following paragragh into java.policy file under jre/1.3.1/lib/security dir of each user's PC, hoping this will grant the permission for the applet to read/write a file in tmp dir:
    grant codeBase "10.150.20.100:7001/slfpweb/" {
    permission java.io.FilePermission "C:\\tmp\\*", "read, write";
    However, it does not work. Can someone tell me what is the simplest way to allow an applet to read/write a local file in intranet system?
    Thank you very much!
    Ming

    I guess the reason you're still running into permission problem is that you have not addressed the required settings in the browser(s) that you're using.
    On everyone's PC, the following must be done:
    1) on IE, click Tools | Internet Options | Security . Under Trusted Sites, add your server's IP address. Under Local Intranet, reset it to Medium or Low and check to see if any of the relavant settings require attention (note that a Java Applet is equivalent to an ActiveX object in IE) . Finally, go into Java Custom Settings and make the appropriate changes.
    2) on NN, to access local files, you can enable Codebase Principals by adding the following line to the user's pref.js file (look for it where NN is installed -- usually under C:\Program Files):
    user_pref("signed.applets.codebase_principal_support", true);
    I have also read Core Java and found that the authors have a way of over-simplifying everything and failure to adequately describe other factors that may potentially affect what they're describing.
    V.V.
    PS: Signing an applet with a self-signed certificate is not all that difficult. Here is a link to my file i/o applet that contains pertinent info that you might want to look into:
    http://home.attbi.com/~aokabc/FileIO/FileIOdemo.htm

  • How the applet can access local file system?

    1. I want to plugin the applet into the JSP. That applet should access the local file system. How to enable this programmatically.
    2. Is it is possible to embed a frame inside the JSP. If so how?
    Thanks in advance..
    K G Vinoth

    1: If you want the applet to access the client's local file system you'll have to sign the applet. There is a tutorial some where on the java.sun.com that explains how to sign an applet.
    2: No you;ll need to use an applet to display swing or awt components on the client browser.

  • Cannot load a Applet using Weblogic6.1

    I am unable to load an applet. My application/web server is weblogic6.1. The problem is i am unable to set the right codebase.
    any ideas..on how to set codebase when using weblogic 6.1.. my applet class files are in
    c:/bea/applications/myApp/WEB-INF/classes

    thanx for the mail..
    When this application was set as Default application, even though the applet class files were in /WEB-INF/classes, it worked.. but now this is no longer a default application and the applet throws classnotfound exception..
    i guess i am missing some other settings ...
    The applet needs to be publically accessible to the
    client. Nothing in WEB-INF is going to be publically
    accessible. You need to put the applet somewhere
    else, such as where you'd normally put the referencing
    HTML file.

  • Cannot load the applet

    Hello.
    I am trying to use the j2re-1_4_1-win.exe, but it will not load all the way up. A new window will open, but the graphics do not load entirely, including the text fields, rendering the applet useless. I had my pc debugged, tried installing and uninstalling java ad nauseum, but still cannot run the applet. The progress bar will show that the applet is Done loading, but I never get to use it. I have tried using the applet on other machines and succeeded. Any advice? Anyone?

    Determine what the actual error is. The Java Console will have this. In IE, use the Tools menu.

  • Cannot load webpages. Using a PAC file under Airport Proxies?

    Hi,
    so I got home today from work and now I can only load certain webpages. I can load the apple homepage, and google, and also google search results will appear, but if i click on any of them, or try to enter another website Safari will say 'cannot find server'. I have compared my Airport settings with my brother's Macbook, also running on the same home wireless network, and the big difference is that whereas his 'Configure Proxies' setting under the 'Proxies' tab in Airport is set to 'Manually', mine is set to 'Using a PAC file'.
    Of course I have tried to fix this problem by setting mine to 'Manually' as well, but even if i click 'OK' and "Apply', it seems to instantly revert.
    In the meantime, skype is working, as is my RSS reader. Please can somebody give me some ideas as to what could be going wrong?
    Thanks

    Alternatively I set the router not to make its own connection and then make the PPPoE connection from the mac.
    That is not the best way to use a router. It is better to use the router to make the connection and then let your mac and pc just get an ip from the router using dhcp.
    Set your router to use alternative dns servers if your still having issues such as opendns.com

  • Adobe X Standard cannot load/create EuroRoman.ttf font after file has been created using AutoCAD LT 2015. File was loaded and refereneced with Distiller X. Font has been installed to Win7

    Need suggestion on how to get Adobe X to create/load the font. Others in the office can create the same Adobe file with no issues. Help please.

    You have the required Xorg drivers and those errors appear to be expected (https://www.virtualbox.org/ticket/4789). As a matter of fact, Xorg is terminating successfully. Just to make sure, is your ~/.xinitrc setup correctly?

  • Loading an Image from a local File (AIR/Flex)

    var f:File = (assume it's a valid image file reference)
    var i:Image = new Image();
    i.source = f.nativePath;
    Kinda makes sense right? Except it doesn't display properly when the image is added unless I also specify a width and height on the new Image. This may not be a problem in many applications that hard code the size anyway, but I want to use the actual size of the image, without rescaling.
    i.width = whatever;
    i.height = whatever;//But I don't want to hard code these values, I want "actual" image size!
    Anyone know of a way to get around this problem? Am I missing a step here? Web resources on this specific topic are very lacking.

    I would think that this crummy custom Image class hack would work, but surprise surprise -- the width/height in loaderInfo is flat out WRONG when the event fires. It seems to have a hard coded width/height no matter what the file size. Silly!
    <mx:Image xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()">
         <mx:Script>
              <![CDATA[
                   public function init():void {
                        this.addEventListener(Event.COMPLETE, loaded);
                   private function loaded(e:Event):void {
                        this.width = this.loaderInfo.width;
                        this.height = this.loaderInfo.height;
              ]]>
         </mx:Script>
    </mx:Image>
    Turns out, this version DOES work (but it's still a hack fix in my opinion):
    <mx:Image xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()">
         <mx:Script>
              <![CDATA[
                   public function init():void {
                        this.addEventListener(Event.COMPLETE, loaded);
                   private function loaded(e:Event):void {
                        this.width = this.contentWidth;
                        this.height = this.contentHeight;
              ]]>
         </mx:Script>
    </mx:Image>
    You guys at Adobe are so silly.    It would seem to me that Image's width and height should be set (rather than left at 0) once the content's width and height is known.  So now that I've fixed this bug (as far as I'm concerned) for ya Adobe, I take cash, cashier's check, or money orders--thanks!
    But really, if this doesn't work this way in Flex 4, I think it should.

  • Discoverer Plus -- Cannot Load Java Applet after JRE upgrade to 6

    Hi,
    After our users upgrade Java Runtime Environment to version 6 Update 1, Discoverer Plus stops working, the applet is opened but does not load.
    Uninstalling the update solves the problem.
    I disabled the automatic upgrade of Sun JRE on a few machines, but we have over 100 users.
    Did anyone else face the same issue and is there any patch for the Discoverer installation?
    Thanks,
    Vlad

    Hi George
    You can get the 10.1.2.2 patch (4960210) on MetaLink. Be warned though that this not a small patch. It is 1.6 GB in size and is a full upgrade of the 10.1.2.0.2 application server.
    I had some interesting problems when I first starting patching up to 10.1.2.2. First of all, if you are using a Windows server, you need to make sure that there are no lowercase characters used in your computer name. I know this sounds crazy but 10.1.2.2 will fail on Windows if you have this. If you've already got lowercase names in your machine you can't simply change the machine name to upper case because your existing application server will stop working as it embeds the machine name into dozens of configuration and setup locations. None of the Microsoft applications care what you call the machine as they don't embed like this but Oracle does. You'll probably end up having to reinstall the application server. However, the good news is that this only affects Windows and only when you have lowercase characters in your machine name.
    Secondly, also on Windows, make sure there are no spaces anywhere within any of the folder names from where you will be installing the patch. This is another cause of failure. Thus, don't put the patch on your Desktop as there are spaces in Documents and Settings!
    Thirdly, and this can happen on all platforms, if you are using an Infrastructure database and it is at 10.1.0.4 or less you will need to upgrade that database to 10.1.0.5 before you start any of the application server upgrades. If you don't do this your upgrade will fail. The release notes for the patch clearly state this but because they are very large I missed this the first time round and - oops - failed upgrade.
    By the way, it seems Oracle have also released a patch (5758865) , available on MetaLink, with the fix for IE7. This is a one-off patch and requires a password which means you will have to raise a service request and tell Oracle you are having trouble drilling in Viewer when using IE7. This patch is applicable whether you are using relational or OLAP modeling. It can only be installed on top of 10.1.2.2.
    Best wishes
    Michael

  • [SOLVED?] Openbox+perlpanel - cannot load NotificationArea applet

    Hi,
    I installed perlpanel to work with my Openbox, and of course all dependencies required. I have NOT Gnome installed.
    The provided NotificationArea applet does not load though, I am wondering if I am missing a dependency. This is the error message I get:
    Can't locate Gtk2/TrayManager.pm in @INC (@INC contains: /usr/lib/perlpanel /usr/lib/perl5/site_perl/5.10.1 /usr/share/perl5/site_perl/5.10.1 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl /usr/lib/perl5/current /usr/lib/perl5/site_perl/current . /home/stefano/.perlpanel/applets /usr/lib/perlpanel/PerlPanel/Applet) at /usr/lib/perlpanel/PerlPanel/Applet/NotificationArea.pm line 21.
    BEGIN failed--compilation aborted at /usr/lib/perlpanel/PerlPanel/Applet/NotificationArea.pm line 21.
    Compilation failed in require at (eval 24) line 1.
    Any clue?
    Thanks
    gm
    Last edited by gattu_marrudu (2010-01-11 20:52:43)

    gattu_marrudu wrote:
    Hi,
    I installed perlpanel to work with my Openbox, and of course all dependencies required. I have NOT Gnome installed.
    The provided NotificationArea applet does not load though, I am wondering if I am missing a dependency. This is the error message I get:
    Can't locate Gtk2/TrayManager.pm in @INC (@INC contains: /usr/lib/perlpanel /usr/lib/perl5/site_perl/5.10.1 /usr/share/perl5/site_perl/5.10.1 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl /usr/lib/perl5/current /usr/lib/perl5/site_perl/current . /home/stefano/.perlpanel/applets /usr/lib/perlpanel/PerlPanel/Applet) at /usr/lib/perlpanel/PerlPanel/Applet/NotificationArea.pm line 21.
    BEGIN failed--compilation aborted at /usr/lib/perlpanel/PerlPanel/Applet/NotificationArea.pm line 21.
    Compilation failed in require at (eval 24) line 1.
    Any clue?
    Thanks
    gm
    there maybe something wrong with line 21 /usr/lib/perlpanel/PerlPanel/Applet/NotificationArea.pm.

  • Cannot load Java applets

    Okay. So I have been having trouble loading games from Pogo.com recently.
    I can start to load the games, but they get stuck at "Loading Game".
    How can I fix this?

    Recently I investigated the issue with Safari and Java applets and my conclusion is that the problem is related to the browser rather than to the Java runtime: if you install Opera, everything should work. I recommend you to review this thread:
    http://discussions.apple.com/thread.jspa?threadID=1921644&tstart=45
    This is my discussion with some users regarding possible causes of the trouble and steps to eliminate it.

  • Applet access local file

    I have an applet that access local files and directory.
    I have create the applet policy file.
    When viewing with appletviewer, we can type:
    appletviewer -J-Djava.security.policy=applet.policy MainApplet.html
    However, when I want to embed the applet in a html, how can the policy file be included?
    Thx a lot.

    how can the policy file be included?Applets use the java.policy wich is located in the jre/lib/security
    (C:\Program Files\Java\jre1.5.0_04\lib\security)
    There is a java.security where you can add or change the java.policy files to be
    used
    policy.url.1=file:${java.home}/lib/security/java.policy
    After changing these files make sure the jre loads again, close all browsers
    and open the page.
    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
    http://forum.java.sun.com/thread.jsp?forum=63&thread=409341
    4th post explaining how to set up your own policy with your own keystore
    Still problems?
    A Full trace might help us out:
    http://forum.java.sun.com/thread.jspa?threadID=656028

Maybe you are looking for

  • Pefect display for Mac Mini, recommendations sought

    I'm thinking of upgrading. I currently have a pair of 17" G5 iMacs and I'm considering my options. I'm leaning towards Minis for a few reasons: 1. The spec is good enough for what I want. 2. The new iMacs are just too big for where I want to put them

  • Text is not copying from InDesign to any other application

    Hi. I'm not able to copy the content from inDesign CS2 to any other application (textEdit, MS-word etc) even I'm fail to import the doc file in to inDesign, while placing the document file in inDesign it keeps the document file inactive. In past ever

  • Big Mistake, how do I fix it.

    Peace and blessings, I tried to install Tiger from my Mac book into my G4 flat screen. I thought it was fine since they were both owned by me, as it turns out they're not compatable. My G4 is frozen. It starts out then after the apple appears its fre

  • Got a ALC-DSC-127-000

    Hi there, I want to invoke a process from a submit-button in a rendered PDF-File. I build an xdp with a submit-button that has the control type submit and entered in Submit to URL the URL of a servlet I wrote. In Submit As: I set XML Data(XML). I ren

  • 10.5.6 and Disk Warrior

    After upgrading my Core 2 Duo MacBook to 10.5.6 with Combo Updater, I have had kernel panic when I try to run Disk Warrior (version 4.1.1) after rebooting from external firewire hard drive (with OS X 10.5.5 on external drive). Disk Warrior crashes du