mardi 15 janvier 2019

Canno't find job constructor

I need to obtain a reference to my job class for to execute some methods. I use reflection

JobLast last=....;

  Class<Answer> jobClassName = (Class<Answer>) Class.forName(last.getJob_type());

        Class parameter[] = { String.class, BigDecimal.class, String.class };

       //This is give me error
        Constructor<Answer> costruttore = jobClassName.getConstructor(parameter);

       org.quartz.JobExecutionException:[See nested exception:  Cjob constructor doesn't find]

the answer class is:

 public Answer(String writer, BigDecimal id, String username) {
    super(writer, id, username);
  }

Anyone can help me?





Aucun commentaire:

Enregistrer un commentaire