Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9196173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:47:36+00:00 2026-06-17T21:47:36+00:00

I’m continuously receiving this error when trying to run my program. Exception in thread

  • 0

I’m continuously receiving this error when trying to run my program.

Exception in thread "main" java.lang.StackOverflowError

at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:244)
at javax.swing.UIDefaults.getUI(UIDefaults.java:752)
at javax.swing.UIManager.getUI(UIManager.java:1001)
at javax.swing.JPanel.updateUI(JPanel.java:109)
at javax.swing.JPanel.<init>(JPanel.java:69)
at javax.swing.JPanel.<init>(JPanel.java:92)
at javax.swing.JPanel.<init>(JPanel.java:100)
at serverProperties.<init>(serverProperties.java:164)
at exportProperties.<init>(exportProperties.java:8)
at serverProperties.<init>(serverProperties.java:162)

It only happens after trying to access a method from a certain class.

This is the main class:

public class serverProperties extends JPanel
{
    //Add classes
    exportProperties writeProperties = new exportProperties();

    //Assume I created the array sent to the exportProperties class

    public serverProperties()
    {
        CheckBoxListener checkListener = new CheckBoxListener();

        //Assume I created the check box and added the listener for it
    }


    private class CheckBoxListener implements ItemListener
    {

        public void itemStateChanged (ItemEvent event)
        {
            JCheckBox checkBox;
            checkBox= (JCheckBox)event.getSource();

            //Process check Boxes
            if (checkBox.isSelected())
            {
                checkBox.setText("Yes");
                writeProperties.exportFile(propertiesArr);
            }
        }
    }
}

This is the code for the class accessed by the code above:

public class exportProperties extends serverProperties
{


    public void exportProperties(String[] args)
    {
        exportFile(args);
    }

    public static void exportFile(String[] propertiesArr)
    {
        try
        {
            FileWriter outFile = new FileWriter("Path/file.txt");
            BufferedWriter out = new BufferedWriter(outFile);

            //Loop through properties
            for (int i=0; i < 27; i++)
            {
                out.append(propertiesArr[i]);
            }
            //out.write("Test");
            out.close();

        }
        catch (IOException exception)
        {
            exception.printStackTrace();
        }
    }

    public void importFile()
    {

    }


}

Once I remove the call to the exportProperties class the program work perfectly.
With the error message, the last two lines

at exportProperties.<init>(exportProperties.java:8)
at serverProperties.<init>(serverProperties.java:162)

they repeat MANY times before it just ends.

I’ve googled, and googled, I’ve got no idea what is going on..
I appreciate the help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:47:37+00:00Added an answer on June 17, 2026 at 9:47 pm

    Your serverProperties class has this:

    exportProperties writeProperties = new exportProperties();
    

    … which creates an instance of exportProperties. But exportProperties extends serverProperties, to constructing an exportProperties will execute the above line again… and so it continues.

    Without knowing what you’re trying to achieve, it’s hard to give very concrete help beyond “don’t do that”. I suspect you shouldn’t be using inheritance here. (It’s not clear why you’re extending JPanel either… try to prefer composition over inheritance.)

    (You should also fix your class names to follow Java conventions…)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.