Jar files loading in memory

I have questions
1. Are the jar files specified in classpath of a java program loaded in memory at the jvm startup ?
2. If all the jar files of classpath are not loaded in memory at startup, then say a class pack1.MyClass needs to be loaded (instantiated) from a jar file say myclasses.jar - in such a case, will myclasses.jar be loaded in memory and remain loaded till the jvm process is on ? Or myclasses.jar is loaded, the class file is extracted and then the jar file is unloaded ?

jschell wrote:
anurag.kapur wrote:
1. Are the jar files specified in classpath of a java program loaded in memory at the jvm startup ?
No. Only class files are loaded in memory.
2. If all the jar files of classpath are not loaded in memory at startup, then say a class pack1.MyClass needs to be loaded (instantiated) from a jar file say myclasses.jar - in such a case, will myclasses.jar be loaded in memory and remain loaded till the jvm process is on ?
Only packk1.MyClass would be loaded in the JAVA heap. Not the JAR file.
However there is no guarantee that the Class file remains loaded for the entire life cycle of the JVM process. Depending on the heap size available classes may be unloaded in a Garbage Collection cycle to make room of new Classes.
Wrong. A class can not be unloaded unless the the class loader is collected by the GC. That means that a Class can actually be unloaded! That's what I said!
The GC will not collect any class, normal java.lang.Class or class loader with active references even if the VM runs out of memory.True. Classes in perm gen and objects in the new and tenured generations get collected/unloaded only when they have no active references and there is a need for a collection cycle. Thats obvious. Did I actually ever say that a class would get unloaded even if it has an active reference? All I meant to say was that there is a possibility that a class gets unloaded and doesn't remain in the Heap for the entire lifecycle of the JVM.
Am I actually getting anything wrong here? Please explain if so.
Thanks
Anurag

