Add a jar file to an Applet

Hi all,
I'm trying to add a .jar file to my applet using the code:
<applet name=myApplet.class archive=model.jar></applet>
Both the .class and .jar files are in the same directory as test.html
So, when the applet starts an exception is thrown:
java.lang.NoClassDefFoundError: it/bizware/session/interfaces/HardwareLogManagerUtil
     at AppletPistolaL.getHardwareLogManager(AppletPistolaL.java:222)
     at AppletPistolaL.init(AppletPistolaL.java:97)
     at sun.applet.AppletPanel.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)
The model.jar contains the path it/bizware/session.../HardwareLogManagerUtil!
I can't understand why this exception is thrown
Someone can help me?!?!?!
thanks a lot!!

Solved,
just to add all path it/bizware/....
and works!!!!
bye!

Similar Messages

  • How to add a jar file to a project

    I believe I have followed the necessary steps to add a jar file to my project. I have added this jar file as a new library and I see all the classes in it. I have even added it to my SessionBean1.java via the Add ---> Property menu. I noticed that this did not do the import of the class, so I did it myself. I also noticed that it did the drop downs and found the class for me automatically. Specifically, the IDE knows about the class layout and can see my class package as I type it out.
    So far so good....
    I then go to compile the project and I get the error:
    C:\Projects\safe\Safe\src\safe\SessionBean1.java:11: package com.dusa.bo does not exist
    import com.dusa.bo.BackofficePerson;
    Am I missing something? I looked around and it looks to me like the jar file is in the project and it should know about it. Again, I do know that the editor can find it, because as I type import ..... it then list "com" as an option to click on, then if I click on com, it will then list dusa ... and so on.
    Thanks

    I figured this out. Sorry for the post.

  • How to add SDK jar file in NWDS

    Dear Friends,
    Currently i have an issue. I have to bring the BO favorite to my Portal Screen. My Portal is developed in PDK.
    I have few links where the source code is writhen. Those link's are
    /people/michael.nicholls/blog/2010/02/22/using-the-pdk-to-access-businessobjects-infoview
    http://wiki.sdn.sap.com/wiki/display/Snippets/ReadInfoViewfavoritesfromthe+portal
    I don't know more about BO. I have few points which i mentioned below.
    1) How to add SDK jar file in NWDS.
    2)DO i need any specific package for that.
    Kindly help me with your Valuble suggestion and document.
    Thanx in Advance.
    Prashant Krishen

    Hi,
    for adding all the jar files in NWDS fallow below steps
    windows >> preferences >>Java>>Java buildpath>>Libraries>>add external jars
    Hope this helps
    Edited by: polaka123 on Nov 13, 2010 12:44 PM

  • How do I update a file in an Applet's JAR file from the Applet code

    Here's my problem.
    My applet is using a serializable history data in which I am storing in the applet's JAR file. When I run the applet, I read the file with "getResourceAsStream()" and run my program with that hist data. When my applet is closed, I need to update this file from my Applet's code and I dumfounded about how to do that.
    Is there any way to update a file in the Applet's JAR file through the Java Applet code? (i.e. OutputStream?).
    Would appreciate any advice people have.

    Just place a copy of the file on the local hard disk and update that. When you start the Applet you try to read from the hard disk. If the file exists then no problem otherwise copy it from the jar to the hard disk.

  • How to add a Jar file to J2EE Server Component Library ?

    Hello,
    My objective:
    =====================================================
    To add a 3rd party jar file to be a runtime jar file to J2EE Server Component
    Library project.
    I have created a J2EE Server Component Library project. 
    I have built the J2EE Server Component Library project to get the provider.xml file and place the provider.xml under the J2EE Server Component Library project's server folder.
    Here is my problem:
    =====================================================
    I can't open the provider.xml with SAP's special editor for the provider.xml.
    The special SAP editor doesn't exist for me.
    Here is my question:
    =====================================================
    Q1) Do I copy/paste my JAR_X file where <jar_0> is located? (Below is the
          J2EE Server Component Library SDA structure.)
    Q2) If you were to update the provider.xml with notepad, what would you
    type in provider.xml for JAR_X?
    Q3) Is there anything else that I need to do?
    Thanks,
    Steve
    J2EE Server Component Library SDA structure.
    ======================================
    |-META-INF_
    |         |-manifest.mf
    |         |-sap_manifest.mf
    |         |-SearchRules.xml
    |         |-<SDA>.xml
    |         |...
    |-<jar_0>
    |- ...
    |-<jar_N>
    |-dispatcher_
    |           |-provider.xml
    |           |-properties
    |           |-runtime.properties
    |           |-persistent__
    |           |            |-<persistent_files(2)>
    |           |-descriptors_
    |                        |-<descriptor_files(3)>
    |-server_____
    |           |-provider.xml
    |           |-properties
    |           |-runtime.properties
    |           |-persistent__
    |           |            |-<persistent_files>
    |           |-descriptors_
    |                        |-<descriptor_files>
    |-os_libs____
                |-<char set>__
                             |-<platform>__
                                          |-<jvm bitlength>__
                                                            |-<native lib files>

    Thank you for all your solution...
    my provider.xml was missing the <!DOCTYPE> tag for me to use the SAP LibraryDD Editor
    Thanks again,
    Steve
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE provider-descriptor SYSTEM "library.provider.dtd">
    <provider-descriptor>
         <display-name>
          Your_Lib_Name
        </display-name>
         <component-name>
          Your_Lib_Name
        </component-name>
         <major-version>6</major-version>
         <minor-version>40</minor-version>
         <micro-version>0</micro-version>
         <provider-name>
          sap.com
        </provider-name>
         <references>
              <reference
                   provider-name="sap.com"
                   strength="weak"
                   type="library">Your_Lib_Name</reference>
         </references>
         <jars>
              <jar-name>my_jar.jar</jar-name>
         </jars>
    </provider-descriptor>

  • How do I add a jar file into the build path of the compiler?

    Hey,
    I'm trying to import a jar file into the build path of the compilation process, but it does not find the packages or the classes that are in it.
    I think I don't add it right...
              ArrayList<String> options=new ArrayList<String>();
              options.add("-d");
              options.add(targetDirectory);
              options.add("-classpath");
              for(String str:includeDirectory)
                   options.add(str);
              if (!compiler.getTask(writer, fileManager, diagnostics, options, classes, compilationUnits).call());
                    ....and I've tried this way:
         public void setTargetDirectory(String targetDirectory) {
              this.targetDirectory = "-d " + targetDirectory;
         private void compile(Iterable<? extends JavaFileObject> compilationUnits) throws Exception {
              ArrayList<String> options = new ArrayList<String>();
              options.add(targetDirectory);
              String classPath="-cp ";// tried this also with "-classpath"
              for (String str : includeDirectory)
                   classPath+=str+":";
              options.add(classPath);
         if (!compiler.getTask(writer, fileManager, diagnostics, options, classes, compilationUnits).call())
              // throw new Exception("Compilation Error");
         }Thanks in advance,
    Adam.
    Edited by: Adam-Z. on Feb 24, 2010 5:41 AM
    Edited by: Adam-Z. on Feb 24, 2010 5:42 AM

    Thank you for your reply,
    Q: Are there .class files in that directory in that jar file? (the compiler doesn't ( can't )) look for directories, it can just look for specific files , and scan to get a list of all files matching certain criteria. So if there are no class files, it will say the package doesn't exist, even if there is a directory, possibly containing other files.yes there are class files in the jar, the tree structure:
    j2MeDataChunkGenerator_Plugin\(lots of class files)
    META-INF\manifest.mf
    and thats it.
    , your code will only work on windows because other platforms use a different path separator. You should use java.io.File.pathSeparator not explicit ';" when building your classpath. (this is unrelated to your problem, but you should correct it)will do, thanks.
    Q: Is that error in your post formatted by your own diagnostics? (we could possibly help you better if we didn't have to guess!!)I would not post my own error code, this text is generated by the compiler diagnostic.
    {code}
         System.err.println(" Error details: " + diagnostic.getMessage(null));
    {code}
    Q: Is line 3 of ImageCroper_Editor.java (sic) an import statement? (we could possibly help you better if we didn't have to guess!!)it is an import error... didn't the error message stated that it is an import problem? wired, I'm sure before it did. anyway it is an import error.
    Also you don't show us what the variable includeDirectory is in terms of type, and contents, that might be helpful. (we could possibly help you better if we didn't have to guess!!)It has only one String object: "D:\%Important Documents\WorkSpaces\PacMan\ApplicationManager\Plug-in\Data Chunk Designer.jar"
    the last file on the classpath list.
    Q: Have you proven this? that i did post, in this long line of text.
    Q: Is the compiler finding other classes (in other packages) in that same jar file?No. all the class files are in the jar, they all have entries that start with "j2MeDataChunkGenerator_Plugin\*.class", and since I get 47 errors I guess it does not load any other class.
    thank you for you comments, the problem with having these errors, is that I can't even get a piece of information where this error is coming from, only that it is an import loading error package not found, what does that mean? that the jar was not loaded in compilation(no error about this), that the jar is corrupted(no error about this), that the path is incorrect(it is correct I made sure), that there is no such package in the jar(There is), that the compiler does not load the package(does it even do that?), really I can't even guess why this happens, I've been at this on and of all day today, really annoying.
    Thanks,
    Adam.

  • How to add a jar file into resource catalog in webcenter spaces

    Hi All,
    i am new to webcenter spaces. my requirement is like, i have created one adf taskflow and deployed it as a shared library.now i want to register this jar file as a resource catalog into webcenter spaces (i.e. already deployed). How to achieve this task.
    Thanks,
    Monika

    Pls do the foll actions:
    Step 1:
    File -> Import -> Selct radiobutton - "Jar file" -> Next
    -> Select the file name(ur jar file) - > click on the java button and ensure that u have selected all the file or what evre files u want " -> Finish
    If at all u r not getting any errors but the files are not apperaring in ur Project means go to
    Step 2:
    From the work bench click
    Window -> Reposiroy Explorer -> Select the Project,edition,package or type and right click and from the pop up menu click "Add to Workspace"
    This 'd work
    All the best for a successful completion of ur work
    Pramod

  • How to refresh a JAR file in an applet

    Hello All,
    I have an applet whose class files are in a Jar file called classes.jar. The applet also makes use of a JAR file called info.jar, in which there is a text file. The text file contains data which the applet processes.
    While the classes.jar is constant, the text file contents in info.jar varies. But when the applet is reloaded, it still maintains the old info.jar and never refreshes it with the currently available info.jar.
    Is there any way in which I can ask the applet to take the latest info.jar?
    Thanks,
    Sathish

    I guess you have info.jar in your APPLET-tag. Perhaps it also holds .class-files you require?
    I'd say you should break out the text file and have the applet read it via URLConnection instead. That should make it read from the server every time. If there's a size problem you can of course put the text file (alone) into a .jar-file and read that from the applet.

  • How to add a jar file in the visual Age classpath

    I have to import a jar file in visual Age workspace, and don't know hox to do
    I tried several things, but didn't succeded at this point.
    I need to succed until tomorrow for completing my work.
    Please help, thanks.

    Pls do the foll actions:
    Step 1:
    File -> Import -> Selct radiobutton - "Jar file" -> Next
    -> Select the file name(ur jar file) - > click on the java button and ensure that u have selected all the file or what evre files u want " -> Finish
    If at all u r not getting any errors but the files are not apperaring in ur Project means go to
    Step 2:
    From the work bench click
    Window -> Reposiroy Explorer -> Select the Project,edition,package or type and right click and from the pop up menu click "Add to Workspace"
    This 'd work
    All the best for a successful completion of ur work
    Pramod

  • How to handle 2 or more .jar files with an applet

    Hey out there
    I have created an ftpClient application that uses "jakarta ftpClient". It works fine as an JFrame application � But when I converted the Application into an JApplet I get the following Exception:
    java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
    I have bundled the main application into a .jar file (Application,jar). But I don't know how to handle the 2 jakarta .jar files with my JApplet??
    I Tried to append the 2 jakarta .jar files to the Application,jar with the following code:
    jar cvf Application.jar 1.class 2.class�. commons-net-1.4.1.jar jakarta-oro-2.0.8.jar
    But with the same result / Exception (I have signed the Jar file!)
    Can anyone help me

    Hi i have a question with your application can you down- or upload more files at the same time? Because i'm having problems with my ftp application.
    Here is the link with my problem maybe you can help me. I will be very pleased when you can help me.
    http://forum.java.sun.com/thread.jspa?threadID=5162042&tstart=0
    Thx
    Satanduvel

  • Add a jar file to Java load path at run time

    Hi
    I loaded my file successfully , but when I tried to use the driver to connect to the DB , I get
    java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
    Here is my class
    import java.net.URL;
    import java.io.IOException;
    import java.net.URLClassLoader;
    import java.net.MalformedURLException;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.io.*;
    public class JarFileLoader1 extends URLClassLoader
    public JarFileLoader1 (URL[] urls)
    super (urls);
    public void addFile (String path) throws MalformedURLException
    String urlPath = "jar:file://" + path + "!/";
    addURL (new URL (urlPath));
    public static void main (String args[])
    try
    File f = new File("E:\\db2_v9_5 FP5_drivers\\db2jcc.jar");
    System.out.println("%%%% " + f.exists());
    File f1 = new File("E:\\db2_v9_5 FP5_drivers\\db2jcc_license_cu.jar");
    System.out.println("%%%% " + f1.exists());
    File f2 = new File("E:\\db2_v9_5 FP5_drivers\\db2jcc4.jar");
    System.out.println("%%%% " + f2.exists());
    URL urls [] = {};
    JarFileLoader1 cl = new JarFileLoader1 (urls);
    cl.addFile ("E:\\db2_v9_5 FP5_drivers\\db2jcc.jar");
    cl.addFile ("E:\\db2_v9_5 FP5_drivers\\db2jcc_license_cu.jar");
    cl.addFile ("E:\\db2_v9_5 FP5_drivers\\db2jcc4.jar");
    URL url = new File("E:\\db2_v9_5 FP5_drivers\\db2jcc.jar").toURL();
    URLClassLoader clazzLoader = new URLClassLoader(new URL[]url);
    Class clazz = clazzLoader.loadClass("com.ibm.db2.jcc.DB2Driver");
    System.out.println ("Success! --> " + clazz.newInstance().toString());
    String connectString = "jdbc:db2://dummy:34000/dev1";
    System.out.println("BEFORE CONNECTION");
    Connection conn =
    DriverManager.getConnection(connectString,"mario","123123");
    System.out.println("after CONNECTION");
    System.out.println("Driver Version - " + conn.getMetaData().getDriverVersion() + "
    catch (Exception ex)
    System.out.println ("In Exception Block -- Failed.");
    ex.printStackTrace (System.out);
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Here are the logging messages
    %%%% true
    %%%% true
    %%%% true
    Success! --> com.ibm.db2.jcc.DB2Driver@24442444
    BEFORE CONNECTION
    In Exception Block -- Failed.
    java.sql.SQLException: No suitable driver
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:186)
    at com.tdbfg.tdsecurities.kasper.admin.aboutkasper.JarFileLoader1.main(JarFileLoader1.java:61)

    kasper123 wrote:
    Hi
    I loaded my file successfully , but when I tried to use the driver to connect to the DB , I get
    java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
    Here is my class
    import java.net.URL;
    import java.io.IOException;
    import java.net.URLClassLoader;
    import java.net.MalformedURLException;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.io.*;
    public class JarFileLoader1 extends URLClassLoader
    public JarFileLoader1 (URL[] urls)
    super (urls);
    public void addFile (String path) throws MalformedURLException
    String urlPath = "jar:file://" + path + "!/";
    addURL (new URL (urlPath));
    public static void main (String args[])
    try
    File f = new File("E:\\db2_v9_5 FP5_drivers\\db2jcc.jar");
    System.out.println("%%%% " + f.exists());
    File f1 = new File("E:\\db2_v9_5 FP5_drivers\\db2jcc_license_cu.jar");
    System.out.println("%%%% " + f1.exists());
    File f2 = new File("E:\\db2_v9_5 FP5_drivers\\db2jcc4.jar");
    System.out.println("%%%% " + f2.exists());
    URL urls [] = {};
    JarFileLoader1 cl = new JarFileLoader1 (urls);
    cl.addFile ("E:\\db2_v9_5 FP5_drivers\\db2jcc.jar");
    cl.addFile ("E:\\db2_v9_5 FP5_drivers\\db2jcc_license_cu.jar");
    cl.addFile ("E:\\db2_v9_5 FP5_drivers\\db2jcc4.jar");
    URL url = new File("E:\\db2_v9_5 FP5_drivers\\db2jcc.jar").toURL();
    URLClassLoader clazzLoader = new URLClassLoader(new URL[]{url});
    Class clazz = clazzLoader.loadClass("com.ibm.db2.jcc.DB2Driver");
    System.out.println ("Success! --> " + clazz.newInstance().toString());
    String connectString = "jdbc:db2://dummy:34000/dev1";
    System.out.println("BEFORE CONNECTION");
    Connection conn =
    DriverManager.getConnection(connectString,"mario","123123");
    System.out.println("after CONNECTION");
    System.out.println("Driver Version - " + conn.getMetaData().getDriverVersion() + " ");
    catch (Exception ex)
    System.out.println ("In Exception Block -- Failed.");
    ex.printStackTrace (System.out);
    }================================================
    ====================================================
    Here are the logging messages
    %%%% true
    %%%% true
    %%%% true
    Success! --> com.ibm.db2.jcc.DB2Driver@24442444
    BEFORE CONNECTION
    In Exception Block -- Failed.
    java.sql.SQLException: No suitable driver
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:186)
    at com.tdbfg.tdsecurities.kasper.admin.aboutkasper.JarFileLoader1.main(JarFileLoader1.java:61)
    For debugging purposes you could use [DriverManager.getDrivers()|http://download.oracle.com/javase/6/docs/api/java/sql/DriverManager.html#getDrivers%28%29] to get an enumeration of all drivers
    and then output their names.
    Maybe, with the classloader malarkey you are doing
    you need to use [DriverManager.registerDriver(Driver driver)|http://download.oracle.com/javase/6/docs/api/java/sql/DriverManager.html#registerDriver%28java.sql.Driver%29]

  • Help can't add new jar files into BDK beanbox(plz see details)

    I am unable to load new jar files into bdk beanbox inspite of
    packaging bean class file and manifest file in a jar file and
    placing it in bdk jars directory. On trying to load it says(THE JAR
    FILE DOES NOT HAVA ANY BEANS).
    SEE THE EXAMPLE BELOW:
    I made a manifest file BeanTest.mf as
    Name: BeanTest.class
    Java-Bean: True
    Then the BeanTest Class comprises of
    import java.awt.Point;
    public class BrokenProperties extends Point
         public void setSpot(Point point)
              this.x = point.x;
              this.y = point.y;
         public Point getSpot()
              return this;
    Please help....

    you have many little errors in program. try as below and let me know..
    public class BrokenProperties extends Point implements serializable
    private Point xy;
    public BrokenProperties()
    public void setSpot(Point point)
    xy=point;
    public Point getSpot()
    return xy;

  • How to add a jar files to a project in JDeveloper 10g?

    I had created a sample appln using below imports
    import oracle.forms.handler.IHandler;
    import oracle.forms.ui.CustomEvent;
    import oracle.forms.properties.ID;
    import oracle.forms.ui.VBean;
    The above packages are available in frmall.jar only know?
    I tried to add the above jar in JDeveloper IDE (10.1.2.1.0).
    But i can't fild a exact menu in my iDE?
    How to add the above jar through menu?
    Thanks

    1. Select Tools>Project Properties.
    2. In Project properties window select Libraries.
    3. Add a project JAR with Add Jar/Zip button.

  • Unable to load database driver from my applet's jar file

    I'm trying to set up an applet that will talk to a MySQL database. I have no problem connecting to the database as I'm developing the code ("un-jarred"), but when I create a jar file of my code to test through a web browser, I cannot connect to the database due to the usual ClassNotFoundException. I have included mysql-connector-java-3.1.12-bin.jar (the current driver) in the jar, but I don't know if I'm supposed to supply some info through an attribute to the applet tag to let it know that the jar contains the driver it needs or if I have to call the driver differently in my code.
    Any help is appreciated, thanks.

    The simplest approach is always the best. :)Abso-lutely.
    Awesome, that worked perfectly. I Included the extra
    jar file in the applet tag and now my applet makes
    some sweet lovin' to the database.And you have succeeded where thousands have failed. Congratulations.

  • Add jar files and use those classes at the runtime

    Hi All,
    I need to add some jar files at the runtime depends on which the user selects where the jar file is located and i need to import those classes in other class for some functionalities . I could add jar files by using the URLClassLoader and Class.forName("myjar.myclassname") is also succeeded and i have no clue how to use those classes with in the jar file as i couldn't import those classes also in the source because the jar files are being added at the runtime(This leads to class not found exception at the compile time).
    I had found a complicated way of using those classes after being added at the run time as below.
       Class clazz = Class.forName(myClass);
                final Method method = clazz.getDeclaredMethod(requiredMethod, new Class[]{URL.class});
                final Object returned = method.invoke(clazz.newInstance(), new Object[]{request}); but, its really pain to use in this way in all the places.
    Does any of you have simpler suggestions on how to achieve this?
    Thanks,
    Venky.

    Thanks jschell. Yes, you are right. I had found that using reflection API is the only way to load classes at the run time. But according to our application using reflection makes the application little complex, so while start of the application or during other modifications, i am overwriting my jar file to the latest one using FileChannel class as below
          FileChannel ic = new FileInputStream("new.jar").getChannel();
          FileChannel oc = new FileOutputStream("old.jar").getChannel();
          ic.transferTo(0, ic.size(), oc);
          ic.close();
          oc.close();After this code is executed, our application totally uses the new jar file.It is little fast than using reflection. Is this a good idea?

Maybe you are looking for

  • CP8 - WebObjects (link to http or pdf file) doesn't work on LMS

    Hi, Integrate an http link or pdf using WebObjects work well in preview. But once exported to scorm and integrated into an LMS, nothing appears. Any ideas ? Thanks

  • How do I get adobe flash player on my ipad to play movies?

    I received a free movie from flixster and unltraviolet.  Ultraviolet says my ipad needs adobe flash player to watch the movie.  What do I need to do to watch that movie?

  • Dunning by Sales Org

    Hi, like normal, we run dunning per company code but we have a requirement to print a different sender address for one org unit. Anyone know how this can be achieved? Thanks.

  • Delete Datapackage in start routine

    hello Gurus I need to load data for 204 and 205 costcenters but i need to delete records in between costelements 611000 - 613999. so i have writen the code . plz suggest the corrections in the code. data: lt_dp type standard table of data_package_str

  • Middle mouse button

    Hello, I have a Logitech MX Air mouse. It does not have a middle mouse button, which I would be glad to have. There's a touch scroll between the left and right mouse buttons. In both ends of this touch scroll is also buttons to scroll up and down. Me