Spring Boot Errors
Common Spring Boot errors and how to fix them.
115 errors🍃 Spring Boot
Port 8080 was already in use
Another process is already bound to port 8080
🍃 Spring Boot
Field X required a bean of type Y that could not be found
Spring tried to inject a dependency but couldn't find a matching bean in the application context.
🍃 Spring Boot
Whitelabel Error Page
Spring Boot's default 404 error page indicating no mapping was found for the request.
🍃 Spring Boot
Failed to configure a DataSource: 'url' attribute is not specified
Spring Boot detected JPA but found no database connection details.
🍃 Spring Boot
Table/relation does not exist
Hibernate is trying to query a table that doesn't exist in your database.
🍃 Spring Boot
CORS error - blocked by CORS policy
Your frontend (Angular/React) is blocked from calling your Spring Boot API.
All Spring Boot errors
- 403 Forbidden on all endpoints (Spring Security default)
- Access denied for user 'root'@'localhost'
- Actuator endpoint 404 Not Found
- AsyncConfigurationException: No AsyncConfigurer found
- AsyncRequestTimeoutException
- AuthenticationCredentialsNotFoundException: An Authentication object was not found in the SecurityContext
- authorization_request_not_found
- BeanCreationException: Error creating bean with name 'healthCheckIndicator'
- BeanCurrentlyInCreationException (circular dependency)
- BeanDefinitionStoreException: Failed to read candidate component class
- Cannot call sendError() after the response has been committed
- Cannot delete or update a parent row: a foreign key constraint fails
- Cannot deserialize / JSON parse error (Jackson)
- Cannot find dependencies of the project
- ch.qos.logback.core.joran.spi.JoranException: Problem parsing XML document.
- class file has wrong version 61.0, should be 52.0
- ClassCastException: class com.sun.proxy.$ProxyXX cannot be cast to class
- ClassNotFoundException: com.zaxxer.hikari.HikariDataSource
- Column 'user_id' cannot be null
- Communications link failure
- ConfigServerConfigDataMissingException: Could not locate PropertySource
- ConflictingBeanDefinitionException: Annotation-specified bean name 'userService' for bean class
- Connection refused: connect
- Consider defining a bean of type 'com.devinhyderabad.service.UserService' in your configuration.
- Content type 'text/plain;charset=UTF-8' not supported
- ConversionNotSupportedException: Failed to convert property value of type 'java.lang.String' to required type 'javax.mail.Session'
- CORS error - blocked by CORS policy
- could not deserialize; nested exception is org.hibernate.type.SerializationException
- Could not find acceptable representation (406 Not Acceptable)
- Could not find artifact com.devinhyderabad:my-lib:jar:1.0.0 in central
- Could not resolve org.springframework.boot:spring-boot-starter-web.
- Could not resolve placeholder 'app.secret' in value "${app.secret}"
- Could not resolve placeholder 'spring.datasource.url' in value "${spring.datasource.url}"
- Data truncation: Data too long for column 'name'
- detached entity passed to persist
- Duplicate entry 'admin@devinhyderabad.com' for key 'uk_email'
- Error creating bean with name 'configurationPropertiesBeans' defined in class path resource
- Expected at least 1 bean which qualifies as autowire candidate for [TaskScheduler]
- expected single matching bean but found 2: userServiceImpl,mockUserService. Consider marking one of the beans as @Primary
- Failed to configure a DataSource: 'url' attribute is not specified
- Failed to convert value of type 'String' to required type 'Long'
- Failed to determine a suitable driver class
- Failed to load ApplicationContext (test context failure)
- Field X required a bean of type Y that could not be found
- FileNotFoundException: class path resource [keystore.p12] cannot be resolved
- Flyway: Migration checksum mismatch
- HibernateException: A collection with cascade='all-delete-orphan' was no longer referenced by the owning entity instance
- HttpClientErrorException$BadRequest: 400 Bad Request
- HttpClientErrorException$TooManyRequests: 429 Too Many Requests
- HttpMessageNotWritableException: No serializer found for class
- IllegalArgumentException: Encoded password does not look like BCrypt
- IllegalArgumentException: Failed to evaluate expression 'hasRole('ADMIN')'
- IllegalArgumentException: Source must not be null (BeanUtils.copyProperties)
- IllegalStateException: Failed to load ApplicationContext via ContextLoader
- IllegalStateException: Logback configuration error detected: ERROR in ch.qos.logback.core.joran.spi.ConsoleTarget@1 - [...] no applicable action
- IllegalStateException: No cache could be resolved for 'users'
- IllegalStateException: ResponseEntity has already been built
- IllegalStateException: Session id changed unexpectedly
- Incorrect string value: '\xF0\x9F\x98\x82' for column 'name'
- InvalidBearerTokenException: An error occurred while attempting to decode the Jwt
- InvalidDataAccessApiUsageException: Pageable must not be null
- java.lang.ClassNotFoundException: io.micrometer.prometheus.PrometheusMeterRegistry
- java.lang.ClassNotFoundException: jakarta.servlet.http.HttpServlet
- java.lang.IllegalStateException: block()/blockFirst()/blockLast() are blocking, which is not supported in thread reactor-...
- java.lang.IllegalStateException: Resource 'messages.properties' not found
- javax.persistence.TransactionRequiredException: Executing an update/delete query
- JSON parse error: Cannot construct instance of `java.time.LocalDate`
- JsonMappingException: Infinite recursion (StackOverflowError)
- LazyInitializationException - could not initialize proxy - no Session
- ListenerExecutionFailedException: Listener could not invoke its target
- ListenerExecutionFailedException: Listener method could not be invoked with the incoming message
- MaxUploadSizeExceededException: Maximum upload size exceeded
- MessageConversionException: failed to convert serialized payload
- No processor claimed any of the following annotations: lombok.Data
- No qualifying bean of type 'org.springframework.security.authentication.AuthenticationManager'
- NoSuchBeanDefinitionException: No bean named 'entityManagerFactory' available
- NoSuchBeanDefinitionException: No qualifying bean of type 'com.devinhyderabad.service.UserService' available
- NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.security.crypto.encrypt.TextEncryptor'
- NoSuchMessageException: No message found under code 'user.email.invalid' for locale 'en_US'.
- NoSuchMethodError: org.springframework.boot.SpringApplication.run
- NoUniqueBeanDefinitionException: No qualifying bean of type 'com.devinhyderabad.repo.UserRepository' available: expected single matching bean but found 2
- NullPointerException in @Autowired service
- org.springframework.core.io.buffer.DataBufferLimitException: Exceeded limit on max bytes to buffer : 262144
- org.springframework.web.servlet.resource.NoResourceFoundException: No static resource index.html.
- Parameter 0 of constructor in X required a bean of type Y that could not be found.
- Port 8080 was already in use
- ProviderNotFoundException: No AuthenticationProvider found for org.springframework.security.authentication.UsernamePasswordAuthenticationToken
- QuerySyntaxException: Unexpected token: FROM
- RejectedExecutionException: Task rejected from java.util.concurrent.ThreadPoolExecutor
- Request method 'POST' not supported
- Required request body is missing
- Required request parameter 'X' for method parameter type String is not present
- Required request part 'file' is not present
- ResponseStatusException: 400 BAD_REQUEST "Invalid input"
- Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)
- RuntimeException: org.bouncycastle.cert.CertException: certificate not valid yet
- SerializationException: Cannot deserialize
- SignatureException: JWT signature does not match locally computed signature. JWT validity cannot be asserted and should not be trusted.
- SSLHandshakeException: PKIX path building failed (Unable to find valid certification path)
- StackOverflowError caused by Lombok @Data and JPA Bidirectional Relationship
- Table "USERS" already exists; SQL statement:
- Table/relation does not exist
- The dependencies of some of the beans in the application context form a cycle
- There are test failures. Please refer to /target/surefire-reports for the individual test results.
- This session has been expired (possibly due to multiple concurrent logins being attempted as the same user)
- TooFewActualInvocations: Verification would fail: Expected 2 times but was 1
- TransactionRequiredException: Executing an update/delete query (in @DataJpaTest)
- Unable to find com.devinhyderabad.entity.User with id 1
- Unknown column 'user_name' in 'field list'
- UnsatisfiedDependencyException: Error creating bean with name 'dockerComposeConnectionDetailsFactory'
- UnsupportedFeatureError: Class com.devinhyderabad.entity.User is instantiated reflectively but was never registered.
- UnsupportedFeatureError: Proxy class defined by interfaces [interface com.devinhyderabad.service.UserService] not found in the image heap.
- Validation failed for object [userRequest]. Error count: 1
- Whitelabel Error Page
- ZipException: invalid LOC header (bad signature) during build