Guice configuration errors

Hello,
When I get to this line :

OrderedTaskService orderedTaskService = Beans.get(OrderedTaskService.class);

I get this error :

com.google.inject.ConfigurationException: Guice configuration errors:

1) No implementation for com.axelor.apps.ordered.service.OrderedTaskService was bound.
  while locating com.axelor.apps.ordered.service.OrderedTaskService

Can someone tell me what mistake I made?

Thanks

The services should be configured with a special class called Guice module
https://docs.axelor.com/adk/5.4/dev-guide/modules/coding.html#configuration

Hi PaKMax,

package com.axelor.apps.ordered.module;

import com.axelor.app.AxelorModule;
import com.axelor.apps.ordered.service.OrderedTaskService;
import com.axelor.apps.ordered.service.OrderedTaskServiceImpl;

public class TaskModule extends AxelorModule {

  @Override
  protected void configure() {
    bind(OrderedTaskService.class).to(OrderedTaskServiceImpl.class);
  }
}

I’ve done it before, and I’ve never had this problem since the beginning of the project. I always do the same… Can we reset the bind?

For information I use eclipse.

Hi @Linuxien ,

When I make significant changes in the application: new domains, new services, etc., I do the following:

  1. Delete the build directory (and possibly bin) under the application directory.

  2. Rebuild the app
    ./gradlew cleanEclipse eclipse
    ./gradlew build -xtest

  3. Then, in Eclipse, delete the projects from the workspace (but be careful not to check delete contents, you would delete the sources)

  4. Reimport previously rebuilt projects (uncheck modules)

Wait for workspace refresh

  1. Generally I have to recreate the webapp folder by going to the application, then properties, deployment assembly, create folder, build/webapp

  2. Then to start the server, going through the icons directly does not work, I have to launch by right-clicking on the application, then Debug on Server

Then validate definitively

WARNING :
This procedure works correctly in my development context.
There are probably different procedures…
This procedure must be carried out carefully, especially the first time.
No guarantee can be given on a correct progress, in a different development context.

Hoping this can help you.

2 J'aime

Thanks it’s ok :wink:

Ce sujet a été automatiquement fermé après 30 jours. Aucune réponse n’est permise dorénavant.