Jar run time problem

Hi,
I have an application in SWING where thumbnail images are being created at runtime and displayed in a ListCellRenderer. This is mainly used as a history feature where the user can click on that image and retrieve back the information.
The problem is: when I run my code without an IDE it works fine as I am giving relative path names at all the places for storing the images. However, when I make a jar file, it is not able to read those images generated at run time.
Is there a way to read runtime created files outside the jar file?
Can someone help?
Thanks in advance........

sir,
thanks for your reply.
Again I give correct class path in Manifest.txt's
Main-Class.
ie., I am creating my mainclass as mainEMS.java and
its .class file is lacated in D:/ram/classes/sdff
folder. So I am giving the Manifest.txt ,the main
class as " Main-Class: ram.classes.sdff.mainEMS
fter that i give enter.
then create the jar file.
but, after creating jar file, it will again show,
"Failed to load Main-Class manifest attribute from
D:/kbs.jar "
what's my problem.Does the file META-INF/Manifest.mf containt the Main-Class entry or do you have it only in Manifest.txt... there is a huge difference.

Similar Messages

  • Adding panel into JDialog at run time problem

    Hi ,
    I am adding one component at a time into the jdialog at run time.
    What I do , when I launch jdialog instance first time I added one
    component into the jdialog. when OI press next button it removes this
    component and adding next one , but the problem is that is is not showing in the jdialog.
    Please give me any idea that
    How I can add component into jdialog at run time.
    Thaks In Advance.
    - vikas

    Hello,
    without source-code its difficult to understand where your problem is. The following sample code works 'fine':
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class AddCompoDialog extends JDialog {
         int compoCounter;
         public AddCompoDialog(){
              setLocationRelativeTo(null);
              setSize(300,300);
              JPanel mainPanel=new JPanel(new BorderLayout());
              JPanel buttonPanel =new JPanel();
              final JPanel compoPanel=new JPanel(new GridLayout(10,10));
              JButton newCompo=new JButton("add new Component");
              newCompo.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e){
                        compoPanel.add(new JLabel("Compo #"+ ++compoCounter));
                        compoPanel.revalidate(); //Dont forget to relayout your container
              buttonPanel.add(newCompo);
              JButton close=new JButton("close Dialog");
              close.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e) {
                        dispose();
              buttonPanel.add(close);
              mainPanel.add(buttonPanel,BorderLayout.NORTH);
              mainPanel.add(compoPanel);
              getContentPane().add(new JScrollPane(mainPanel));
         public static void main(String[] params) {
              new AddCompoDialog().setVisible(true);
    }Regards,
    Tim

  • Applet run time problem

    i complie this applet but at run time "I/O EXCEPTION(the system can not find the file speciied)
    plz help
    import java.applet.*;
    import java.awt.*;
    import java.lang.String.*;
    class Hello extends Applet
    public void paint(Graphics g)
    g.drawString("Hello java",20,30);
    </applet code="Hello" height=100 width=100>
    </applet>
    */

    http://java.sun.com/docs/books/tutorial/deployment/applet/index.html

  • URGENT run time problems

    I am having the following problem with JDeveloper when i try to run a project. Any help would be appreciated :-
    I have a project that contains a JSP page and several .java files. The first time that i run the project, everything works fine, the project runs and is diplayed in IE without any problems. But any subsequent times that i try to the project i get the following error displaying in the JDeveloper message box :-
    Error starting HTTP-Server: Address in use: JVM_Bind
    Error creating the ORB :
    I have tryed terminating the server between each run but the problem still occurs. The only way to get the project to run again is to reboot my PC. Therefore i am having to reboot my PC everytime before i run a project. Any ideas on how to stop this would be appreciated.

    Hi, we have the same problem since we installed JDEV 9.0.3.1035 (no such problem in 9.0.2)
    Terminating the OC4J Server does not eliminate the problem. We ran our project, shut down the browser, terminated the embedded OC4J server and get the following when we try to run it again:
    C:\JDEV\jdk\bin\javaw.exe -ojvm -classpath C:\JDEV\j2ee\home\oc4j.jar -Dhttp.proxyHost=DELL -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts= -Xverify:none -Doracle.j2ee.dont.use.memory.archive=true com.evermind.server.OC4JServer -config C:\JDEV\jdev\system9.0.3.1035\oc4j-config\server.xml
    [Starting OC4J using the following ports: HTTP=8888, RMI=23891, JMS=9227.]
    [waiting for the server to complete its initialization...]
    Error starting HTTP-Server: Address in use: JVM_Bind
    Error creating the ORB :
    Oracle9iAS (9.0.3.0.0) Containers for J2EE initialized

  • URGENT,,Form Run time problem

    Hi all,
    I just wondering whether you can assist me with the problem I have with running a form.
    When I try to Program Run Form, IE page opens and I have this error msg:
    "Bad Gateway
    The following error occurred:
    The IP address was not found during the DNS lookup. Contact your system administrator. (DNS_NO_DATA)
    -------------------------------------------------------------------Please contact the administrator."
    when I start the OC4J instance,
    It only gives me : "Oracle9iAS (9.0.2.0.0) Containers for J2EE
    initialized"
    I am using Window NT and Oracle 9i Database release 2 and Oracle 9i Developer suite Release 2
    I really appreciate if you can give me some assistance especially in setting up the DNS.
    Thanks
    Regards,
    Silva Hiendra

    The problem seems to be with privileges on the machine running Forms. This is what the online doc said about FRM-30087
    Cause: You lack privileges in the specified directory, or you do not have the disk space required.
    Action: Contact your DBA to make sure you have the access privileges you need.
    Hope this helps
    suvarna

  • Strange run-time problem

    I have a problem in my vi. When the vi loads up, everything seems to work fine, however I have two radio buttons at the top of the vi, and when I use them to select something my vi seems to freeze up. I've tried all kinds of debugging, and I can't find the error. I've also tried to eliminate all race conditions. Could someone please help me find the problem. Thanks!
    Attachments:
    UUT_io_setup_distrib.llb ‏329 KB

    Hi Marshall
    Your Problem Seems to Stem from the Fact that you have two Event Structures in One Loop. If you look up Caveats and Recommendations under event Structure in Labview Help, there is a Paragraph "Avoid Using two Event Structures in One Loop".
    I took your Vi and Did the following Experiments.
    1. Verified that the Vi does Hang as Claimed.
    2. I Put the Tab control at "TTL" and then Deleted the Event Structure form the case "RS232" and than Ran your Vi. It works fine.
    3. Instead of deleting the Event Structure totally, I deleted the event cases which are duplicated in the two event structures. "Yes" Value Change, "No" Value Change event and "Cancel" Event form event Structure under the RS232 Case. Left the timeout Case as is. I ran the Vi Again it Works Fine.
    I believe - The Problem is this. Each Event Structure waits for events it has been programmed for. The event structures are in the same loop. The Event structures themselves have no way of knowing that they are embedded in a case structure and only one of them needs to execute. So after the First event the Program kind of hangs as the second Event structure Waits indefinitely for the Program to Pass execution to it.
    So the Fourth Experiment -
    4. I Used a Local Variable to Change the Tab to RS232 if I was in TTL and to TTL from RS232 if I was in RS232. This Local Vaiables are under the Yes Value Changed Event And Now I checked the Program, If Clicked Yes The TTL Case Executes Changing it and Correspondingly Changing the NO value, then it Changes the Tab Value So on the Next Iteration of While Loop my Program is in RS232 Case and Event Structure Executes and puts the Tab Back to RS232. In effect I have Made My Program Go through Both Event Structures This Works Everytime Only when I click on YES. I click on NO and Program Hangs as I did Not Built the Same Functionality for this case.
    The Event Structures Cache the Events they have been Programmed for andthe First Event Must be Handled Before A second Event can take Place. In your Case One Event is in two Structures and at any given time One of these Structures executes. The Other Structure Waits and Inhibits furthur interaction till the Event generated can be handled by it.
    On a Side Note. It is Advisable to Create an Event Structure and Embed your Cases within them And Also have Only One Event Node to Handle One Event Such as "YEs" Value Change. So you know what is Going on. and easy to Maintain Code. Also It will Help If you could Club Similar Controls in an Array and handle them that way rather than individually
    I Hope I am clear in my explanation. I hope this is the reasoning why Your Program Hangs. I have attached your Vis slightly modified for you to see.
    Good Luck!!
    Good Luck!
    Mache
    Attachments:
    UUT_io_setup_distrib.llb ‏329 KB

  • Oracle Forms 10g run time problem

    Hello.
    I installed Oracle Dev 10g and I'm trying to use Oracle Forms.
    I configured all files like this:
    [steps in other post]
    1. Install the Jinitiator
    location: <devsuitehome>/jinit/jinit.exe
    2. edit the following files:
    a. <devsuitehome>/forms90/server/default.env
    where you set forms90_path=add your path to your library files (*.pll)
    b. <devsuitehome>/forms90/server/formsweb.cfg
    where you set workingDirectory=path to your *.fmx files
    3. at Forms Builder go to Edit/Preferences/Runtime
    then at the Application Server URL click "Reset to Default"
    4. before attempting to run your forms, run "Start OC4J Instance" first
    start/programs/oracle developer suite/forms developer/start oc4j instance
    After this, when I try to run the form, I don't get any error, but the browser opens and does nothing! Some times appears a small form to acces the data base, other don't, but it always stops!!
    Any ideas?!?
    Many thanks,
    Nuno

    Might also be worth turningon the Jinit console (you can do this from your windows Control Panel). And set the trace level to 5 (just press 5 when the jinit console appears).
    Then check error messages.
    Regards
    Grant

  • Java Run-Time problems

    I am new to Java and am trying to write a simple program.
    The test class will instantiate an object of the "house" class which will in turn contain an array of 20 objects of the "player" class.
    Compiles with no errors or warnings, but gives an immediate:
    Exception in thread "main" java.lang.NullPointerException at test.main(test.java:6)
    test.java
    public class test
            private static house h;
            public static void main(String args[])
                    h.players[3].setName("john");
    }house.java
    public class house
            public player[] players = new player[20];
    }player.java
    public class player
            private static String name;
            public static void setName(String n)
                    name = n;
    }What seems to be the problem? To my untrained eyes I can't find any errors.

    alphacoder wrote:
    Thanks for the help. It fixed my problem.Good to know.
    How do I solve the 20 null references problem?That depends soley on what you want your class to do.
    Do I just initialize all 20 references in the house constructor?If you want it to always reference 20 persons, then do so.
    Alternatively you could track how many persons are currently in there and only add a new one when addPerson() is called (or something similar).
    Also, you should avoid this kind of direct access to other classes member variables, it's against encapsulation (that's probably something you'll learn later in the course/book/tutorial, but I'd like to mention it).

  • Dropdownbykey at run time problem

    Hi..
    i am creating the node and attaching attribute which has value set.
    i am binding the attribute to a dropdown key.
    when i select the values in dropdown, and in actions method if i dont perform any operations. It is working fine.
    when i select the values in dropdown, and in actions method if  perform any operations. i am not getting the selected value in dd.
    please help me..
    Thanks

    Hi Vimalraj Madhavan ,
               Usually the selected value will stay there in the drop down even after doing any action. what you can try is in youcode some where you might be clearing the attribute thats binded to the dropdown,
    you can put a debugger on the action you are triggering and check the code.
    or some where you are again calling the code to fill the value set, you can i think better check the code in modify view.
    the same problem will be there if you are doing the selection of a value in ddk and doing any other action (other than ddk action), i think
    Regards
    Sarath

  • Run time problem

    Hi !
    I'm new with Java and it will drive me nuts.
    I've to files in F:\javap\Familias:
    ModFam.java - where I've the main function
    Familias.java - some other classes and methods
    each file have the line:
    package Familias; at line 1.
    Ok.
    I compiled from f:\javap using:
    java Familias\*.java
    No errors and I've 3 class files in f:\javap\Familias:
    - ModFam.class
    - ModFam$1.class
    - Familias.class
    First question: what is the $1.class file ?
    Now I want to run the application from f:\javap\Familias as follows:
    javac -cp . Familias.ModFam
    and I get the message: Exception in thread "main" java.lang.NoClassDefFoundError: Familias/ModFam
    Second question: Why ? How should I run the program ?
    Thanks in advance
    <jl>

    Since you have your classes in a package, you class files has to be in a directory called Familias, and the CLASSPATH should be set to just before your Familias directory.
    Just compile as
    javac -d . *.java
    -d option just says where you want your source files, and it will also create the directory Familias for you.
    Then you run it with java, not javac, as:
    java -classpath . Familias.ModFam
    Btw, you have a package called Familias, and a class called Familias. The naming convention says that package names should start with lower case letter, so to avoid confusion, it would be better to rename your package to familias.
    I'm not even sure you can run your code now, because Familias.ModFam could mean either the class ModFam in the package Familias, or the inner class ModFam in the class Familias. I hope it will check for the package first.

  • Installation problem w/ Java Run Time Environment 1.2.2

    Steps to reproduce error:
    1.On Windows 98 I install Java Run Time Environment 1.2.2
    2.I try to launch Java Plug-in Control Panel from Windows Start menu
    Error message:
    JAVAW caused an invalid page fault in
    module SYMCJIT.DLL at 0167:500bf974.
    Registers:
    EAX=00000e03 CS=0167 EIP=500bf974 EFLGS=00010206
    EBX=006538e0 SS=016f ESP=0063f838 EBP=00000e7f
    ECX=0000009f DS=016f ESI=00000e7f FS=0e77
    EDX=00000003 ES=016f EDI=05110010 GS=0000
    Bytes at CS:EIP:
    f3 a5 ff 24 95 48 42 0c 50 8d 49 00 8d 74 31 fc
    Stack dump:
    500bf8c7 0000027f 500c42b0 5007cc24 05110010 00000e7f 0000027f 00760ab0 00000283 0069a4a8 006538e0 0063f8e4 00653928 05110010 006538e0 00000e7f
    Is there a fix for this?
    Thanks
    -DK

    This dll does not recognise the Pentium 4 processor. You need to update the JRE. It is a well recognised problem. Search the forums (and Google) using "symcjit pentium 4" to obtain more information.
    Hope this helps.--
    <sig> http://www.itswalky.com http://www.crfh.net </sig>

  • Class to jar communication at run time

    Hi,
    I am developing a application using jdk 1.4 and have following query:
    I have an application that displays some information in various languages (according to the language selected), i.e english, french, german etc. Say I select english, the application will display "Hello World" in English language and so on for other languages..
    So my app is divided into three parts:
    1) Core application : displaying information
    2) XML file: Containing list of languages in XML format. This XML File can be updated for adding new languages. The format of XML file is somewhat as
    <LANGUAGE_NAME>___</LANGUAGE_NAME>
    <CLASS_LANG>____</CLASS_LANG>
    3) A seprate JAR file :Having set of classes corresponding to each language. The JAR file should be such that we can add classes for new languages added.
    The Workflow of app is as follows:
    When ever we run the application, the application reads the list of languages from the XML file and populats the list in a drop-down list box. Now, upon clicking a "GO" button, the application checks the language selected and calls the JAR will. It sends the class name corresponding to the language selected. And the class should return the information back to the application.
    Now, this process should be dynamic, i.e user can update XML with new language and update the JAR file with new class name.
    And upon just re-running the application, the application should be able to use features of new language.
    Consider that we have already shipped the application. All we have to do is to send updated JAR file to the user. and ask him to update the XML file for new language. i.e no changes to be done at application. And application should communicate with update JAR files at the end user.
    Now I have following queries:
    1) Is the above process possible? If yes, then
    2) How to communicate my application with the new class files in JAR file. i.e how to communicate my class with the UPDATED class in JAR file. Any prototype code to achieve this functionality would be of great help. Remember all this need to happen at run time.
    I hope my question is clear. Feel free to ask any queries.
    Thanks,
    rdh

    Java has a mechanism to cope with this - though it is not XML-based:
    java.util.ResourceBundle
    I would store the required resource (a property file or the XML or a jar) separately.

  • Dynamic jar file inclusion at run time

    Hello,
    I have a java application which should accept the three parameters.
    1) The jar file location
    2) Particular Class file insdie that jar(we specified the location in step number 1)
    3) And method name in that class.
    My question is how to include specified jar location with jar name to CLASSPATH at run time. So that i can execute a particular method name in step number (3).
    I would appreciate for the quick reponse or any input.
    Thanks,
    Raghu

    And if you want to change the system classpathduring
    runtime, don't forget that you can always use
    reflection to call the System classloader'sprotected
    addUrl method :)Really?
    Seems reasonable although this is the first time I
    have seen that referred to.you can indeed. I've done this, as a quick avoid-writing-a-classloader hack. wouldn't really recommend it, though. if you're using reflection to modify access, chances are you're doing a massive fudge
    and of course, since it's not part of a public API, there's absolutely no reason to the method won't simply disappear in a future release....

  • Imported Jar file not loaded at run time ORA-105100

    Oracle 9iDS forms Version 9.0.2.9.0
    Oracle 9iAS Release 2
    I have imported java classes from a jar file into my form. I have it working in client server. Added the entries to the classpath in the default.env and system environment variable for development of the form and for execution.
    Moved the jar file, form and testing html to the application server. Modified the classpath in the default.env file. Tested the form. Got the ORA-105100 error. MetaLink note 261650.1 states that error frm-40735 When-Button-Pressed triger raised exception ORA-105100 if calling a java function from a jar file. Cause: Jar file not loaded at run time. Solution: add in your default.env CLASSPATH parameter your jar file including the whole directory of the jar file location. That has been done and the OC4J has been restarted. Still get error.
    Oracle support has not been able to give me much help as of yet. Does anyone have any further ideas, or documentation that I can read to help get this working?
    Thanks in advance for any assistance that is offered.

    Hey people any clues?

  • Load Jar and access a class in jar at run time

    I need help from you.
    How to load a Jar and access a class in the jar at run time?
    When i try the following code it works fine while running in Java (Jdk1.5).If iam running the same code in servlet,ClassCastException occurs.
    Error Message : ClassCastExcption : jartest1 cannot be cast to Thing
    test.jar contains jartest.class and Thing.class
    jartest1.java
    try{
    File file =new File("test.jar");
    String lcStr ="jartest";
    URL jfile = new URL("jar", "", "file:" + file.getAbsolutePath() +"!/");
    URLClassLoader cl = URLClassLoader.newInstance(new URL[] { jfile });
    Class loadedClass = cl.loadClass(lcStr);
    Thing t=(Thing)loadedClass.newInstance();
    t.execute();
    catch(Exception e)
    System.err.println(e);
    Thing.java
    public interface Thing
    void execute();
    jartest.java
    public class jartest implements Thing
    public void exceute()
    System.out.println("Welcome");
    Thanks and Regards
    V.Senthil Kumar
    Edited by: senthilv_sun on Dec 16, 2008 8:30 PM

    senthilv_sun wrote:
    I need help from you.
    How to load a Jar and access a class in the jar at run time?
    When i try the following code it works fine while running in Java (Jdk1.5).If iam running the same code in servlet,ClassCastException occurs.
    Error Message : ClassCastExcption : jartest1 cannot be cast to ThingPresumably we can only hope that that is a transciption error. It always helps to use copy and past actual errors and code rather than manually typing them.
    test.jar contains jartest.class and Thing.classWrong.
    The interface class and plugable class must not be in the same jar.
    A plugable interface requires two components
    - Interface (generic sense)
    - Functional components.
    The Interface must be independant (own jar) so that it is available to the framework (user of plugin) and to the functional components. And the plugable component must not be on the java class path.
    This also means that we know for certain that the plugable component is also on the system class path. That is a bad idea as well.
    Given that it is pretty pointless to even speculate as to why this error is showing up. Create the correct jar layout. Test using the command line. Then test using servlets. Insure that the plugable jar is NOT on the java classpath for both tests.

Maybe you are looking for