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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:34:31+00:00 2026-06-17T19:34:31+00:00

I am having a run method which tries to override another run method. But

  • 0

I am having a run method which tries to override another run method. But its not happening because I am getting a “Class not found Exception” before it passed on to run method.

Here´s my class with run method

How could I get this over ride the run method.

the class which I have to call in order to execute.

    public abstract class MessageProcessor implements Runnable {
private Collection<KpiMessage> fetchedMessages;
private Connection dbConnection;
Statement st = null;
ResultSet rs = null;
PreparedStatement pstmt = null;
private Collection<KpiMessage> outgoingQueue;


public KpiMsg804 MessageProcessor(Collection<KpiMessage> outgoingQueue, Connection
 dbConnection){
    this.outgoingQueue = outgoingQueue;
    this.dbConnection = dbConnection;
    return (KpiMsg804) fetchedMessages;
}

    public Collection<KamMessage> generate(Collection<KamMessage> outgoingQueue)
   {
    while(true){
        try {

            while (rs.next()) {
                KamMessage filedClass = convertRecordsetToPojo(rs);
                outgoingQueue.add(filedClass);

            }

            for (KamMessage pojoClass : outgoingQueue) {
                KamMsg804 updatedValue = createKamMsg804(pojoClass);
                System.out.print(" " + pojoClass.getSequence());
                System.out.print(" " + pojoClass.getTableName());
                System.out.print(" " + pojoClass.getAction());
                System.out.print(" " + updatedValue.getKeyInfo1());
                System.out.print(" " + updatedValue.getKeyInfo2());
                System.out.println(" " + pojoClass.getEntryTime());
            }
            return outgoingQueue;

        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }

}

}

  • 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-17T19:34:32+00:00Added an answer on June 17, 2026 at 7:34 pm

    In your code you are creating a default-visibility field inside a class, and not overriding the run() method. Just stick to:

    MessageProcessor processor = new MessageProcessor() {
      @Override
      final public void run() {
        MessageProcessor(outgoingQueue).generate(outgoingQueue);                    
      }
    };
    

    And remove the outer MessageProcessor declaration.

    I made a subset of your code:

    public class PollingSynchronizer {
      public static void main(String[] args) {
        MessageProcessor message = new MessageProcessor() {
          MessageProcessor message = new MessageProcessor() {
            public void run() {
              System.out.println("new run");
            }
          };
        };
    
        new Thread(message).start();
      }
    }
    
    class MessageProcessor implements Runnable {
      public void run() { System.out.println("old run"); }
    }
    

    Which will print old run because the first MessageProcessor::run() it is not really being overwritten.

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

Sidebar

Related Questions

I'm having trouble getting the onServiceConnected() method to run, which means that it's not
I've run into problems on numerous occasions of users not having one of the
I keep getting a Run Time error that says I am having an Exception
I'm having trouble getting OpenGL 3.2 to run on Lion (osx 10.7.4) using Derelict3
I'm having trouble getting the Apache Camel plugin to run in grails-1.1.1. Here's the
I've got a bunch of server requests which I can run asynchronously, but I
I'm having trouble finding out how to run a method in a seperate thread
I'm having the following method in an applet which is called via JavaScript public
I am using pdb to examine a script having called run -d in an
Okay this is my first WPF app and I am having a hard run

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.