Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

193
Visualizações
UnsatisfiedDependencyException: Error creating bean with name 'myController'

I am calling a service class: "CustomUserService" from MyController.

 public class MyController{


  private final CustomUserService userService;

  @Autowired
  public MyController(
      CustomUserService userService) {
      this.userService = userService;
  }

The userService is as follows:

    @Service 
public class CustomUserService implements ICustomUserService { 
           @Autowired   public CustomUserService(SpringAuthClientCustom authClient){
              this.authClient = authClient;   } }

My authClient is:

@Service
public class SpringAuthClientCustom extends AbstractCustomSpringClient  {
}

which extends: public abstract class AbstractCustomSpringClient {}

AbstractCustomSpringClient is from the external jar and I have added that to my dependency.

Now, I am getting

Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SpringAuthClientCustom' defined in file [C:\Users..\SpringAuthClientCustom.class]: Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [com.**..AbstractCustomSpringClient ] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@1d44bcfa]

I have added scanBasePackages in the BootAplication:

@SpringBootApplication(
    scanBasePackages = { ""com.externalJar.client.*"}

Still, spring is not able to resolve the dependency. What could be the possible reason? Is it because of the AbstractCustomSpringClient class outside my project ( in the jar) and not defined as @Service?

Thanks

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda