Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

189
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!