Discussions
Categories
- 197K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.8K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 556 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.3K Development
- 17 Developer Projects
- 139 Programming Languages
- 293K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 158 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 468 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
error in java

Tony007
Member Posts: 4,248 Bronze Trophy
hi am geting this error in my application
C:\Spring5\spring-reciept-app>mvn compile[INFO] Scanning for projects...[INFO][INFO] -------------------< com.reciept:spring-reciept-app >-------------------[INFO] Building spring-reciept-app 0.0.1-SNAPSHOT[INFO] --------------------------------[ jar ]---------------------------------[INFO][INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ spring-reciept-app ---[INFO] Using 'UTF-8' encoding to copy filtered resources.[INFO] Copying 1 resource[INFO] Copying 1 resource[INFO][INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ spring-reciept-app ---[INFO] Changes detected - recompiling the module![INFO] Compiling 8 source files to C:\Spring5\spring-reciept-app\target\classes[INFO] Some messages have been simplified; recompile with -Xdiags:verbose to get full output[INFO] -------------------------------------------------------------[ERROR] COMPILATION ERROR :[INFO] -------------------------------------------------------------[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/TasksApplication.java:[24,31] constructor Task in class org.springframework.scheduling.config.Task cannot be applied to given types; required: java.lang.Runnable found: long,java.lang.String,java.time.LocalDate,boolean reason: actual and formal argument lists differ in length[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/TasksApplication.java:[25,31] constructor Task in class org.springframework.scheduling.config.Task cannot be applied to given types; required: java.lang.Runnable found: long,java.lang.String,java.time.LocalDate,boolean reason: actual and formal argument lists differ in length[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/TasksApplication.java:[26,31] constructor Task in class org.springframework.scheduling.config.Task cannot be applied to given types; required: java.lang.Runnable found: long,java.lang.String,java.time.LocalDate,boolean reason: actual and formal argument lists differ in length[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/TasksApplication.java:[27,31] constructor Task in class org.springframework.scheduling.config.Task cannot be applied to given types; required: java.lang.Runnable found: long,java.lang.String,java.time.LocalDate,boolean reason: actual and formal argument lists differ in length[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/TasksApplication.java:[28,31] constructor Task in class org.springframework.scheduling.config.Task cannot be applied to given types; required: java.lang.Runnable found: long,java.lang.String,java.time.LocalDate,boolean reason: actual and formal argument lists differ in length[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/TasksApplication.java:[29,31] constructor Task in class org.springframework.scheduling.config.Task cannot be applied to given types; required: java.lang.Runnable found: long,java.lang.String,java.time.LocalDate,boolean reason: actual and formal argument lists differ in length[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/TasksApplication.java:[30,31] constructor Task in class org.springframework.scheduling.config.Task cannot be applied to given types; required: java.lang.Runnable found: long,java.lang.String,java.time.LocalDate,boolean reason: actual and formal argument lists differ in length[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/TasksApplication.java:[31,31] constructor Task in class org.springframework.scheduling.config.Task cannot be applied to given types; required: java.lang.Runnable found: long,java.lang.String,java.time.LocalDate,boolean reason: actual and formal argument lists differ in length[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/Controller/TaskController.java:[21,37] incompatible types: java.lang.Iterable<org.springframework.scheduling.config.Task> cannot be converted to java.lang.Iterable<javafx.concurrent.Task>[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/Controller/TaskController.java:[26,38] incompatible types: javafx.concurrent.Task cannot be converted to org.springframework.scheduling.config.Task[INFO] 10 errors[INFO] -------------------------------------------------------------[INFO] ------------------------------------------------------------------------[INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Total time: 11.558 s[INFO] Finished at: 2019-09-13T18:18:54+02:00[INFO] ------------------------------------------------------------------------[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project spring-reciept-app: Compilation failure: Compilation failure:[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/TasksApplication.java:[24,31] constructor Task in class org.springframework.scheduling.config.Task cannot be applied to given types;[ERROR] required: java.lang.Runnable[ERROR] found: long,java.lang.String,java.time.LocalDate,boolean[ERROR] reason: actual and formal argument lists differ in length[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/TasksApplication.java:[25,31] constructor Task in class org.springframework.scheduling.config.Task cannot be applied to given types;[ERROR] required: java.lang.Runnable[ERROR] found: long,java.lang.String,java.time.LocalDate,boolean[ERROR] reason: actual and formal argument lists differ in length[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/TasksApplication.java:[26,31] constructor Task in class org.springframework.scheduling.config.Task cannot be applied to given types;[ERROR] required: java.lang.Runnable[ERROR] found: long,java.lang.String,java.time.LocalDate,boolean[ERROR] reason: actual and formal argument lists differ in length[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/TasksApplication.java:[27,31] constructor Task in class org.springframework.scheduling.config.Task cannot be applied to given types;[ERROR] required: java.lang.Runnable[ERROR] found: long,java.lang.String,java.time.LocalDate,boolean[ERROR] reason: actual and formal argument lists differ in length[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/TasksApplication.java:[28,31] constructor Task in class org.springframework.scheduling.config.Task cannot be applied to given types;[ERROR] required: java.lang.Runnable[ERROR] found: long,java.lang.String,java.time.LocalDate,boolean[ERROR] reason: actual and formal argument lists differ in length[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/TasksApplication.java:[29,31] constructor Task in class org.springframework.scheduling.config.Task cannot be applied to given types;[ERROR] required: java.lang.Runnable[ERROR] found: long,java.lang.String,java.time.LocalDate,boolean[ERROR] reason: actual and formal argument lists differ in length[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/TasksApplication.java:[30,31] constructor Task in class org.springframework.scheduling.config.Task cannot be applied to given types;[ERROR] required: java.lang.Runnable[ERROR] found: long,java.lang.String,java.time.LocalDate,boolean[ERROR] reason: actual and formal argument lists differ in length[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/TasksApplication.java:[31,31] constructor Task in class org.springframework.scheduling.config.Task cannot be applied to given types;[ERROR] required: java.lang.Runnable[ERROR] found: long,java.lang.String,java.time.LocalDate,boolean[ERROR] reason: actual and formal argument lists differ in length[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/Controller/TaskController.java:[21,37] incompatible types: java.lang.Iterable<org.springframework.scheduling.config.Task> cannot be converted to java.lang.Iterable<javafx.concurrent.Task>[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/Controller/TaskController.java:[26,38] incompatible types: javafx.concurrent.Task cannot be converted to org.springframework.scheduling.config.Task[ERROR] -> [Help 1][ERROR][ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
this my code
package com.reciept.springrecieptapp;
import com.reciept.springrecieptapp.services.TaskService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.config.Task;
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
@SpringBootApplication
public class TasksApplication { public static void main(String[] args) { SpringApplication.run(TasksApplication.class, args);
} @Bean
CommandLineRunner runner(TaskService taskService) { return args -> {taskService.save( new Task(1L,"Create Spring Boot Application", LocalDate.now(), true) );
taskService.save( new Task(2L,"Create Spring Project Packages", LocalDate.now().plus(1, ChronoUnit.DAYS), false) );
taskService.save( new Task(3L,"Create the Task Domain Class", LocalDate.now().plus(3,ChronoUnit.DAYS), false) );
taskService.save( new Task(4L,"Create service and repository classes", LocalDate.now().plus(5,ChronoUnit.DAYS), false) );
taskService.save( new Task(5L,"Create the command line runner to load data", LocalDate.now().plus(8, ChronoUnit.DAYS), false) );
taskService.save( new Task(6L,"Create the required configuration properties", LocalDate.now().plus(10,ChronoUnit.DAYS), false) );
taskService.save( new Task(7L,"Run the Spring Boot Application", LocalDate.now().plus(12,ChronoUnit.DAYS), false) );
taskService.save( new Task(8L,"Check the H2 Console for the initial data", LocalDate.now().plus(13,ChronoUnit.DAYS), false) );
};
}
}
Answers
-
The error log tells you exactly what you're doing wrong, just read it.
It says your code is wrong, you're providing the wrong argument types to the constructor for Task. It even tells you what you should be using.
-
This is not an 'error in Java'. It is a compilation error in your code. Check the specifcation of the method you're trying to call.