Java.lang.IllegalThreadStateException and Thread.State ?TERMINATED?

Hi,
I have class derived from Thread. If I call the start() the run() method is called and the thread code is started being executed. After some time the run() method is finished. Then, using the same class instance I call the start() method again, but then I have exception java.lang.IllegalThreadStateException. I found that the first I start the thread, it is in the NEW state, while second time it is TERMINATED. What I have to do to start the thread again in the same instance?
Thank you for response
BR
STeN

thanks for reply - surprising for me - I'm a newebie.Well, any Java question asked politely deserves and gets a response here. Being new doesn't make you underprivileged :p
The proper way to handle threads, which should be started more times is to create the insance of the class that extends Thread (or implements Runnable ) again. Right?You got the idea, but you can't create the same instance again -- you have to construct a new instance.
Just a matter of exactness in terminology, which is important in discussions.
cheers, db

Similar Messages

  • Java.lang.IllegalThreadStateException - Trying to restart a Thread

    Hi, since I'm new to this forum, I'll start right off with a question.
    I'm trying to create an application, which guides the user trough several windows. In the first window there is some user input, and frame2 opens. frame2 then opens, depending on user input, frame1 (restart the cycle) or frame3.
    I tried this with Threads, a Thread for each frame to keep things less complicated (less messy etc.).
    Now the problem:
    When I try to restart frame1, I get the error "java.lang.IllegalThreadStateException". The source code:
    public class Sss extends Thread
        (public variables that can be changed or used by other classes)
        public static frame1 a = new frame;
        public static void main(String[] args)
            a.start();
    public class frame1 extends Thread implements ActionListener
        //several public static variables/object for the frame etc.      
        public frame1()
        public void run()
              //create the frame, add objects, add actionlisteners
        public void actionPerformed(ActionEvent e)
            //several buttons redirected to different methodes
        //several methodes
        public void end() //is called in a method
          frame2 p = new frame2();
           p.start();
        } This still works, but then:
    public class frame2 extends Thread implements ActionListener
    //several public static variables/object for the frame etc
        public frame2()
        public void run()
    //create the frame, add objects, add actionlistener
          public void end()
                if(a)          //boolean a is true or false
                    frame1 q = new frame1();
                    q.start();
                else
                     frame3 w = new frame3();
                     w.start();
    public void actionPerformed(ActionEvent e)
            //several buttons redirecting to different methods
    } In the end method, "q.start();" gives the error. Am I doing something wrong? Shouldn't I be using Threads at all, should I try something different(what, how?)
    I'm a student from The Netherlands, 18 years old, and I'm going to study "technische informatica" (don't know what it is in English, sorry, but it involves programming ;)). I've worked with Java on a low profile the last two years, learning & exploring, my most difficult application made is an ChatProgram (client/server based, in a local network). So this gives you my level in programming a little bit, I hope ;)
    If someone is able to help me, please.
    Niek

    Niekfct wrote:
    Well it's not actually helping me, you're posting things what I've already found out. And I can't imagine you've put a lot of time in such an answer. But if someone DOES post a usefull answer, i will be grateful for it. So if someone can help me, please.
    And with help I mean, maybe an other way to do this, maybe a way to slightly adjust the existing classes to make it work.
    (Please don't look at me as if I'm some lazy boy who can't figure anything out by himself. I'm trying to help others, and I hope others will help me.)Uhm, how are you trying to help others with this?
    Also, how is pointing out that the path you are currently taking is pointless and a waste of time not helpful. At the very least it should cause you to stop even attempting to continue along that path, and prompt you to take a step back and try to look at the problem from another angle.
    Jeesh, instead you just, essentially, say "Shut up! I know what I'm doing!". Well, that sounds like you really wanted help. Sounded more like you wanted confirmation, not help.
    In any case, why don't you simply get rid of all references to threads, and simply change all but the main frame to JDialogs?
    From what I can I see, of what you have posted here, that should be more than enough.
    Just make sure, of course, that you don't mix your business logic into your GUI. Which you must have be doing currently, since a GUI class, in and of itself, has absolutely no reason to need it's own thread. It wouldn't help anything regardless of how you looked at it.

  • Exception java.lang.IllegalThreadStateException

    Hi,
    Can any one help me to find the reason of this exception:
    Exception java.lang.IllegalThreadStateException
    I call some procedure in loop:
    while(MsgQueue.size() >0 && runSearch)
    if(!runSearch){resetVars(); return;}
    final String[] nodes1=this.getRandomDataSet();
    try {
    pF = new parseSearch(url, false, nodes1);
    pF.parseSearchMain();
    }catch(Exception e)
    onlineLog.write("Exception "+e.toString()+" was the reason why we missed the "+url);
    continue;
    onlineMain.updateT(url);
    counter++;
    url=(String)MsgQueue.recv();
    }catch(Exception e)
    onlineLog.write("Exception "+e.toString()+" was the reason why thread stopped");
    And the exception java.lang.IllegalThreadStateException occurs somewhere in loop, but not in try/catch block in a loop.
    Please help,
    M.

    Hi there,
    I've installed Java 1.5.0_04 and I run my app on it. Still I do not get this exception :) I do not know what JRE is available now, I save that there is Java 1.5 update 6, it is available at java.com, but I do not know what is this in 1.5xxx notation.
    Anyway, I am unable to repeat this exception. So, please let me know if you have information on IllegalThreadStateException. I am not sure how this happens, may be my MsgQueue throws this exception sometimes when it sleeps and spme thread accesses it. I do not know. But this is annoying bug and I have to locate its origin. So any help is appreciated :)
    Thanks,
    M.

  • Get java.lang.IllegalThreadStateException in windows

    Hello I got this error java.lang.IllegalThreadStateException.
    The whole program works under Linux now I tried it in windows almost everything works only this thread doesn't.
    I found out what it was but was wondering why it is.
    //Thread
           System.out.println("Tabrows " +tabrows);
           for(int i=0;i<100;i++)
           count+=0.01;
           String ja=""+form.format(count);
    //       System.out.println("FORM "+ja);
           String nee =""+form.format(loop1);
    //       System.out.println("count "+ja+" LOOP  "+nee);
           if (ja.equals(nee))
           slaap(10);
           draw(g,10);
           loop1=loop1+loopbuf1;
           System.out.println("GELIJK "+" loop1 count "+count+" loopbuf "+loopbuf1+" count "+ja+" LOOP  "+nee);
          public void draw(Graphics g, int x)
          System.out.println("This is a test "+x);
          progbar.ga();
    //      progbar.start();
          repaint();
          }It is because of this line
    progbar.start();
    Can someone tell me why this doesn't work in windows and works in Linux?

    What class is your progbar? If it extends Thread, you are getting a problem because you can't start the same thread more than once. In your code, it would be started (or attempted to be started) every time the window redraws.
    I don't know why it would work on Linux.

  • Java.lang.IllegalThreadStateException

    Hey folks,
    i have a little problem: I have a Gui and when i press a start button it does the following:
    mythread.start();The thread starts and does something. After the thread finished, i tried to push the Start-Button in the gui again, but then i will get a java.lang.IllegalThreadStateException :-(
    Does anybody know why and how i can fix that problem?
    Thanks alot

    Ok thanks i think i�ve did it like you proposed:
    new Thread(myThread).start();     and my Thread implements runnable.
    Thanks alot..

  • Java.lang.IllegalMonitorStateException: current thread not owner

    Hello,
    my program runs an exe that doesn't return a zero when it's finished, therefore, I can't use a waitFor().
    To solve this problem i look at the length of the file which has to be manipulated by this exe every 200ms and see whether it's length stopped changing. This should mean it's job is done...
    But using this code:
    public void run(String filename)
              System.out.println("start runtime");
              Runtime rt = Runtime.getRuntime();
              String[] callAndArgs = { "lssvmFILE.exe", filename };
              try
                   Process child = rt.exec(callAndArgs);
                   child.wait(200);
                   filesize = 0;
                   while(filesize != file.length())                            {
                        filesize = file.length();
                        child.wait(200);
                   //child.waitFor();
                   System.out.println("Process exit code is:   " + child.exitValue());
              catch(IOException e)
              {     System.err.println( "IOException starting process!");}
              catch(InterruptedException e)
              {     System.err.println( "Interrupted waiting for process!");}
              System.out.println("end run");
         }i get this on my System.out:
    Exception occurred during event dispatching:
    java.lang.IllegalMonitorStateException: current thread not owner
            at java.lang.Object.wait(Native Method)
            at LssvmFile.run(LssvmFile.java:292)
            at LssvmFile.start(LssvmFile.java:189)
            at GUI.actionPerformed(GUI.java:137)
            at java.awt.Button.processActionEvent(Button.java:329)
            at java.awt.Button.processEvent(Button.java:302)
            at java.awt.Component.dispatchEventImpl(Component.java:2593)
            at java.awt.Component.dispatchEvent(Component.java:2497)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)

    Here's the code:
    I already found out that the sleep function indeed caused this exe to run so slow. It seems that everything stops when sleep is used. By setting the delay to 2ms the duration is satisfactory (some seconds).
    I also tried skipping the sleep and just using a while, but that ended in an endless loop. Setting the delay to 1ms lead to a stop when the filelength was 0 (i guess that was on the moment that the exe cleared the file and prepared to write) so it seems to me that 2ms is quite a good trade off.
    this part of the code is preceeded by writing the data to the file and afterwards the new data will be read in again...
         //Close the stream
              outFileStream.close();
         //Run lssvmFILE.exe to compute alpha & b
              long originalfilesize = file.length();
              run(filename);
              //wait untill job done
              Thread thread = new Thread();
              long filesize = file.length();
              try{thread.sleep(2);}
              catch(InterruptedException e){};
              while(filesize != file.length() || originalfilesize ==file.length())
                   filesize = file.length();
                   try{thread.sleep(2);}
                   catch(InterruptedException e){};
         //Set up Instream (read from file)
         //----------------------Bedankt!
    Bart

  • HP-UX Kernel Params for WLS 6.0SP2 Cluster to Avoid java.lang.outofmemory and/or thread death

              I'm running a WLS 6.0 SP2 clustered application on HP-UX 11i. I'm seeing heap and
              thread issues on start-up or invocation of my application as I deploy EJB's and create
              DB connection pools. These are fairly trivial tasks that don't give me any issues
              when starting the first node. It's only when I invoke the second node.
              I'm pretty sure that my issue is tied to the following kernel areas:
              1. Thread allocation
              2. Heap allocation
              3. Max Processes per user
              Can anyone make some kernel recommendations that might be beneficial to my deployment?
              My app runs on NT/2000 and Sun as well, and I haven't seen these issues. I typically
              allocate 50 to 100 threads per node (3 nodes on a 4 CPU machine) and allocate about
              1GB of RAM per node on a 4GB machine...
              Regards,
              Steve
              

    I'm running a WLS 6.0 SP2 clustered application on HP-UX 11i. I'm seeing          heap and
              > thread issues on start-up or invocation of my application as I deploy
              EJB's and create
              > DB connection pools. These are fairly trivial tasks that don't give me any
              issues
              > when starting the first node. It's only when I invoke the second node.
              >
              > I'm pretty sure that my issue is tied to the following kernel areas:
              >
              > 1. Thread allocation
              > 2. Heap allocation
              > 3. Max Processes per user
              >
              > Can anyone make some kernel recommendations that might be beneficial to my
              deployment?
              > My app runs on NT/2000 and Sun as well, and I haven't seen these issues. I
              typically
              > allocate 50 to 100 threads per node (3 nodes on a 4 CPU machine) and
              allocate about
              > 1GB of RAM per node on a 4GB machine...
              HP has some kernel tuning guidelines for Java server apps on their web site,
              and BEA has some notes as well in their platform support page.
              What issues specifically are you seeing?
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              Clustering Weblogic? You're either using Coherence, or you should be!
              Download a Tangosol Coherence eval today at http://www.tangosol.com/
              "Steve Feldman" <[email protected]> wrote in message
              news:3cdc046e$[email protected]..
              >
              

  • Java.lang.reflect.Constructor thread safe ?

    When you have a Constructor object in Java.
    Is calling the newInstance method on the same Constructor object from multiple threads safe.
    Or is this not thread safe leading to wrongly constructed objects?

    ejp wrote:
    And as Constructors are immutable, it's hard to see how it's going to get altered.Constructors are basically immutable, but they have at least one state which can make the difference between newInstance working or failing.
    As you can see in the following example, setAccessible() is not something you would want to set to different values in different threads.
    import java.lang.reflect.Constructor;
    public class Main {
        public static void main(String... args) throws Exception {
            Constructor cons = Private.class.getDeclaredConstructor();
            cons.setAccessible(false);
            try {
                System.out.println("cons.isAccessible()= " + cons.isAccessible());
                cons.newInstance();
                throw new AssertionError("IllegalAccessException expected");
            } catch (IllegalAccessException expected) {
                // ignored
            cons.setAccessible(true);
            System.out.println("cons.isAccessible()= " + cons.isAccessible());
            cons.newInstance();
    class Private {
        private Private() {
    }

  • Java.lang.NullPointerException and javaBeans

    I think that part of the problem is due to some wonky requirements, but maybe not. There are three classes:
    lab02.util.MySlider -- has a JSlider and a few other bits
    lab02.util.ColorSelector -- has three JSliders and creates a Color (not a JColorChooser)
    lab02.view.View -- the driver and JFrame, has two ColorSelectors and JTextField
    However, a requirement is to have ColorSelector load as a jar file. The only way I could find of doing that was create two parallel projects: beans and lab2.
    I added MySlider to the palette for ColorSelector, and then added ColorSelector to the palette. Switching over the lab2 project, I added ColorSelector to View. When I received the following error:
    xception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at a00720398.lab02.util.MySlider.jSlider1StateChanged(MySlider.java:53)
            at a00720398.lab02.util.MySlider.access$000(MySlider.java:6)
            at a00720398.lab02.util.MySlider$1.stateChanged(MySlider.java:39)I then added both MySlider and ColorSlider to the Library Manager, and then added them to the library for lab2 project. Same result.
    Is it a coding problem? A netbeans problem? A packaging problem? I've tried some System.out statements to try to track it down but couldn't get anywhere.
    Keepin in mind that there are two projects with overlapping package structures, here's the code:
    thufir@arrakis:~/bcit3621$
    thufir@arrakis:~/bcit3621$ cat lab2beans/src/a00720398/lab02/util/MySlider.java
    package a00720398.lab02.util;
    import javax.swing.event.ChangeListener;
    public class MySlider extends javax.swing.JPanel {
        private ChangeListener changeListener;
        /** Creates new form MySlider */
        public MySlider() {
            initComponents();
        public MySlider(ChangeListener changeListener) {
            this();
            this.changeListener = changeListener;
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc="Generated
    Code">//GEN-BEGIN:initComponents
        private void initComponents() {
            bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
            jLabel1 = new javax.swing.JLabel();
            jSlider1 = new javax.swing.JSlider();
            jTextField1 = new javax.swing.JTextField();
            jLabel1.setText("jLabel1");
            add(jLabel1);
            jSlider1.setMaximum(255);
            jSlider1.addChangeListener(new javax.swing.event.ChangeListener() {
                public void stateChanged(javax.swing.event.ChangeEvent evt) {
                    jSlider1StateChanged(evt);
            add(jSlider1);
            org.jdesktop.beansbinding.Binding binding =
    org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
    jSlider1, org.jdesktop.beansbinding.ELProperty.create("${value}"), jTextField1,
    org.jdesktop.beansbinding.BeanProperty.create("text"));
            bindingGroup.addBinding(binding);
            add(jTextField1);
            bindingGroup.bind();
        }// </editor-fold>//GEN-END:initComponents
        private void jSlider1StateChanged(javax.swing.event.ChangeEvent evt)
    {//GEN-FIRST:event_jSlider1StateChanged
            // TODO add your handling code here:
            changeListener.stateChanged(evt);
        }//GEN-LAST:event_jSlider1StateChanged
        public void setName(String string) {
            jLabel1.setText(string);
        public int getValue() {
            return jSlider1.getValue();
        public void setValue(int value) {
            jSlider1.setValue(value);
        // Variables declaration - do not modify//GEN-BEGIN:variables
        private javax.swing.JLabel jLabel1;
        private javax.swing.JSlider jSlider1;
        private javax.swing.JTextField jTextField1;
        private org.jdesktop.beansbinding.BindingGroup bindingGroup;
        // End of variables declaration//GEN-END:variables
    thufir@arrakis:~/bcit3621$
    thufir@arrakis:~/bcit3621$ cat lab2beans/src/a00720398/lab02/util/ColorSelector.java
    package a00720398.lab02.util;
    import java.awt.Color;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ChangeListener;
    public class ColorSelector extends javax.swing.JPanel implements ChangeListener {
        private ChangeListener changeListener;
        private Color color;
        /** Creates new form ColorSelector */
        public ColorSelector() {
            initComponents();
        public ColorSelector(Color color) {
            //initComponents();
            red = new a00720398.lab02.util.MySlider(this);
            green = new a00720398.lab02.util.MySlider(this);
            blue = new a00720398.lab02.util.MySlider(this);
            setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.Y_AXIS));
            add(red);
            add(green);
            add(blue);
            this.color = color;
        public ColorSelector(Color color, ChangeListener changeListener) {
            //initComponents();
            this(color);
            this.changeListener = changeListener;
            //initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc="Generated
    Code">//GEN-BEGIN:initComponents
        private void initComponents() {
            red = new a00720398.lab02.util.MySlider();
            green = new a00720398.lab02.util.MySlider();
            blue = new a00720398.lab02.util.MySlider();
            setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.Y_AXIS));
            add(red);
            add(green);
            add(blue);
        }// </editor-fold>//GEN-END:initComponents
        // Variables declaration - do not modify//GEN-BEGIN:variables
        private a00720398.lab02.util.MySlider blue;
        private a00720398.lab02.util.MySlider green;
        private a00720398.lab02.util.MySlider red;
        // End of variables declaration//GEN-END:variables
        public void stateChanged(ChangeEvent arg0) {
            throw new UnsupportedOperationException("Not supported yet.");
            //color = new Color(red.getValue(), green.getValue(), blue.getValue());
        public Color getColor() {
            System.out.println("getColor   " + color);
            return color;
    thufir@arrakis:~/bcit3621$
    thufir@arrakis:~/bcit3621$ cat lab2/src/a00720398/lab02/view/Lab02View.java
    package a00720398.lab02.view;
    import a00720398.lab02.util.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class Lab02View extends javax.swing.JFrame implements ChangeListener {
        private Color color;
        /** Creates new form Lab02View */
        public Lab02View() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc="Generated
    Code">//GEN-BEGIN:initComponents
        private void initComponents() {
            jTextArea1 = new javax.swing.JTextArea();
            colorSelector1 = new a00720398.lab02.util.ColorSelector();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(),
    javax.swing.BoxLayout.Y_AXIS));
            jTextArea1.setColumns(20);
            jTextArea1.setRows(5);
            getContentPane().add(jTextArea1);
            getContentPane().add(colorSelector1);
            pack();
        }// </editor-fold>//GEN-END:initComponents
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    //new Lab02View().setVisible(true);
                    JFrame frame = new Lab02View();
                    frame.setLocationRelativeTo(null);
                    frame.setSize(600,400);
                    frame.setVisible(true);
        public void stateChanged(ChangeEvent arg0) {
            throw new UnsupportedOperationException("Not supported yet.");
            //jTextArea1.setBackground(colorSelector1.getColor());
            //color = colorSelector1.getColor();
        // Variables declaration - do not modify//GEN-BEGIN:variables
        private a00720398.lab02.util.ColorSelector colorSelector1;
        private javax.swing.JTextArea jTextArea1;
        // End of variables declaration//GEN-END:variables
    thufir@arrakis:~/bcit3621$
    thufir@arrakis:~/bcit3621$ thanks,
    Thufir

    don't respond to this question, it's too "large". I'm creating another thread.

  • "AWT-EventQueue-0" java.lang.NullPointerException and JInternalFrame

    I have two classes one with main method second with GUI methods (JFrame, JInternalFrame). When I call method to start second JInternalFrame from main everything is working but if i call it form any other method i get:
    Exception in thread "main" java.lang.NullPointerException
    at pkg1.GUI.createFrame(GUI.java:123)
    at pkg1.GUI.startFrame2(GUI.java:66)
    at pkg1.Top.cos(Top.java:25)
    at pkg1.Top.main(Top.java:20) My code:
    GUI class
    package pkg1;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.Frame;
    import java.awt.Toolkit;
    import java.awt.event.MouseMotionListener;
    import javax.swing.JDesktopPane;
    import javax.swing.JFrame;
    import javax.swing.JInternalFrame;
    import javax.swing.JPanel;
    import javax.swing.plaf.basic.BasicInternalFrameUI;
    import oracle.jdeveloper.layout.XYLayout;
    public class GUI
        public JDesktopPane desktop;
        private XYLayout xYLayout1 = new XYLayout();
        public int openFrameCount = 0;
        JFrame f = new JFrame();
        public void GUII()  // Prepare JFrame
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setSize(500, 600);
            f.setVisible(true);
        public void startFrame()
            desktop = new JDesktopPane();
            createFrame(); //create first "window"
            f.setContentPane(desktop);
            desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
        public void startFrame2()
            createFrame(); //create second "window"
            f.setContentPane(desktop);
            desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
        public void createFrame()
            MyInternalFrame frame = new MyInternalFrame();
            frame.setVisible(true); //necessary as of 1.3
            desktop.add(frame);
            frame.add(new GUI2());
        } Top class
    public class Top
        public static void main(String[] args)
            GUI g = new GUI();
            g.GUII(); //Create JFrame
            g.startFrame(); //Create JInternalFrame
            Top t = new Top();
            t.sth();
        public void sth()
            GUI gui = new GUI();
            gui.startFrame2();
    } MyIntternalFrame class
    import javax.swing.JInternalFrame;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.SwingConstants;
    import oracle.jdeveloper.layout.XYConstraints;
    import oracle.jdeveloper.layout.XYLayout;
    /* Used by InternalFrameDemo.java. */
    public class MyInternalFrame extends JInternalFrame {
        static int openFrameCount =  0;      
        static final int xOffset = 30, yOffset = 30;
        private XYLayout xYLayout1 = new XYLayout();
        private JButton jButton1 = new JButton();
        private JLabel jLabel1 = new JLabel();
        private JFrame c = new JFrame();
        private JPanel d = new JPanel();
        private XYLayout xYLayout2 = new XYLayout();
        public MyInternalFrame() {         
            super("Document #"  + (++openFrameCount),true /*resizable*/,true /*closable*/,true /*maximizable*/,true);//iconifiable*/
            //...Create the GUI and put it in the window...
            //...Then set the window size or call pack...
            int width = new GUI2().width + 10;
            int height = new GUI2().height + 40;
            setSize(width,height);
            setLocation(xOffset*openFrameCount, yOffset*openFrameCount);
    } Please tel me where is my mistake or maybe you knew another way to open JInternalFrame with public method form another class

    Some possibly helpful suggestions:
    1) Create one JDesktopPane, and do it in the constructor of GUI. You should call this constructor only once.
    2) Get rid of GUII. The GUI constructor will do all this and more.
    3) Get rid of startFrame and startFrame2.
    4) In GUI2, change your width and height to static variables if you are going to use them in outside classes. There is no reason to have to create a GUI2 object just to get those values. Get them from the class, not the instances.
    5) You're doing something funky in your Top class with your mixing of static code and non-static code. My gut tells me that Top is just a static universe that exists to get your code up and running, and that the code within it should all be static, but that's just my personal opinion.
    6) In MyInternalFrame, get the height and width from GUI2 (if that's what you want to do) again in a static fashion. Rather than new GUI2().width which makes no sense, use GUI2.width.
    Why can't you put the button inside of the JInternalFrame object? I believe that the contentPane of this object which may hold your button (unless you embed a jpanel) uses BorderLayout, so you have to take care how you add jcomponents to the jinternalframe (or more precisely, it's contentPane).

  • ESS: java.lang.NullPointerException in Salary Statement

    Hi All,
    We have configured ESS salary stament but getting the following Exception when we click on Salary Statement,
    Please help us out in this:-
    java.lang.NullPointerException
         at com.sap.pcuigp.tracking.BTrackingComp.isValuePackSystem(BTrackingComp.java:290)
         at com.sap.pcuigp.tracking.BTrackingComp.onInit(BTrackingComp.java:206)
         at com.sap.pcuigp.tracking.wdp.InternalBTrackingComp.onInit(InternalBTrackingComp.java:173)
         at com.sap.pcuigp.tracking.BTrackingCompInterface.onInit(BTrackingCompInterface.java:115)
         at com.sap.pcuigp.tracking.wdp.InternalBTrackingCompInterface.onInit(InternalBTrackingCompInterface.java:124)
         at com.sap.pcuigp.tracking.wdp.InternalBTrackingCompInterface$External.onInit(InternalBTrackingCompInterface.java:198)
         at com.sap.pcuigp.xssfpm.wd.FPMComponent$FPM.attachComponentToUsage(FPMComponent.java:922)
         at com.sap.pcuigp.xssfpm.wd.FPMComponent$FPM.attachComponentToUsage(FPMComponent.java:891)
         at com.sap.pcuigp.xssfpm.wd.FPMComponent$FPMProxy.attachComponentToUsage(FPMComponent.java:1084)
         at com.sap.pcuigp.xssutils.pernr.FcEmployeeServices.onInit(FcEmployeeServices.java:219)
         at com.sap.pcuigp.xssutils.pernr.wdp.InternalFcEmployeeServices.onInit(InternalFcEmployeeServices.java:249)
         at com.sap.pcuigp.xssutils.pernr.FcEmployeeServicesInterface.onInit(FcEmployeeServicesInterface.java:135)
         at com.sap.pcuigp.xssutils.pernr.wdp.InternalFcEmployeeServicesInterface.onInit(InternalFcEmployeeServicesInterface.java:183)
         at com.sap.pcuigp.xssutils.pernr.wdp.InternalFcEmployeeServicesInterface$External.onInit(InternalFcEmployeeServicesInterface.java:243)
         at com.sap.pcuigp.xssfpm.wd.FPMComponent$FPM.attachComponentToUsage(FPMComponent.java:922)
         at com.sap.pcuigp.xssfpm.wd.FPMComponent$FPM.attachComponentToUsage(FPMComponent.java:891)
         at com.sap.pcuigp.xssfpm.wd.FPMComponent$FPMProxy.attachComponentToUsage(FPMComponent.java:1084)
         at com.sap.xss.hr.rem2.selection.VcRem2Selection.onInit(VcRem2Selection.java:228)
         at com.sap.xss.hr.rem2.selection.wdp.InternalVcRem2Selection.onInit(InternalVcRem2Selection.java:249)
         at com.sap.xss.hr.rem2.selection.VcRem2SelectionInterface.onInit(VcRem2SelectionInterface.java:161)
         at com.sap.xss.hr.rem2.selection.wdp.InternalVcRem2SelectionInterface.onInit(InternalVcRem2SelectionInterface.java:144)
         at com.sap.xss.hr.rem2.selection.wdp.InternalVcRem2SelectionInterface$External.onInit(InternalVcRem2SelectionInterface.java:220)
         at com.sap.pcuigp.xssfpm.wd.FPMComponent.doProcessEvent(FPMComponent.java:564)
         at com.sap.pcuigp.xssfpm.wd.FPMComponent.doEventLoop(FPMComponent.java:438)
         at com.sap.pcuigp.xssfpm.wd.FPMComponent.wdDoInit(FPMComponent.java:196)
         at com.sap.pcuigp.xssfpm.wd.wdp.InternalFPMComponent.wdDoInit(InternalFPMComponent.java:110)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.doInit(DelegatingComponent.java:108)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.init(ClientComponent.java:430)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:362)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:756)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:291)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingPortal(ClientSession.java:733)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:668)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.clientserver.session.core.ApplicationHandle.doProcessing(ApplicationHandle.java:73)
         at com.sap.tc.webdynpro.portal.pb.impl.AbstractApplicationProxy.sendDataAndProcessActionInternal(AbstractApplicationProxy.java:869)
         at com.sap.tc.webdynpro.portal.pb.impl.AbstractApplicationProxy.create(AbstractApplicationProxy.java:229)
         at com.sap.portal.pb.PageBuilder.updateApplications(PageBuilder.java:1344)
         at com.sap.portal.pb.PageBuilder.createPage(PageBuilder.java:356)
         at com.sap.portal.pb.PageBuilder.init(PageBuilder.java:549)
         at com.sap.portal.pb.PageBuilder.wdDoRefresh(PageBuilder.java:593)
         at com.sap.portal.pb.PageBuilder$1.doPhase(PageBuilder.java:865)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processPhaseListener(WindowPhaseModel.java:755)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doPortalDispatch(WindowPhaseModel.java:717)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:136)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:684)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
         at com.sap.engine
    thanks & regards...
    Gaurav Makin
    Edited by: Gaurav Makin on Jan 6, 2010 9:19 AM
    Edited by: Gaurav Makin on Jan 6, 2010 9:20 AM

    Gaurav, the NullPointerException is common error, mostly caused by bad information in master data or any missing customizing.
    I suggest you first check this application with another users to discard errors in master data.
    Next, check the customizing for salary statement; are you maintaining HRFOR feature? If you're using HRFORM, check if Form is active in HRFORMS transaction.
    Then please tell us if you solved the issue.
    Regards

  • Java.lang.OutOfMemoryError and PermGen errors

    We are getting outOfMemoryErrors and cannot find the cause. Does anybody know how to solve this? Every day we get OutOfMemory and PermGen errors, and nobody seems to be able to solve them. This is from our logs:
    <2008-11-18 13:45:04,627> <ERROR> <crps.collaxa.cube.engine.dispatch> <DispatchHelper::handleMessage> failed to handle message
    javax.ejb.EJBException: java.lang.OutOfMemoryError
         at com.evermind.server.ejb.EJBUtils.getLocalUserException(EJBUtils.java:317)
         at com.evermind.server.ejb.interceptor.system.AbstractTxInterceptor.convertAndHandleMethodException(AbstractTxInterceptor.java:73)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at CubeDeliveryBean_LocalProxy_4bin6i8.resolveCallback(Unknown Source)
         at com.collaxa.cube.engine.dispatch.message.delivery.ResolveCallbackMessageHandler.handle(ResolveCallbackMessageHandler.java:46)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:138)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at oracle.j2ee.connector.messageinflow.MessageEndpointImpl.OC4J_invokeMethod(MessageEndpointImpl.java:297)
         at WorkerBean_EndPointProxy_4bin6i8.onMessage(Unknown Source)
         at oracle.j2ee.ra.jms.generic.WorkConsumer.run(WorkConsumer.java:268)
         at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
         at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
         at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.OutOfMemoryError
         at java.util.zip.ZipFile.open(Native Method)
         at java.util.zip.ZipFile.<init>(ZipFile.java:203)
         at java.util.jar.JarFile.<init>(JarFile.java:132)
         at java.util.jar.JarFile.<init>(JarFile.java:97)
         at oracle.classloader.SharedJar.doOpen(SharedJar.java:208)
         at oracle.classloader.SharedCodeSource.open(SharedCodeSource.java:1136)
         at oracle.classloader.SharedCodeSource.ensureOpen(SharedCodeSource.java:948)
         at oracle.classloader.SharedCodeSource.getResourceBytes(SharedCodeSource.java:967)
         at oracle.classloader.CodeSourceSearchPolicy.findResourceBytes(CodeSourceSearchPolicy.java:57)
         at oracle.classloader.PolicyClassLoader.findLocalClass(PolicyClassLoader.java:1455)
         at oracle.classloader.SearchPolicy$FindLocal.getClass(SearchPolicy.java:167)
         at oracle.classloader.SearchSequence.getClass(SearchSequence.java:119)
         at oracle.classloader.SearchPolicy.loadClass(SearchPolicy.java:645)
         at oracle.classloader.SearchPolicy$CheckSharedLibraries.getClass(SearchPolicy.java:396)
         at oracle.classloader.SearchSequence.getClass(SearchSequence.java:119)
         at oracle.classloader.PolicyClassLoader.internalLoadClass(PolicyClassLoader.java:1674)
         at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1635)
         at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1620)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:242)
         at java.sql.DriverManager.getCallerClass(DriverManager.java:442)
         at java.sql.DriverManager.getDrivers(DriverManager.java:336)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:587)
         at oracle.oc4j.sql.DriverDataSource.getConnection(DriverDataSource.java:116)
         at oracle.oc4j.sql.DriverDataSource.getConnection(DriverDataSource.java:75)
         at oracle.oc4j.sql.DataSourceConnectionPoolDataSource.getPooledConnection(DataSourceConnectionPoolDataSource.java:57)
         at oracle.oc4j.sql.xa.EmulatedXADataSource.getXAConnection(EmulatedXADataSource.java:92)
         at oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl.createXAConnection(ManagedConnectionFactoryImpl.java:211)
         at oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl.createManagedConnection(ManagedConnectionFactoryImpl.java:170)
         at com.evermind.server.connector.ApplicationConnectionManager.createManagedConnection(ApplicationConnectionManager.java:1377)
         at oracle.j2ee.connector.ConnectionPoolImpl.createManagedConnectionFromFactory(ConnectionPoolImpl.java:327)
         at oracle.j2ee.connector.ConnectionPoolImpl.access$800(ConnectionPoolImpl.java:98)
         at oracle.j2ee.connector.ConnectionPoolImpl$FixedWaitPoolingScheme.getManagedConnection(ConnectionPoolImpl.java:1455)
         at oracle.j2ee.connector.ConnectionPoolImpl.getManagedConnection(ConnectionPoolImpl.java:785)
         at com.evermind.server.connector.ApplicationConnectionManager.getConnectionFromPool(ApplicationConnectionManager.java:1575)
         at com.evermind.server.connector.ApplicationConnectionManager.acquireConnectionContext(ApplicationConnectionManager.java:1520)
         at com.evermind.server.connector.ApplicationConnectionManager.allocateConnection(ApplicationConnectionManager.java:1465)
         at oracle.j2ee.connector.OracleConnectionManager.unprivileged_allocateConnection(OracleConnectionManager.java:238)
         at oracle.j2ee.connector.OracleConnectionManager.allocateConnection(OracleConnectionManager.java:192)
         at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:272)
         at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:200)
         at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:142)
         at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:127)
         at com.collaxa.cube.engine.data.ConnectionFactory$ConnectionFactoryImpl.getConnection(ConnectionFactory.java:336)
         at com.collaxa.cube.engine.data.ConnectionFactory.getConnection(ConnectionFactory.java:140)
         at com.collaxa.cube.engine.adaptors.common.BaseDeliveryPersistenceAdaptor.__loadCallback(BaseDeliveryPersistenceAdaptor.java:368)
         at com.collaxa.cube.engine.adaptors.common.BaseDeliveryPersistenceAdaptor.loadCallback(BaseDeliveryPersistenceAdaptor.java:247)
         at com.collaxa.cube.engine.data.DeliveryPersistenceMgr.loadCallback(DeliveryPersistenceMgr.java:48)
         at com.collaxa.cube.engine.delivery.DeliveryService.resolveCallback(DeliveryService.java:598)
         at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.resolveCallback(CubeDeliveryBean.java:307)
         at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAs(Subject.java:396)
         at com.evermind.server.ThreadState.runAs(ThreadState.java:648)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
         ... 28 more
    <2008-11-18 13:45:04,650> <ERROR> <crps.collaxa.cube.engine.dispatch> <BaseScheduledWorker::process> Failed to handle dispatch message ... exception java.lang.OutOfMemoryError
    java.lang.OutOfMemoryError
         at java.util.zip.ZipFile.open(Native Method)
         at java.util.zip.ZipFile.<init>(ZipFile.java:203)
         at java.util.jar.JarFile.<init>(JarFile.java:132)
         at java.util.jar.JarFile.<init>(JarFile.java:97)
         at oracle.classloader.SharedJar.doOpen(SharedJar.java:208)
         at oracle.classloader.SharedCodeSource.open(SharedCodeSource.java:1136)
         at oracle.classloader.SharedCodeSource.ensureOpen(SharedCodeSource.java:948)
         at oracle.classloader.SharedCodeSource.getResourceBytes(SharedCodeSource.java:967)
         at oracle.classloader.CodeSourceSearchPolicy.findResourceBytes(CodeSourceSearchPolicy.java:57)
         at oracle.classloader.PolicyClassLoader.findLocalClass(PolicyClassLoader.java:1455)
         at oracle.classloader.SearchPolicy$FindLocal.getClass(SearchPolicy.java:167)
         at oracle.classloader.SearchSequence.getClass(SearchSequence.java:119)
         at oracle.classloader.SearchPolicy.loadClass(SearchPolicy.java:645)
         at oracle.classloader.SearchPolicy$CheckSharedLibraries.getClass(SearchPolicy.java:396)
         at oracle.classloader.SearchSequence.getClass(SearchSequence.java:119)
         at oracle.classloader.PolicyClassLoader.internalLoadClass(PolicyClassLoader.java:1674)
         at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1635)
         at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1620)
         at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1050)
         at java.util.ResourceBundle.findBundle(ResourceBundle.java:925)
         at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:762)
         at java.util.ResourceBundle.getBundle(ResourceBundle.java:699)
         at com.collaxa.cube.CubeException.getResourceBundle(CubeException.java:142)
         at com.collaxa.cube.engine.dispatch.DispatchException.<clinit>(DispatchException.java:39)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:171)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at oracle.j2ee.connector.messageinflow.MessageEndpointImpl.OC4J_invokeMethod(MessageEndpointImpl.java:297)
         at WorkerBean_EndPointProxy_4bin6i8.onMessage(Unknown Source)
         at oracle.j2ee.ra.jms.generic.WorkConsumer.run(WorkConsumer.java:268)
         at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
         at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
         at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)
    <2008-11-18 13:45:07,781> <ERROR> <crps.collaxa.cube.engine.dispatch> <DispatchHelper::handleMessage> failed to handle message
    javax.ejb.EJBException: java.lang.OutOfMemoryError
         at com.evermind.server.ejb.EJBUtils.getLocalUserException(EJBUtils.java:317)
         at com.evermind.server.ejb.interceptor.system.AbstractTxInterceptor.convertAndHandleMethodException(AbstractTxInterceptor.java:73)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at CubeDeliveryBean_LocalProxy_4bin6i8.resolveCallback(Unknown Source)
         at com.collaxa.cube.engine.dispatch.message.delivery.ResolveCallbackMessageHandler.handle(ResolveCallbackMessageHandler.java:46)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:138)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at oracle.j2ee.connector.messageinflow.MessageEndpointImpl.OC4J_invokeMethod(MessageEndpointImpl.java:297)
         at WorkerBean_EndPointProxy_4bin6i8.onMessage(Unknown Source)
         at oracle.j2ee.ra.jms.generic.WorkConsumer.run(WorkConsumer.java:268)
         at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
         at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
         at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.OutOfMemoryError
         at java.util.zip.ZipFile.open(Native Method)
         at java.util.zip.ZipFile.<init>(ZipFile.java:203)
         at java.util.jar.JarFile.<init>(JarFile.java:132)
         at java.util.jar.JarFile.<init>(JarFile.java:97)
         at oracle.classloader.SharedJar.doOpen(SharedJar.java:208)
         at oracle.classloader.SharedCodeSource.open(SharedCodeSource.java:1136)
         at oracle.classloader.SharedCodeSource.ensureOpen(SharedCodeSource.java:948)
         at oracle.classloader.SharedCodeSource.getResourceBytes(SharedCodeSource.java:967)
         at oracle.classloader.CodeSourceSearchPolicy.findResourceBytes(CodeSourceSearchPolicy.java:57)
         at oracle.classloader.PolicyClassLoader.findLocalClass(PolicyClassLoader.java:1455)
         at oracle.classloader.SearchPolicy$FindLocal.getClass(SearchPolicy.java:167)
         at oracle.classloader.SearchSequence.getClass(SearchSequence.java:119)
         at oracle.classloader.SearchPolicy.loadClass(SearchPolicy.java:645)
         at oracle.classloader.SearchPolicy$CheckSharedLibraries.getClass(SearchPolicy.java:396)
         at oracle.classloader.SearchSequence.getClass(SearchSequence.java:119)
         at oracle.classloader.PolicyClassLoader.internalLoadClass(PolicyClassLoader.java:1674)
         at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1635)
         at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1620)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:242)
         at java.sql.DriverManager.getCallerClass(DriverManager.java:442)
         at java.sql.DriverManager.getDrivers(DriverManager.java:336)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:587)
         at oracle.oc4j.sql.DriverDataSource.getConnection(DriverDataSource.java:116)
         at oracle.oc4j.sql.DriverDataSource.getConnection(DriverDataSource.java:75)
         at oracle.oc4j.sql.DataSourceConnectionPoolDataSource.getPooledConnection(DataSourceConnectionPoolDataSource.java:57)
         at oracle.oc4j.sql.xa.EmulatedXADataSource.getXAConnection(EmulatedXADataSource.java:92)
         at oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl.createXAConnection(ManagedConnectionFactoryImpl.java:211)
         at oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl.createManagedConnection(ManagedConnectionFactoryImpl.java:170)
         at com.evermind.server.connector.ApplicationConnectionManager.createManagedConnection(ApplicationConnectionManager.java:1377)
         at oracle.j2ee.connector.ConnectionPoolImpl.createManagedConnectionFromFactory(ConnectionPoolImpl.java:327)
         at oracle.j2ee.connector.ConnectionPoolImpl.access$800(ConnectionPoolImpl.java:98)
         at oracle.j2ee.connector.ConnectionPoolImpl$FixedWaitPoolingScheme.getManagedConnection(ConnectionPoolImpl.java:1455)
         at oracle.j2ee.connector.ConnectionPoolImpl.getManagedConnection(ConnectionPoolImpl.java:785)
         at com.evermind.server.connector.ApplicationConnectionManager.getConnectionFromPool(ApplicationConnectionManager.java:1575)
         at com.evermind.server.connector.ApplicationConnectionManager.acquireConnectionContext(ApplicationConnectionManager.java:1520)
         at com.evermind.server.connector.ApplicationConnectionManager.allocateConnection(ApplicationConnectionManager.java:1465)
         at oracle.j2ee.connector.OracleConnectionManager.unprivileged_allocateConnection(OracleConnectionManager.java:238)
         at oracle.j2ee.connector.OracleConnectionManager.allocateConnection(OracleConnectionManager.java:192)
         at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:272)
         at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:200)
         at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:142)
         at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:127)
         at com.collaxa.cube.engine.data.ConnectionFactory$ConnectionFactoryImpl.getConnection(ConnectionFactory.java:336)
         at com.collaxa.cube.engine.data.ConnectionFactory.getConnection(ConnectionFactory.java:140)
         at com.collaxa.cube.engine.adaptors.common.BaseDeliveryPersistenceAdaptor.__loadCallback(BaseDeliveryPersistenceAdaptor.java:368)
         at com.collaxa.cube.engine.adaptors.common.BaseDeliveryPersistenceAdaptor.loadCallback(BaseDeliveryPersistenceAdaptor.java:247)
         at com.collaxa.cube.engine.data.DeliveryPersistenceMgr.loadCallback(DeliveryPersistenceMgr.java:48)
         at com.collaxa.cube.engine.delivery.DeliveryService.resolveCallback(DeliveryService.java:598)
         at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.resolveCallback(CubeDeliveryBean.java:307)
         at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAs(Subject.java:396)
         at com.evermind.server.ThreadState.runAs(ThreadState.java:648)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
         ... 28 more
    <2008-11-18 13:45:07,782> <ERROR> <crps.collaxa.cube.engine.dispatch> <BaseScheduledWorker::process> Failed to handle dispatch message ... exception java.lang.NoClassDefFoundError
    java.lang.NoClassDefFoundError
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:171)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at oracle.j2ee.connector.messageinflow.MessageEndpointImpl.OC4J_invokeMethod(MessageEndpointImpl.java:297)
         at WorkerBean_EndPointProxy_4bin6i8.onMessage(Unknown Source)
         at oracle.j2ee.ra.jms.generic.WorkConsumer.run(WorkConsumer.java:268)
         at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
         at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
         at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)

    Marc Kelderman wrote:
    Make sure you set in heap size correctly.
    I do not know how large the heap size is. But I suggest to increase is.
    Oracle EM -> oc4j_soa -> administrtation -> Server
    set min / max equal to 1GB
    and the -XX:MaxPermSize is 256 M
    Marc
    >Make sure you set in heap size correctly.
    I do not know how large the heap size is. But I suggest to increase is.
    Oracle EM -> oc4j_soa -> administrtation -> Server
    set min / max equal to 1GB
    and the -XX:MaxPermSize is 256 M
    Marc
    Hi Tlwi and Marc,
    Im facing the same error in my environment. This is an Oracle Application Server which hosts a J2EE envionment. The application works fine without any issues, but all of a sudden the following error comes up and stalls the application. I have to restart the conatiner to handle the situation, but this is not the solution.
    Based on my searching it reveals that this error does not mean that the jvm is running out of heap space instead it uses some memory outside the heap to unzip the zip files.
    Can you let me know on the solution that you had applied or what can be done to fix this as i have enough heap space.
    09/03/11 14:58:23.851 APPNAME: Servlet error
    java.lang.OutOfMemoryError
         at java.util.zip.ZipFile.open(Native Method)
         at java.util.zip.ZipFile.<init>(ZipFile.java:203)
         at java.util.jar.JarFile.<init>(JarFile.java:132)
         at java.util.jar.JarFile.<init>(JarFile.java:97)
         at oracle.classloader.SharedJar.doOpen(SharedJar.java:208)
         at oracle.classloader.SharedCodeSource.open(SharedCodeSource.java:1136)
    Thanks,

  • Java.lang.parseInt() and NT???

    Please help;
    When I compile It is fine but when I run it it gives this message.
    C:\jdk1.3.1_01\Html\classes>java myRectangle1
    Enter Width:
    34
    java.lang.NumberFormatException: 34
    at java.lang.Integer.parseInt(Integer.java:423)
    at java.lang.Integer.valueOf(Integer.java:516)
    at RecHW.run(myRectangle1.java:16)
    at java.lang.Thread.run(Thread.java:484)
    Here is the source code:
    import java.io.*;
    import java.lang.*;
    import Shapes.Rectangle;
    class RecHW implements Runnable {
    Rectangle rect;
    Thread kicker=null;
    public void run() {
    try {
    int w,h;
    char ch;
    StringBuffer str=new StringBuffer();
    System.out.println("Enter Width:");
    while((ch = (char)System.in.read())!='\n') {
    str.append(ch);
    w = Integer.valueOf(str.toString()).intValue();
    System.out.println("2");
    System.out.println("Enter Height:");
    str=new StringBuffer();
    while((ch=(char)System.in.read())!='\n') {
    str.append(ch);
    h = Integer.valueOf(str.toString()).intValue();
    Rectangle rect=new Rectangle(w,h);
    rect.setWH(w,h);
    rect.drawRect();
    } catch (IOException e) {
    System.out.println("Here");
    public void start(Rectangle r) {
    rect=r;
    kicker=new Thread(this);
    kicker.start();
    class myRectangle1 {
    public static void main(String args[]) {
    RecHW rec=new RecHW();
    new Thread(rec).start();

    Can you tell me why an applet like this
    <applet codebase="http://java.sun.com/applets/jdk/1.1/demo/NervousText"code="NervousText.class" width=400 height=75>
    <param name="text" value="Welcome to HotJavaTM Browser!">
    <hr>
    If you were using a JavaTM technology-enabled browser such as HotJava,
    you would see dancing text instead of this paragraph.
    <hr>
    </applet>
    works fine when it is loaded and when I change codebase related to a file on my computer and change the code which runs fine as a standalone, then the html page does not give what it was expected to do?
    Thanks!

  • Help required on java.lang.StackOverFlowError and static initializer

    I wanted to create an instance of a class that contains another instance of the same class. So I wrote:
    class A {
         A z = new A ();     
         void display () {
              System.out.println ("Hello World");
         public static void main (String [] args) {
              A y = new A();
              y.display ();
    }During execution I got java.lang.StackOverFlowError. But if I put a static initializer, it works fine. Here is the code using static initializer.
    class A {
         static{
              A z = new A ();     
         void display () {
              System.out.println ("Hello World");
         public static void main (String [] args) {
              A y = new A();
              y.display ();
    }Could anyone please help me to understand the logic why "java.lang.StackOverFlowError" is happening here and how the same program runs fine by putting a static initializer ?
    Regards,
    Shambhu

    Could anyone please help me to understand the logic
    why "java.lang.StackOverFlowError" is happening hereWhen you instantiate an A object with A y = new A () then A z = new A () also gets executed inside the A class, which in it's turn executes A z = new A () again, and again, and again...
    and how the same program runs fine by putting a
    static initializer ?Because the static block gets executed only once.
    The use of class- and instance variables is explained in more detail here:
    http://java.sun.com/docs/books/tutorial/java/javaOO/classvars.html

  • Java.lang.NullPointerException and ConnectionPool problem

    refresh page , problem gone
    java.lang.NullPointerException
    at Deferment.UpdatePostgraduate.getStatus(UpdatePostgraduate.java:278)
    at Deferment.UpdatePostgraduate.doPost(UpdatePostgraduate.java:175)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:402)
    at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:170)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    UpdatePostgraduate.java:278
    ->while (rs.next()) {
    175-> tarCount=getStatus(userid);
    now I have
    Connection conn = null;
    CallableStatement calstat=null;
    ResultSet rs = null;
    in every of my function
    and my
    public Connection getConnection()         throws SQLException, ServletException       {           Connection conn = null;           try{           pool.getConnection();           }catch (SQLException sqle) {             throw new ServletException(sqle.getMessage());         }           return conn;       }

    private DataSource pool = null; 
        int tarCount;
        int sendMail;
        @Override
        public void init() throws ServletException {
            Context env = null;
            try {
                env = (Context) new InitialContext().lookup("java:comp/env");
                pool = (DataSource) env.lookup("jdbc/test");
                if (pool == null) {
                    throw new ServletException(
                            "'jdbc/test' is an unknown DataSource");            }
            } catch (NamingException ne) {
                throw new ServletException(ne);
          public Connection getConnection()
            throws SQLException, ServletException
              Connection conn = null;
              try{
             conn=pool.getConnection();
              }catch (SQLException sqle) {
                System.out.println("JDBC error:" + sqle.getMessage());
                sqle.printStackTrace();
              return conn;
          }then on every function I call it like
    private int getFound(String UNumber) throws Exception {
            Connection conn = null;
            CallableStatement calstat=null;
            ResultSet rs = null;
            try {
                conn = pool.getConnection();
                calstat = (CallableStatement) conn.prepareCall("{call DuplicatePost(?)}");
                calstat.setString(1, UNumber);
                rs = calstat.executeQuery();
                tarCount = 0;
                while (rs.next()) {
                    tarCount++;
            } catch (SQLException se) {
                System.out.println("JDBC error:" + se.getMessage());
                se.printStackTrace();
            } catch (Exception e) {
                System.out.println("other error:" + e.getMessage());
                e.printStackTrace();
            } finally {
                try {
                    if (rs != null) {
                        rs.close();
                    if (calstat != null) {
                        calstat.close();
                } catch (SQLException e) {
                    e.printStackTrace();
            } //end finally
            return tarCount;
        }// end function
    }// end

Maybe you are looking for

  • IPod touch 1st generation unresponsive

    I have an iPod touch 1st generation, it has a white screen, is unresponsive, and will not connect to my computer, I am at a loss as to how to fix it. Can anyone help?

  • USB to Firewire Adapter

    I'm considering a MacBook Air. I have two Firewire backup hard drives and a original iPod that also uses Firewire. Is there a simple USB to Firewire adapter to enable use of these items from a MBA?

  • [Solved] Python: Creating AUR package, binary can't find python module

    I'm building a PKGBUILD for PyLotRO for the AUR and I'm using a Debian package.  I tried just copying the content of the data.tar.gz to the filesystem assuming the directory structure is the same for the packages but apparently it is not.  At least I

  • What are the differences of the following titles?

    What are the differences of the following titles? Oracle Database Design Analyst Oracle DBA - Design Oracle DBA Oracle Database Analyst - Design Oracle Database Designer Oracle e-Commerce Database Architect Oracle system administrator Thank you

  • HT1386 when does a merge sync with icloud

    I have added a second Iphone to my i tunes & merged the contacts from it to contacts on my mac but it won't synchronise with icloud. Previously when I added my original iphone to contacts in outlook (windows XP) all my contacts on outlook were delete