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.

Similar Messages

  • Problem loading image from jar file referenced by jar file

    First, I searched this one and no, I didn't find an answer. Loading images from jar files has been pretty much done to death but my problem is different. Please read on.
    I have my application, a straight up executable running from Eclipse. It uses a jar file, call it JarA. JarA launches a GUI that is located in another jar file. Call it JarB. To recap:
    My application calls JarA -> JarA loads classes from JarB -> JarB looks for images to place in a GUI it wants to show on the screen
    When JarB goes to load an image the following happens:
    java.lang.NullPointerException
         at sun.misc.URLClassPath$3.run(URLClassPath.java:316)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.misc.URLClassPath.getLoader(URLClassPath.java:313)
         at sun.misc.URLClassPath.getLoader(URLClassPath.java:290)
         at sun.misc.URLClassPath.findResource(URLClassPath.java:141)
         at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
         at java.lang.ClassLoader.getResource(ClassLoader.java:977)
         at org.cubrc.gmshell.gui.MainWin.preInit(MainWin.java:152)
         at org.cubrc.gmshell.gui.MainWin.<init>(MainWin.java:135)
    The code from JarB that loads the image looks like this:
              URL[] oSearch = {Main.class.getResource("images/")};
              URLClassLoader oLoader = new URLClassLoader(oSearch);
              imgIcon = new ImageIcon(oLoader.getResource("icon.gif"));
              imgMatchRunning = new ImageIcon(oLoader.getResource("gears.gif"));
              imgMatchStill = new ImageIcon(oLoader.getResource("gears-still.gif"));
              imgMagnify = new ImageIcon(oLoader.getResource("magnify.gif"));This looks right to me and JarB certainly has an images directory with those files. But I'm in hell right now because I don't know where to place the images to make this work or if you can even attempt to load images with a dependency chain like this.
    Any help very appreciated!

    Have you tried to move your image-files out of the jar file and place them in the sam folder as the jar-file? I think that would help.
    When you try to load the image-file you get the NullPointerException because the program tries to read a file it can't find. Remember that a jar file IS a file and not a directory.
    If you want to read somthing inside the jar-file you need to encode it first.
    Have you tried to read the jar-file with winRar. It makes it easy to add and remove files in your jar-file.

  • Problem loading URL from .jar file

    I encounter problems while loading a MsAccess DB contains within a .jar file. This is the following codes I used,
    try
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        java.net.URL url=getClass().getResource("MSAccessDB\\SavingApp DB.mdb");
        DBURL+=url.getFile();
    catch(Exception e)
    { System.err.println(e.toString()); }

    Could I ask that, if I stored the MsAccess or any other DBs, will the DB able to do basic operations (Create Update Retrieve Display)?
    As the DB is not like a normal Text file.
    What I did is that, I didn't include the MsAccess into the .jar file. I just put it beside. The disadvantage is that user ables to open the DB and might do some changes. ;-(

  • Loading library from jar file

    Hi all,
    My question is can we load library from jar file using System.load() method.
    ex:
    myJar.jar
    |
    |----com.test.common.Util
    which conatins a method to load library from jar file itself, before that i used to load from File
    |---libraries/MozillaParser/......
    Iam able load from Local system,
    File parserLibraryFile = new File("libraries/MozillaParser" + EnviromentController.getSharedLibraryExtension());
    File mozillaDistBinDirectory = new File("libraries/mozilla.dist.bin."+EnviromentController.getOperatingSystemName());
    MozillaParser.init(parserLibraryFile.getAbsolutePath() , mozillaDistBinDirectory.getAbsolutePath());
    but i am unable to load from jar file
    URL url = ClassLoader.getSystemClassLoader().getResource("libraries/MozillaParser" + EnviromentController.getSharedLibraryExtension());
    URL url1 = ClassLoader.getSystemClassLoader().getResource("libraries/mozilla.dist.bin."+EnviromentController.getOperatingSystemName());
    MozillaParser.init(url.toString(), url1.toString());
    Thanks in advance.

    That's a really confusing post.
    The easiest way to make sure you can use the classes in a jar file is to copy the jar file to the "/jre/lib/ext" subfolder of your JDK. These classes will be visible to all applications.

  • Cannot load component from JAR file.

    I got the message : cannot load component ... from JAR file. The class must be compiled and must be on the classpath of the project...
    I just add a javabean from a JAR file from Palette manager, then drag and drop it, then got this message.
    Can anyone tell me what i was wrong ? Thank you.

    Hi,
    You should paste your error log here to easy for other to help you.
    For your scenario, it is a big chance you didn't include the jar file into your classpath, please check.
    Thanks.

  • Problem While Loading mp3 From Jar File?

    Hello There
    I've Made a jar File That Contains mp3 file That Should be Played When the jar is opened
    but the file doesn't play?
    and my code snippet to load from the jar
    URL url=getClass().getResource("/file.mp3");
    MediaLocator ml=new MediaLocator(url);
    final Player player = Manager.createRealizedPlayer(url);
    I don't Know where's The Error
    Could any one Help?

    First_knight wrote:
    Hello
    -Yes I Use NetBeans 6.1 To create The Jar With The Following Steps:
    First I've Add The Sound File To a Package In NetBeans 6.1
    And Then Called The Sound From The Package And The Program Runs Okay Then I Made The jar
    and after making the jar now i have to call the sound file from the jar by the code mentioned above
    i used it and run the program it run okay but when i try to open the jar i hear no sound????????????
    I Don't know whyyyyyyyyy This seems to indicate that your app is finding the mp3 file. You would probably get a null pointer exception if the file wasn't found. Something else seems to be going on.
    -How are you launching the jar outside of NetBeans?...By Double Click On It
    I suggest trying to launch the jar using the command promptjava   -cp   YourJarFile.jar  YourMainClassAnd if that works, try java   -jar   YourJarFile.jarAnd if that works, your computer's file association is not set up correctly.

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

  • Load library from JAR file

    Could I ask you guys a stupid question, please?
    I have a library as an JAR file. I build my application as another JAR file, which includes that library file.
    My manifest file is:
    Manifest-Version: 0.1.0
    Class-Path: lib/mysql-connector-java-3.0.17-ga-bin.jar
    Main-Class: com.myappand the build command:
    jar cvfm hello.jar mymanifest -c com  -c libThe result hello.jar file built OK. But when I run it, I have to copy library file to the same folder to the app file.
    Could you tell me how to load the lib file from hello.jar, instead of the lib file?
    Thanks in advance!
    Best regards,
    Lehoanq

    am I right in thinking you've put the mysql jar inside your application jar? jars don't work like that, I'm afraid. it is possible to write a classloader that will load classes from within a jar-inside-a-jar, but it gets rather complicated and messy and isn't worth the hassle to be honest, anyway. we go to some lengths to keep our software modular and separate. imagine, for instance, that a bug is exposed in the mysql driver you're using, and a new release is needed to fix it. the dependency is rooted inside your application, so the whole shebang has to be re-packaged and re-deployed, whereas if your dependencies were inside a lib folder, all that would be needed is to drop the new version of the mysql driver into the lib directory. think "don't put all your eggs in one basket"
    what you want to do is possible, and there are tools around to do it for you, too, but IMHO it's not worth the effort

  • Loading icons from jar file

    Hello,
    i am trying to load ALL imagefiles from my jar file. i do the following:
    Class clazz = Class.forName("com.xxx.IconSelectionDialog");
    String me = clazz.getName().replace(".", "/") + ".class";
    dirURL = clazz.getClassLoader().getResource(me);
    if (dirURL.getProtocol().equals("jar")) {
    String jarPath = dirURL.getPath().substring(6, dirURL.getPath().indexOf("!")); //strip out only the JAR file
    JarFile jar = new JarFile(jarPath );
    Enumeration<JarEntry> entries = jar.entries(); //gives ALL entries in jar
    while (entries.hasMoreElements()) {
    JarEntry nextEntry = entries.nextElement();
    String jarEntryName = nextEntry.getName();
    this works fine with my debug local jws installation. when i try to run it online starting i get an error:
    java.io.FileNotFoundException: xentis.jar (Das System kann die angegebene Datei nicht finden)
         at java.util.zip.ZipFile.open(Native Method)
         at java.util.zip.ZipFile.<init>(ZipFile.java:114)
         at java.util.jar.JarFile.<init>(JarFile.java:133)
         at java.util.jar.JarFile.<init>(JarFile.java:70)
    how can i load ALL icons from a jar (without knowing the filename) ?
    is there a generic way to iterate over all entries of a jarfile ?
    thank you
    michael

    Look at "Loading Images Using getResource" on this page
    http://java.sun.com/docs/books/tutorial/uiswing/components/icon.html
    It should provide some ideas.

  • PJC - Loading Images from JAR Files

    I'm developing a PJC class that involves loading images. I would like to be able to find and use an image contained in a JAR file just like the built-in Forms items do; not the JAR file where my class is contained but any external ones defined in the server archive settings.
    I have seen the loadImage method in the demo RolloverButton class but this only loads images from the class's JAR and not any others.
    Is there a VButton method or an Oracle loader class for finding image resources from the defined JAR archives? If not, could someone supply some code for achieving this.
    Thank you.

    Hi,
    the jar file name the images are in shouldn't matter for the code as long as the package name is preserved. If you want to see it with your own eyes, do the following
    1. Back up demo90.jar
    2. Create a copy of it and call it demo90img.jar
    3. Open demo90.jar in winzip and remove all images
    4. Open demo90img.jar and remove all Java classes
    5. add ,/forms90demo/jars/demo90img.jar to the archive_jini tag of a demo you want to test this on
    6. Run the application and see the images despite the fact they are now in a separate jar file. Note in the Jinitiator console that the new jar files are downloaded and replace the existing, cached, jars
    7. Run an application that doesn't have demo90img.jar configured to see that the images are missing.
    Frank

  • Loading images from jar file

    i use the instruction below to load image contained in my jar file for distribution application but the image doesn't appear
    icon = new ImageIcon("images/logo_tunisiana.GIF");
    the jar file contain the image under a subdirectory called images.
    Witch code sample have i to use ?
    thanks in advance

    I have an applet that is packaged in a jar file with images. I can access the images using:
    aIcon = new ImageIcon(KeyboardApplet.class.getResource("images/keyimages/a.jpg"));

  • How to load class from jar file dynamically?

    After I run my Java applicatoin, I need configuring the classpath of jvm to load some classess inside a jar file into the same jvm.How can I achive that?
    I mean, when I run my Java application, I don't know where the jar file is, what the jar file name is. All depends on the user to tell the jvm the details through some UI. I've tried to write: System.setProperty("java.class.path", "c:\myClass.jar");Class.forName("MyClass"); but failed.
    Can you tell my why and how?
    Thx

    After I run my Java applicatoin, I need configuring
    the classpath of jvm to load some classess inside a
    jar file into the same jvm.How can I achive that?
    I mean, when I run my Java application, I don't know
    where the jar file is, what the jar file name is. All
    depends on the user to tell the jvm the details
    through some UI. I've tried to write:
    System.setProperty("java.class.path",
    "c:\myClass.jar");Class.forName("MyClass"); but
    failed.That won't work. By the time it gets to your code it already has a copy of the original. You can't change it (short of modifying the JVM.)
    Can you tell my why and how?The usual way is to use a custom classloader.
    You can start by looking at java.net.URLClassLoader.

  • Problem loading image (from JAR)

    Hi
    I was wondering why this code works when running the app in my IDE, but not once exported in a JAR file:
    public static BufferedImage loadDefaultCover()
              try
                   return ImageIO.read(new File("./images/default.png"));
              }catch(IOException e)
                   logger.severe("Failed loading default img: "+e.getMessage());
              return null;
         }     NOTE 1: The cover is located (project root)/images/default.png
    NOTE 2: It works when I have a folder named images (with the image in it) next to the JAR.
    NOTE 3: I tried:
    return ImageIO.read(new File("images/default.png"));
    return ImageIO.read(new File("/images/default.png"));Any ideas? Thanks!
    Andrew
    Edited by: Andrew_ on Jan 4, 2009 12:45 PM

    You can't use File references to access resources in a jar file (technically, they are not presen in the file system but part of a zip file). Instead, you can load those resources via the classloader:
    return ImageIO.read(getClass().getClassLoader().getResourceAsStream("images/default.png"));

  • Unable to load classes from jar files inside APP-INF/lib in EAR.

    Weblogic version: 10.3.3
    Platform: Linux x86-64 bit
    We deployed an ear packaged with all the common library jars inside APP-INF/lib. Deployment was successful.
    for some reason, it is always giving ClassNotFoundException for the classes inside the jars. This does not happen
    in 10.3.2 version of weblogic.
    We tried to add them to domain/lib directory (instead of APP-INF/lib) but still it is not able to resolve the classes.
    Any pointers would be appreciated.

    try using prefer-web-inf-classes in the weblogic.xml file in your WAR file
    or using prefer-application-packages in the weblogic-application.xml file in your EAR.

  • Please have a look at this, problem loading images from jar.

    I made a post at the wrong place..
    Pleae have a look at it:
    http://forum.java.sun.com/thread.jsp?forum=422&thread=434524&tstart=0&trange=15

    Answer (hopefully not totally useless) posted over there.

Maybe you are looking for

  • Help! Deleted my sister's music while trying to use Senuti -

    Hi - I did something very stupid last night, and want to try to rectify it, if I can. My sister (ibook G4, 30 gig hard drive) and I have just started a garage band of sorts, and we each work on songs on our own computers. I thought it would be neat i

  • Miro debit memo - return to vendor

    HI, is it posible to define output for debit memo like output for rduction invoice (vendor error)? the issue is that we want to use in standart Return to Vendor process and with invoice verification process to take out output with debit memo to the v

  • Adobe flash update will not install because unable to end firefox process

    Adobe attempts to update flash for firefox 4 but says firefox is running and unable to install even when firefox is closed. attempted to end resident start-up firefox process which previously solved the problem but windows task manger says access is

  • I own the Adobe Suite. How do I build a form?

    I own the Adobe Suite already (including Acrobat) and I would like to build a form. Do I have to pay an additional fee to do this? If not, how do I create a form?

  • Serie 60 bug?

    I'm triing to do a race game in 3d using jsr184 it's run fine on most phones but when try to run it on serie 60 emulator the game runs but at the end of the screen appears a white line. On the others games i test it runs well, any idea?