Spring application has a runtime error. RentalImageService instantiates AuthService. The issue is that the authService is not getting instantiated and I am getting a strange error at runtime.
enter image description here
@Service
@AllArgsConstructor
public class RentalImageService {
private final RentalImageRepository rentalImageRepository;
private final S3Service s3Service;
private final S3Bucket s3Bucket;
private final RentalRepository rentalRepository;
private final AuthService authService;
}
@Service
@AllArgsConstructor
@Slf4j
public class AuthService {
private final UserRepository userRepository;
private final PasswordEncoder passwordEncoder;
private final VerificationTokenRepository verificationTokenRepository;
private final RefreshTokenService refreshTokenService;
private final MailService mailService;
private final AuthenticationManager authenticationManager;
private final JwtProvider jwtProvider;
}
When debuggin, there seems to be some issue with RefreshTokenService and MailService being instantiated in the AuthService as well as you can see below:
enter image description here
@Service
@AllArgsConstructor
@Transactional
public class RefreshTokenService {
private final RefreshTokenRepository refreshTokenRepository;
}
@Service
@AllArgsConstructor
public class MailService {
private final JavaMailSender mailSender;
private final MailContentBuilder mailContentBuilder;
}
The RentalService class needs AuthService class for verification but there seems to be an issue. I have tried to AutoWiring constructors for every classes but no change in outcome.
Pasang Sherpa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.