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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:13:05+00:00 2026-06-02T15:13:05+00:00

So I was setting up a custom ApplicationEvent and ApplicationListener for my Spring batch

  • 0

So I was setting up a custom ApplicationEvent and ApplicationListener for my Spring batch program. I followed the instructions here at section 3.13.2

Here is the ApplicationEvent I created

import org.springframework.context.ApplicationEvent;

public class DataReaderEvent extends ApplicationEvent {

  private final String progress;
  private final String text;

  public DataReaderEvent(Object source, String progress, String text) {
      super(source);
      this.progress = progress;
      this.text = text;
  }

  public String getProgress() {
      return progress;
  }

  public String getText() {
      return text;
  }

}

And my ApplicationListener

import org.springframework.context.ApplicationListener;

public class DataReaderNotifier implements ApplicationListener<DataReaderEvent> {

  private String progress;
  private String text;


  @Override
  public void onApplicationEvent(DataReaderEvent event) {
      this.progress = event.getProgress();
      this.text = event.getText();
  }

  public String getProgress() {
      return progress;
  }

  public String getText() {
      return text;
  }
}  

The problem I am having is that the ApplicationListener complains about me trying to do
ApplicationListener < DataReaderEvent >

it says,
“The type ApplicationListener is not generic; it cannot be parameterized with arguments DataEventReader”

I don’t understand why this would be the case because I think I followed the example pretty closely. If anyone has any ideas they would be greatly appreciated.

  • 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-02T15:13:07+00:00Added an answer on June 2, 2026 at 3:13 pm

    Are you sure you have the right (3.0.x+) version of Spring included in your project? I think in 2.5.x ApplicationListener was not generic, so if you’re accidentally using that older version then that would cause the problem you’re having.

    http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/context/ApplicationListener.html

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

Sidebar

Related Questions

I'm setting a custom StatusDescription in a RESTful WCF service when an exception is
I'm setting a custom banner and dialog image for my WiX generated MSI. <WixVariable
I'm having trouble setting a custom back button. Below is the current code I'm
I would like to read custom setting which i have done in ServiceConfiguration.cscfg &
I have a application for android 2.3.3 where I am setting some custom titles
I'm setting up a custom blog that grabs the posts from a mysql database.
I'm creating a JSpinner and setting a NumberEditor with a custom format. But no
I am trying to save a custom object as a user setting in a
To run a program with custom env settings, we do this on Linux $
I encountered a weird problem setting a custom date format with PHPExcel: I'm writing

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.