Similar Messages

  • How to get list of jar files loaded by servlet container.

    Hi,
    I need to display in my servlet program about the list of jar files loaded by servlet container. Does it vary for each servlet container or is it same. Where can I get those details.
    I need to write code to support tomcat 4x, iplanet 5.0 and websphere 6.0.
    Thanks & Regards,
    Nasrin.N

    For curious, here are output prints for all 3 methods:
    1) parsing system property
    2) tschodt
    3) overcast SystemClassLoader to URLClassLoader
    /home/espinosa/workspace/jboss_embedded_test1/target/test-classes
    /home/espinosa/workspace/jboss_embedded_test1/target/classes
    /opt/javalibs/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar
    /opt/javalibs/javax/jms/jms/1.1/jms-1.1.jar
    /opt/javalibs/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
    package com.sun.org.apache.xerces.internal.impl.validation, Java Platform API Specification, version 1.6
    package com.thoughtworks.qdox.directorywalker
    package com.sun.org.apache.xerces.internal.parsers, Java Platform API Specification, version 1.6
    package java.util.jar, Java Platform API Specification, version 1.6
    package org.testng.internal.thread
    package com.sun.org.apache.xerces.internal.util, Java Platform API Specification, version 1.6
    package java.net, Java Platform API Specification, version 1.6
    package sun.reflect.misc, Java Platform API Specification, version 1.6
    package esp.ejb.samples1.test
    package sun.security.provider, Java Platform API Specification, version 1.
    file:/home/espinosa/workspace/jboss_embedded_test1/target/test-classes/
    file:/home/espinosa/workspace/jboss_embedded_test1/target/classes/
    file:/opt/javalibs/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar
    file:/opt/javalibs/javax/jms/jms/1.1/jms-1.1.jar
    file:/opt/javalibs/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
    ...Interestingly, method 1 and 3 gives the same list, same order, same count, just format of item is a little bit different. The order is same as in Eclipse .classpath file.
    Method 2 (tschodt) give significantly more items! rougly 3x! Different order (somewhat random it seems to me). Some items contain extra information, like version and string "Java Platform API Specification".
    It prints not absolute paths but logical Java names.

  • How to list the JAR files loaded into the Oracle Database ?

    How to list the JAR files loaded into the Oracle Database ?

    From 11.1 onwards, the below two views are available to identify the jar files loaded into the Database.
    JAVAJAR$
    JAVAJAROBJECTS$
    By querying the JAVAJAR$ view you can know information about the JAR files loaded into the Database and using JAVAJAROBJECTS$ view you can find all the java objects associated with the given JAR file.
    These views are populated everytime you use LOADJAVA with "-jarsasdbobjects" option to load your custom java classes.
    But unfortunately this feature is available only from 11.1 onwards and there is no clear workaround for above in 10.2 or earlier.

  • Why does [i]entire[/i] rt.jar get loaded into memory?

    We're developing under JDK 1.4-beta2 and are close to releasing to in-house use of our application. One thing noticed is that the entire rt.jar and other jars get loaded into memory equalling ~45MB !! I am amazed if this is 'normal' behaviour. Are we missing some tweak or option grossly obvious or well known?
    Even a simple Hello World test program loads in the entire rt.jar.
    HELP!!

    cross post
    http://forum.java.sun.com/thread.jsp?thread=184491&forum=37&message=588369

  • Access jar file from in-memory classes...

    I have some classes that I compile to memory and everything works fine until one class that must access some external jar files. I have been unable to access those jar files from disk after trying every suggestion using URLClassLoader. I even tried someone's example to hack the SystemClassLoader which properly adds the jar file paths, but still they can't be seen. The only way it works is if I put the files in the jdk/jre/lib/ext directory. Then everything works fine. There must be a way to load the jar files in memory as well as the class files so they can be accessible. Has anyone done anything like this? Is it possible? Even though the class files are in memory, why would the jar files not be seen even when they are added to the same URLClassLoader's URL's. Thanks.

    Sorry that wasn't clear. What I mean is that the classes are compiled to byte code directly to memory and no physical .class file is created. Yes, I'm using my own ClassLoader that extends URLClassLoader and I'm setting the parent to ClassLoader.getSystemClassLoader(). I also should mention that I'm doing this inside a Netbeans module that is part of a Netbeans Platform application. I don't know why that should matter though, since I'm trying to do everything in memory without creating the physical files. Thanks.

  • Replacing JAR files loaded by custom ClassLoader

    Hi all,
    I am trying to create an auto-updater for a stand alone application, which can look for new versions of relevant jar files on the internet and download them. I have code which will look for newly downloaded versions and can replace the old jar file with the new one (using simple File methods). This works fine for when the application is started initially, but as the application is a server and may not manually be started for a long time, I am trying to force the server to restart and reload with the new code.
    if(newCode.exists()) {
         System.out.println("new code!");
         if(oldCode.exists()) {
              oldCode.delete();
         if(code.exists()) {
              if(! code.renameTo(oldCode)) {
                        throw new IOException("Error backing up code file");
         if(! newCode.renameTo(code)) {
              throw new IOException("Error installing new code file");
    }I have looked around the forums a bit, and have come up with using a ClassLoader based on URLClassLoader:
    class ProxyLoader extends URLClassLoader
         public ProxyLoader(String jarFile) throws MalformedURLException {
              super(new URL[] { (new File(jarFile)).toURL() });
         public Class findClass(String name) throws ClassNotFoundException {
              System.out.println("Finding: " + name);
              return super.findClass(name);
    }This seems to work OK, as all the classes from the jar file are loaded by this classloader.
    I have a method which can create an instance of the class loader, and load the server application.
    private boolean startProxy(int port) {
         try {
              pl = new ProxyLoader("proxy.jar");
              Class ptClass = pl.loadClass("proxy.POPThread");
              pt = ptClass.newInstance();
              Method ptStart = ptClass.getMethod("start", new Class[0]);
              ptStart.invoke(pt, new Object[0]);
              return true;
         } catch(Exception e) {
              return false;
    }I also have a method to shut down the server:
    private boolean stopProxy() {
         try {
              Class ptClass = pl.loadClass("proxy.POPThread");
              Method ptInterrupt = ptClass.getMethod("interrupt", new Class[0]);
              ptInterrupt.invoke(pt, new Object[0]);
              return true;
         } catch(Exception e) {
              return false;
    }These appear to be working fine, the problem I have however is when I try to rename the existing jar file (proxy.jar) in order to replace it with a new one (proxy.new), the renameTo method on the File object fails. I am guessing that is because the proxy.jar file is still in use by the JVM. I have tried setting the classloader var to null, but this doesnt seem to have any effect.
    My main question is how can I 'free' the jar file so that it can be replaced with new code? Is it possible? My only otherway of working around this is to have a variable stored in a file pointing at the 'current' code, but the jar file isn't litterally replaced.
    This is a standalone application, which will probably run in a startup script on a server, so webstart isn't really an option.
    TIA
    iklesteve

    I have found this to be true anytime I try to use the renameTo() API to rename a file with a .jar file extension (regardless of the actual file type - i.e. it could be a text file with .jar appended and it will still fail) in the case where the class making the renameTo() call is loaded from another .jar file.
    I run the same exact code after extracting from the .jar, then the rename to the other .jar file is successful. Also, if I rename the .jar file to a ".ja" file, I can successfully rename the jar file even if the code is running with the context of another .jar file.
    Is this some kind of bogus security measure within the JVM or is it a bug?

  • Can't execute a main class with jar file loaded on command line

    Hello Guys,
    I try to use the following command to execute a main metod from msword class.
    java -cp f60all.jar:jacob.jar msword
    and i receive:
    Exception in thread "main" java.lang.NoClassDefFoundError: msword
    If i extract the 2 jar files then i can execute the main metod:
    java msword
    Can anyone explainme whet is happening ?
    Thanks,
    /Marian

    Hi!
    You need to include the directory where your class is in your classpath... you can use for this the "."
    So, you should write something like
    java -cp .;f60all.jar;jacob.jar msword
    and this supposing that "f60all.jar", "jacob.jar" and "msword.class" are all in the same directory from which you are trying to run the program... in other case write the full paths for the files...
    Bye!

  • Problem with jar file & loading manifest file

    Hi Friends
    i developing one application using java Swing
    i deploying the whole application using the jar Utility.
    but while installing & deploying this application on my machine & on the another machine error occured
    which showing that failed to load manifestfile from main module Or Main class.
    why this is happen? any other Java settings OR changing in java settings of the machine required while deploying this application on the other machine
    please guide me.

    Show the contents of the manifest file,
    and what command you used to run the program,
    and what directory you ran the command from.
    and what's the current classpath setting (if any).

  • Include an in-memory jar file for JSR-199 compilation

    I want to compile a source file in memory, which requires a jar file that is also represented in memory. I used the JavaSourceFromString class recommended in the documentation for the class JavaCompiler and in a demo I found online that shows how to compile sources represented as String in memory. To represent the jar file, I used a similar trick to JavaSourceFromString:
    public class JarJavaFileObjectFromByteArray extends SimpleJavaFileObject {
       * The contents of this jar file.
      private final byte[] contents;
       * Constructs a new JarJavaFileObjectFromByteArray given the name and binary
       * contents of a jar file.
       * @param name the name of this jar file
       * @param contents the contents of this jar file
      public JarJavaFileObjectFromByteArray(String name, byte[] contents) {
        super(newURI(name), Kind.OTHER);
        this.contents = contents;
      ... // code not shown ensures that the URI returned from newURI is of the form,
          // for instance, bytes:///MathConstants.jar, if the name of the jar file is MathConstants.jar
      @Override
      public InputStream openInputStream() throws IOException {
        return new ByteArrayInputStream(contents);
    }However, I do not know how to alert the compiler that this jar file should be on the classpath. I tried this:
    List<String> options = Arrays.asList(" -classpath bytes:///MathConstants.jar ");
    CompilationTask task = compiler.getTask(null, fileManager, null, options, null, compilationUnits);but I get the following error when calling getTask:
    java.lang.IllegalArgumentException: invalid flag: -classpath bytes:///MathConstants.jarI assume there is some way to tell the compiler, "look at the MathConstants.jar file that I am storing in memory when searching the classpath", but I do not know how to do this. I assumed that the options parameter for getTask represents command-line flags that would be passed to the compiler if this were happening on the command line (such as "-cp .", which also does not work), but perhaps this assumption is wrong.

    Hi Bruce,
    I have a question regarding loading a jar file by the compiler to dynamically compile with a source file. I hope you can probably offer me an idea on what has been missing or wrong with the source codes I have written for my application.
    I am using Eclipse compiler to dynamically compile a class. In the class, I want it to make a reference to a jar file for compilation dynamically.
    Here is the source of a test class I wrote:
    import javax.servlet.http.HttpServlet;
    class MyServlet extends HttpServlet {
    }The import statement refers to the class javax.servlet.http.HttpServlet from the jar file C:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\lib\\servlet-api.jar placed in the file system.
    In the method called compileClass (shown below), I used the path of the jar file to add to the option -classpath as you suggested.
         private static CompileClassResult compileClass(Writer out, String className, String classSource) {
              try {
                   JavaCompiler javac = new EclipseCompiler();
                   StandardJavaFileManager sjfm = javac.getStandardFileManager(null, null, null);
                   SpecialClassLoader scl = new SpecialClassLoader();
                   SpecialJavaFileManager fileManager = new SpecialJavaFileManager(sjfm, scl);
                   List<String> options = new ArrayList<String>();
                   options.addAll(Arrays.asList("-classpath", "C:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\lib\\servlet-api.jar"));
                   List<MemorySource> compilationUnits = Arrays.asList(new MemorySource(className, classSource));
                   DiagnosticListener<JavaFileObject> diagnosticListener = null;
                   Iterable<String> classes = null;
                   if (out == null) {
                        out = new PrintWriter(System.err);
                   JavaCompiler.CompilationTask compile = javac.getTask(out, fileManager, diagnosticListener, options, classes, compilationUnits);
                   boolean res = compile.call();
                   if (res) {
                        //Need to modify the api to return an array of two elements - one classes and other bytecodes for all classes in the same class file.
                        return CompileClassResult.newInstance(scl.findClasses(), scl.findByteCodes());
              } catch (Exception e) {
                   e.printStackTrace();               
              return null;
         }I also extended the class ForwardingJavaFileManager as you suggested and have it delegated to the StandardJavaFileManager sent to the compiler mentioned in the method compileClass above. The extended class (called SpecialJavaFileManager) is as follows:
    public class SpecialJavaFileManager extends ForwardingJavaFileManager<StandardJavaFileManager> {
         private SpecialClassLoader xcl;
         public SpecialJavaFileManager(StandardJavaFileManager sjfm, SpecialClassLoader xcl) {
              super(sjfm);
              System.out.println("SpecialJavaFileManager");
              this.xcl = xcl;
         public JavaFileObject getJavaFileForOutput(Location location, String name, JavaFileObject.Kind kind, FileObject sibling) throws IOException {
              System.out.println("getJavaFileForOutput");
              MemoryByteCode mbc = new MemoryByteCode(name);
              xcl.addClass(name, mbc);
              return mbc;
         public Iterable<JavaFileObject> list(JavaFileManager.Location loc, String pkg, Set kinds, boolean recurse) throws IOException {
              System.out.println("list ");
            List<JavaFileObject> result = new ArrayList<JavaFileObject>();
            for (JavaFileObject f : super.list(loc, pkg, kinds, recurse)) {
                 System.out.println(f);
                result.add(f);
              return result;
    }I run the application and the result shows that it didn't load the jar file into the memory as expected. From the output (below) I got, it doesn't seem to invoke the method list(...) in the class SpecialJavaFileManager.
    SpecialJavaFileManager
    1. ERROR in \MyServlet.java (at line 1)
         import javax.servlet.http.*;
                ^^^^^^^^^^^^^
    The import javax.servlet cannot be resolved
    2. ERROR in \MyServlet.java (at line 3)
         class MyServlet extends HttpServlet {
                                 ^^^^^^^^^^^
    HttpServlet cannot be resolved to a typeWould you please let me know what has possibly be missing or wrong?
    Thanks.
    Jonathan
    Edited by: jonathanlam on Aug 10, 2009 6:47 PM

  • How to load jar file in one shot?

    I have a Java app refers some jar files on remote location. Loading class by class is very time consuming.
    Is it possible to load the jar files as a whole? like what applet does?
    Tried URLClass loading, even run java -jar, still those load class on demand.
    I want the jar file loaded only one time into JVM.

    I don't really understand. When you load a jar file using URLClassLoader it brings over the jar file and extracts the class files from the jar file. It does not bring over the class files as individual class files. If you mean you want to only ever bring over the jar file once then why not just copy the jar file using URLConnection and save it to disk. You can then load the jar file from disk each time the program starts.

  • How to dynamically load jar files - limiting scope to that thread

    Dynamically loading jar files has been discussed a lot. I have read a quite a few posts, articles, and demo code for doing just that. However, I have yet to find a solution to my problem. Most people modify their system class loader and are happy. I have done that and was happy for a time. Occasionally, you will see reference to an application server or tomcat or some other large project that have successfully been able to load and unload jar files, allow for dynamic deployment of code, etc. However, I have not been able to achieve similar success; And my problem is much less complicated.
    I have an application that executes a thread to send a given file/message to a standard JMS Server Queue. Depending on the parameters selected by the user, this thread may need to communicate with one of a number of JMS Servers, ie. JBoss, WebLogic, EAServer, Glassfish, etc. All of which can be done with the same code, but each needs to load their own flavor of JMS Client Jar files. In this instance, spawning a separate JVM for each communication would work from a classloader perspective. However, I need to keep it in the family and run under the same JVM, albeit each JMS Server Connection will be created and maintained in separate Threads.
    I am close, I am doing the following...
    1. Creating a new URLClassLoader in the run() method of each thread.
    2. Set this threads contextClassLoader to the new URLClassLoader.
    3. Load the javax.jms.JMSException class with the URLClassLoader.loadClass() method.
    4. Create an initialContext object within this thread.
    Note: I read that the initialContext and subsequent conext lookup calls would use the Thread�s
    contextClassLoader for finding/loading classes.
    5. Perform context.lookup calls for a connectionFactory and Queue name.
    6. Create JMS Connection, etc. Send Message.
    Most of this seems to work. However, I am still getting a NoClassDefFoundError exception for the javax.jms.JMSException class ( Note step #3 - tried to cure unsuccessfully).
    If I include one of the JMS Client jar files ( ie wljmsclient.jar for weblogic ) in the classpath then it works for all the different JMS Servers, but I do not have confidence that each of the providers implemented these classes that now resolve the same way. It may work for now, but, I believe I am just lucky.
    Can anyone shine some light on this for me and all the others who have wanted to dynamically load classes/jar files on a per Thread basis?

    Thanks to everyone - I got it working!
    First, BenSchulz' s dumpClassLoader() method helped me to visualize the classLoader hierarchy. I am still not completely sure I understand why my initial class was always found by the systemClassLoader, but knowning that - was the step I needed to find the solution.
    Second, kdgregory suggested that I use a "glue class". I thought that I already was using a "glue class" because I did not have any JMSClient specific classes exposed to the rest of the application. They were all handled by my QueueAdmin class. However...
    The real problem turned out to be that my two isolating classes (the parent "MessageSender", and the child "QueueAdmin") were contained within the same jar file that was included in the classpath. This meant that no matter what I did the classes were loaded by the systemClassLoader. Isolating them in classes was just the first step. I had to remove them from my jar file and create another jar file just for those JMSClient specific classes. Then this jar file was only included int custom classLoader that I created when I wanted to instantiate a JMSClient session.
    I had to create an interface in the primary jar file that could be loaded by the systemClassLoader to provide the stubs for the individual methods that I needed to call in the MessageSender/QueueAdmin Classes. These JMSClient specific classes had to implement the interface so as to provide a relationship between the systemClassLoader classes and the custom classLoader classes.
    Finally, when I loaded and instantiated the JMSClient specific classes with the custom classLoader I had to cast them to the interface class in order to make the method calls necessary to send the messages to the individual JMS Servers.
    psuedu code/concept ....
    Primary Jar File   -  Included in ClassPath                                                      
    Class<?> cls = ClassLoader.loadClass( "JMSClient.MessageSender" )
    JMSClientInterface jmsClient = (JMSClientInterface) cls.newInstance()                            
    jmsClient.sendMessage()                                                                      
    JMSClient Jar File  -  Loaded by Custom ClassLoader Only
    MessageSender impliments Primary.JMSClientInterface{
        sendMessage() {
            Class<?> cls=ClassLoader.loadClass( "JMSClient.QueueAdmin" )
            QueueAdmin queueAdmin=(QueueAdmin) cls.newInstance()
            queueAdmin.JMSClientSpecificMethod()
        }

  • Why is ENTIRE rt.jar loaded into memory?!?!?

    We're developing under JDK 1.4-beta2 and are close to releasing to in-house use of our application. One thing noticed is that the entire rt.jar and other jars get loaded into memory equaling ~45MB !! I am amazed if this is 'normal' behaviour. Are we missing some tweak or option grossly obvious or well known?
    Even a simple Hello World test program loads in the entire rt.jar.
    HELP!!

    cross post
    http://forum.java.sun.com/thread.jsp?thread=184491&forum=37&message=588369

  • ImageIcon not loading from Jar file

    Hi,
    I'm developing an application that uses ImageIcons in JButtons.
    The images are stored in the following relative dir:
    images/<filename>.jpg
    They load fine when I run the application from class files in the appropriate directory.
    However when I jar everything, my ImageIcons don't load.
    I know that my jar file is in the classpath, because other items in the jar file load successfully.
    I've tried everything the related threads recommend, but still nothing.
    When I try to launch from the jar file, the ClassLoader.getResource("filepath"); returns null.
    Whereas when I launch the class files, it returns the correct URL for the image.
    What am I missing? Is this jar file security-related? Do I need to sign the jar file with all-permissions?
    Any suggestions would be gratefully appreciated.
    I'm using java 1.4.2_01-b06
    Much thanks,
    -Jeroen

    Here is a little load program that you can use.
    import java.io.*;
    import java.util.*;
    import java.util.zip.*;
    * <p>Resources extracts all the resources from a jar file into binary large
    * objects. These objects can be used to create images or read as streams.
    * This class is implemented as a singleton model.</p>
    * <p>An attempt is made to find the path to the jar file in
    * if this file is not found no resources are
    * loaded.
    * @author Michael Couck
    * @version 1.00, 16/01/2004
    public final class Resources extends Constants {
          * The only instance of this class
         private static Resources resources;
          * Hashtables for the sizes of the entries in the jar
         private static Hashtable sizes= new Hashtable();
          * Hashtable for each entry in the jar as a blob
         private static Hashtable contents= new Hashtable();
          * Flag to test if the resources were loaded correctly
         private static boolean resourcesLoaded= false;
          * Initilises the <code>static</code> instance of the
          * <code>Resources</code> instance.
         public static void initiliseResources() {
              if (resources == null)
                   resources= new Resources();
          * Instanciates a <code>Resources</code> object.
         private Resources() {
              init();
          * Returns a resource as a <code>byte</code> array, which can then be used
          * as a <code>ByteArrayInputStream</code> to instanciate among other things
          * images and property files.
          * @param name a resource name. This is the path to the recource from the
          *         root of the jar file.
         public static byte[] getResourceAsByteArray(String name) {
              if (resources == null)
                   resources= new Resources();
              return (byte[]) Resources.contents.get(name);
          * Returns true if the resources were correctly loaded
         public static boolean resourcesLoaded() {
              return resourcesLoaded;
          * Reads the jar file and inserts the contents
          * into the Hashtables.
         public void init() {
              try {
                   //Sizes into the table     
                                                                    File jar= new File("[path to]/yourjar.jar");
                   if (jar != null && jar.exists()) {
                        //Found the path to this jar file
                        ZipFile zipFile= new ZipFile(jar);
                        Enumeration enum= zipFile.entries();
                        while (enum.hasMoreElements()) {
                             ZipEntry zipEntry= (ZipEntry) enum.nextElement();
                             sizes.put(
                                  zipEntry.getName(),
                                  new Integer((int) zipEntry.getSize()));
                        zipFile.close();
                        //Contents into the table
                        FileInputStream fis= new FileInputStream(jar);
                        BufferedInputStream bis= new BufferedInputStream(fis);
                        ZipInputStream zis= new ZipInputStream(bis);
                        ZipEntry zipEntry= null;
                        while ((zipEntry= zis.getNextEntry()) != null) {
                             if (zipEntry.isDirectory()) {
                                  continue;
                             int size= (int) zipEntry.getSize();
                             // -1 means unknown size.
                             if (size == -1) {
                                  size=
                                       ((Integer) sizes.get(zipEntry.getName()))
                                            .intValue();
                             byte[] blob= new byte[(int) size];
                             int readBuffer= 0;
                             int buffer= 0;
                             while (((int) size - readBuffer) > 0) {
                                  buffer=
                                       zis.read(blob, readBuffer, (int) size - readBuffer);
                                  if (buffer == -1) {
                                       break;
                                  readBuffer += buffer;
                             contents.put(zipEntry.getName(), blob);
                        resourcesLoaded= true;
              } catch (NullPointerException e) {
                   Constants.logger.severe(e.getMessage());
                   StackTraceElement[] stackTrace= e.getStackTrace();
                   for (int i= 0; i < stackTrace.length; i++) {
                        Constants.logger.severe(stackTrace.toString());
                   resourcesLoaded= false;
              } catch (FileNotFoundException e) {
                   Constants.logger.severe(e.getMessage());
                   StackTraceElement[] stackTrace= e.getStackTrace();
                   for (int i= 0; i < stackTrace.length; i++) {
                        Constants.logger.severe(stackTrace[i].toString());
                   resourcesLoaded= false;
              } catch (IOException e) {
                   Constants.logger.severe(e.getMessage());
                   StackTraceElement[] stackTrace= e.getStackTrace();
                   for (int i= 0; i < stackTrace.length; i++) {
                        Constants.logger.severe(stackTrace[i].toString());
                   resourcesLoaded= false;
    } //End Resources
    You can get the icons with "new ImageIcon(new ByteArrayResources.getResourceAsByteArray(String name));
    See ya
    Michael

  • How do I install a JAD & associated JAR file on a ...

    Hi all,
    I have a Nokia 6288 which I would like to install a signed application in the form of a signed JAD and accompanying JAR file.
    I need the JAD because it is a signed application, and I need the phone to recognise this because the application accesses user data from the memory card.
    I have tried:
    1. Using PC Suite. It does not recognise JAD files.
    2. Copying the signed JAD & the JAR file onto my memory card. The phone does not recognise JAD files. I can use the JAR file fine but it isn't fully functional.
    3. Installing the JAD file from a WAP service by pointing my phones web browser directly to the JAD file online. It downloads and installs, but again, fails to be fully functional.
    So at the moment I am stuck as although I can install the JAR by itself, the application is then not signed, and will not work because it cannot access the memory card.
    Basically, how would I install a signed application (JAD & JAR) onto my Series 40 handset?

    Since my last post I have been discussing this issue with commercial application developers and have been experimenting with various applications.
    Firstly, let's make the JAR/JAD situation absolutely clear. Some, but not all, applications unquestionably require the JAD file as a part of the installation process. If the application is a "signed" application then the security authorisation is contained within the JAD file, not the JAR file. The JAD file is created from the JAR file and contains security verification information that is separate from the JAR file and which enables the application to signed as kosher.
    The Nokia PC Suite Application Installer does not need to show you the JAD file. The JAR file is sufficient. If you install the application from a folder on your PC that contains both the matching JAR and JAD files then Application Installer will correctly install the application from both the JAR and JAD files. If the folder ONLY contains the JAR file then it will only install from the JAR file. I have proved this.
    So, if you cannot get the application to work then the reason is not the installation process. The reason is far more likely to be that you are trying to install the application on a branded handset rather than on a standard Nokia handset. Some service providers heavily modify the base standard software that Nokia installs on its vanilla handsets and these modifications may well include changes to security authorisation rules that will prevent many applications working on handsets that they sell.
    I am in dispute with one such as we speak. I will not name them right now but if I am unable to achieve a satisfactory outcome then be assured I will let EVERYONE know. Thank God for YouTube.

  • Jar file in applet not saved in internet files when using jdk plugin

    Hello,
    I recently upgarded to jdk1.3.1 and converted our applet and classes to jdk1.3.1 using swing classes. From there, we converted the html file with htmlconverter and diployed this on the web. When a user goes to the web, the system automatically downloads the java plugins and installs them on the clients maching. From there our jar file loads and executes. Our applet runs fine. However, every time our website is accessed, our jar file cookie must be downloaded which is just over 1meg and I know this is not going to fly with our clients.
    What needs to be done so the jar file is not downloaded every time, to work like java version 1.x ?
    Thanks for your help in advance with this one.
    Jay Ford

    Hi Jay Ford,
    Enable the "Recycle Classloader" in Control Panel-->Java Plug-in1.3.1-->Basic.
    The main purpose of this Recycle classloader is it will enable the "javaplugin.classloader.cache.enabled" property to true and it caches the jar files for performance enchancement.
    Hope this will help you.
    Anil.
    Developer Technical Support,
    Sun Microsystems Inc,
    http://www.sun.com/developers/support

Maybe you are looking for

  • PL/SQL Web Service "Preview SOAP" then nothing

    I'm using Jdev 10.1.3 to create a web serv from a PL/SQL procedure. Creating the web serv from wizard goes fine, deployment to OC4J w/in JDev goes fine, getting to the web serv "home page" goes fine. The problem is when I go to test a method, enter p

  • 'BAPI_PO_CREATE1'  Multiple account assignment is not possible for AFS item

    'BAPI_PO_CREATE1'  -> This BAPI works perfectly without the  'account assignment' option . But  for purchase requisitions which have account assignments  BAPI returns the error  - E|8W |185   |Multiple account assignment is not possible for AFS items

  • Popup window question

    Hi, I did a Portal application using JSF and RAD 6.0 in the Portal page I have two portlets side by side the portlet in the right side has a link to open a popup window when I click in that link and the popup window opens the portlet in the left side

  • Regarding SOAP Reciever with WS Security needed to be configured

    HI All,          My Interface is with ABAP Proxy with Webservice, Actually i have got the WSDL of the Web service, when i manually open the target URL which is given in the Web service it is giving me Missisng WSSE Security Header, and same thing i a

  • On which object the "Last data update" is calculated when a query is built

    Can anybody tell me that the information "Last Data Update" (in a  query output) comes from which object ? I want to know the technical details . I know that if a query is built on a Multiprovider, then the "Last Data Update" will show the least load