Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

error in java

Tony007Sep 13 2019 — edited Oct 15 2019

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.sprin

gframework.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.sprin

gframework.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.sprin

gframework.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.sprin

gframework.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.sprin

gframework.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.sprin

gframework.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.sprin

gframework.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.sprin

gframework.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.l

ang.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: Compil

ation failure: Compilation failure:

[ERROR] /C:/Spring5/spring-reciept-app/src/main/java/com/reciept/springrecieptapp/TasksApplication.java:[24,31] constructor Task in class org.sprin

gframework.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.sprin

gframework.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.sprin

gframework.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.sprin

gframework.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.sprin

gframework.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.sprin

gframework.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.sprin

gframework.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.sprin

gframework.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.l

ang.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) );
   };


   }

}

Comments

Processing

Post Details

Added on Sep 13 2019
2 comments
376 views