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 8475301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:51:22+00:00 2026-06-10T17:51:22+00:00

I really don’t know how to explain this error properly… It started when I

  • 0

I really don’t know how to explain this error properly…

It started when I added this method to my controller class:

public void loadPlayerComboBox() {
    try{
        final PreparedStatement collectPlayerNames = 
                ConnectionManager.getConnection().prepareStatement("SELECT "+PLAYER_NAME+"  FROM PLAYERS");
        final ResultSet playerNameResults = collectPlayerNames.executeQuery();
        while(playerNameResults.next()){
            IViewManager.Util.getInstance().getMyContainerPane().getMyPlayerManagerPane().getPlayerNameList()
            .add(playerNameResults.getString(PLAYER_NAME));
        }
    }catch(final SQLException e){
        System.out.println("SQLException. Reason: " + e.getMessage());
    }
}

And I’ve confirmed that without this method (which is called on by a class, on start up of the program) I don’t have an error.

My error? When I run from eclipse, the programe starts to load the top bar of the frame appears, but the actual content doesn’t.

enter image description here

As well as this there is a strange drowing empty box, that I believe is caused by multiple processes being started up.

This, I beleive was caused by a stack overflow, as my getInstance() methods recursively called each other. I can’t get the stacktrace back for some reason, and at the moment the debug screen is just blank. I’ve checked my .log and it doesn’t have an error corresponding to that time stamp. I don’t know how they could call each other though. Here is the ViewManager method:

static class Util {
    static private IViewManager viewManager = null;
    static public synchronized IViewManager getInstance() {
            if (viewManager == null) {
                    viewManager = new ViewManager();
            }
            return viewManager;
    }
}

And the constructor:

public ViewManager(){
    super("Tony Larp DB Manager");
    this.setVisible(true);
    this.setDefaultCloseOperation(3);
    myContainerPane = new ContainerPane();
    myContentMenu = new ContentMenu();
    IController.Util.getInstance();
    IPlayerCharacterManager.Util.getInstance();
    this.setJMenuBar(myContentMenu);
    this.getContentPane().add(myContainerPane);
    this.pack();        
}

The IController.Util.getInstance() method is identical, except the names of the class and objects it calls are different. Double checked locking just causes the first instance of IViewManager.getInstance() in my launcher to return a null pointer, this is at the start of the synchronised block.

To clarify, the programme calls IViewManager.Util.getInstance() the first time in the launcher, then it calls IController.Util.getInstance() for the first time in the above constructor. After that all calls to it should just return instances.

What would cause this sort of error? How can I even start to fix it?

  • 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-10T17:51:24+00:00Added an answer on June 10, 2026 at 5:51 pm

    This sort of behaviour shows you’ve got some sort of infinite loop. Some where you’ve crossed your threads (one method in a thread calls the a method in the other other, which calls the first).

    Neither finishes constructing so your singletons don’t have an instance to call. Instead they keep trying to instantiate each other ad infinitum. Go back and rethink how seperate your singleton code threads are.

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

Sidebar

Related Questions

I really don't know squat about java memory management, so this is entirely my
I really don't know how to explain what's going on, so I'll just show
I really don't like this style of formatting: Class AwesomeClass { private static void
I really don't know how to title this question, but I need some help
I have this json object (which i don't really know what is inside) and
I really don't know how is it possible, and I couldn't reproduce the error
I have this problem and really don't know how to solve this. I'm having
I really don't know how to express this question. But what I'm trying to
I really don't know how to say, may be this is why I didn't
I really don't know what to do anymore... I got this code (tried many

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.