Method call problem

Hello ,
when i make my method call i get this error do you know what it is? I tried changing the method and it’s still the same. Thanks in advance.

java.lang.NoSuchMethodError: com.axelor.apps.contract.service.ContractService.testActif()V
at com.axelor.apps.contract.web.ContractsController.testActif(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at com.axelor.meta.schema.actions.ActionMethod.evaluate(
at com.axelor.meta.schema.actions.Action.execute(
at com.axelor.meta.schema.actions.Action.wrap(
at com.axelor.meta.schema.actions.ActionGroup.evaluate(
at com.axelor.meta.schema.actions.Action.execute(
at com.axelor.meta.schema.actions.Action.wrap(
at com.axelor.meta.ActionHandler.execute(
at com.axelor.meta.ActionExecutor.execute(
at com.axelor.meta.ActionExecutor$$EnhancerByGuice$$90d7ab77.CGLIB$execute$0()
at com.axelor.meta.ActionExecutor$$EnhancerByGuice$$90d7ab77$$FastClassByGuice$$b3c9dd3b.invoke()

I noticed that I had the error only when I added these two lines above the alert() which on its own works. I don’t understand…help plz

public void testActif(ActionRequest request, ActionResponse response) {
ContractService contractService = Beans.get(ContractService.class);
response.setAlert(« Test execute »);

I put a breakpoint in the method, the program does not even render in the testActive() method…

can you share gist about service class

Hi Siddique,

yes and thanks for your help.

My implementation is :

package com.axelor.apps.contract.service;

import com.axelor.apps.contract.db.repo.ContractRepository;
import com.axelor.apps.project.db.repo.ProjectRepository;
import org.slf4j.LoggerFactory;

public class ContractServiceImpl implements ContractService {
  protected final org.slf4j.Logger log = LoggerFactory.getLogger(getClass());

  protected ContractRepository contractRepository;
  // protected ProjectRepository projectRepository;

  public ContractServiceImpl(
      ContractRepository contractRepository, ProjectRepository projectRepository) {
    this.contractRepository = contractRepository;
    //  this.projectRepository = projectRepository;

  public void archiverRecurcif(Long idContrat, boolean etatArchive) {

    System.out.println("it's ok 1");


  public void testActive() {
    System.out.println("test OK");

My interface is :

package com.axelor.apps.contract.service;

public interface ContractService {
  public void archiverRecurcif(Long idContrat, boolean etatArchive);

  public void testActive();

You forget to bind your service in the Axelor Module file

Use this :

protected void configure() {

in a file at the root of your module. This file can be named by what you want but must extends the AxelorModule class.

Example file :

Hi PHPierre,

Thanks but I had already implemented this class. So the problem doesn’t seem to come from there.

package com.axelor.apps.contract.module;

import com.axelor.apps.contract.service.ContractService;
import com.axelor.apps.contract.service.ContractServiceImpl;

public class ContractModule extends AxelorModule {

  protected void configure() {

If you use Eclipse, have you cleared the project cache ?

can you share where are your java files exists

yes i use eclipse and i have clean project. Delete import project but it’s not ok. I try rewrite my method… :’(

I don’t understand

can you share folder structure you adopted

I found the problem by going back to my whole implementation from the beginning. In fact it was a method naming problem in the class of the web package and that of the service. Thank you for your support.