java Errors

204 error patterns

java3 fixes

Spring Boot bean not found in application context

NoSuchBeanDefinitionException.*No qualifying bean of type

  • Add @Component/@Service/@Repository annotation to the class
  • Ensure the package is scanned: check @ComponentScan or @SpringBootApplication basePackages
java3 fixes

Spring circular dependency during bean creation

BeanCurrentlyInCreationException.*Requested bean is currently in creation

  • Use @Lazy annotation on one of the circular dependencies
  • Refactor to break the circular dependency with an event or interface
java3 fixes

Spring Boot unsatisfied dependency injection

UnsatisfiedDependencyException.*Error creating bean with name

  • Verify the required bean exists and is properly annotated
  • Use @Qualifier to disambiguate when multiple beans of same type exist
java3 fixes

Spring Boot conditional bean misconfiguration

ConditionalOnMissingBean.*did not find any beans

  • Check @ConditionalOnMissingBean conditions match the expected bean type
  • Verify bean registration order with @AutoConfigureBefore/@AutoConfigureAfter
java3 fixes

Spring Boot native compilation reflection error

Failed to instantiate.*GraalVM native.*UnsupportedFeatureError

  • Add class to reflect-config.json for GraalVM native image
  • Use @RegisterReflectionForBinding annotation on config class
java3 fixes

GraalVM native image build failure

NativeImageBuildException.*Error.*during.*native-image.*generation

  • Run with -Dagent to generate reachability metadata
  • Add missing resources to resource-config.json
java3 fixes

Spring Security 6 missing filter chain

HttpSecurityConfiguration.*No SecurityFilterChain.*defined

  • Define a SecurityFilterChain @Bean in a @Configuration class
  • Migrate from WebSecurityConfigurerAdapter (removed in 6.0) to component-based config
java3 fixes

Spring Security CSRF token validation failure

AccessDeniedException.*CSRF token.*invalid

  • Include CSRF token in form submissions or AJAX headers
  • Use CookieCsrfTokenRepository.withHttpOnlyFalse() for SPA apps
java3 fixes

Spring Security OAuth2 invalid token

OAuth2AuthenticationException.*invalid_token

  • Verify token hasn't expired and issuer matches configuration
  • Check spring.security.oauth2.resourceserver.jwt.issuer-uri is correct
java3 fixes

Spring Security method-level authorization denied

AuthorizationDeniedException.*Access Denied.*@PreAuthorize

  • Verify user has required role/authority in the security context
  • Ensure @EnableMethodSecurity is present on config class
java3 fixes

Hibernate lazy loading outside session

LazyInitializationException.*could not initialize proxy.*no Session

  • Use @EntityGraph or JOIN FETCH in query to eagerly load
  • Use @Transactional on the service method accessing lazy properties
java3 fixes

Hibernate multiple bag fetch not allowed

MultipleBagFetchException.*cannot simultaneously fetch multiple bags

  • Change one collection from List to Set
  • Use separate queries for each collection (Hibernate 6 supports this)
java3 fixes

JPA persist called on detached entity

PersistenceException.*detached entity passed to persist

  • Use merge() instead of persist() for detached entities
  • Re-fetch the entity within the current session before modifying
java3 fixes

Spring Data JPA constraint violation

DataIntegrityViolationException.*constraint.*violated

  • Check unique constraints before insert/update
  • Handle the exception and return appropriate error response
java3 fixes

Spring Data JPA invalid SQL statement

InvalidDataAccessResourceUsageException.*could not prepare statement

  • Check @Query annotation for syntax errors
  • Verify column names match the actual database schema
java3 fixes

JPA N+1 select problem detected

N\+1.*select.*query.*Hibernate

  • Use @EntityGraph(attributePaths={...}) on repository method
  • Add JOIN FETCH in JPQL: SELECT e FROM Entity e JOIN FETCH e.children
java3 fixes

Spring Data JPA projection converter not found

ConverterNotFoundException.*No converter found capable of converting.*to.*Projection

  • Ensure projection interface getter names match entity property names exactly
  • Use @Value SpEL expressions in projection for computed values
java3 fixes

Hibernate schema generation failure

SchemaManagementException.*Unable to create.*schema

  • Check spring.jpa.hibernate.ddl-auto value (create/update/validate)
  • Verify database user has DDL privileges
java3 fixes

Hibernate second-level cache not configured

Cache.*SecondLevelCache.*not enabled

  • Add hibernate.cache.use_second_level_cache=true to properties
  • Include a cache provider (ehcache/caffeine) on classpath
java3 fixes

Hibernate batch insert failure

GenericJDBCException.*could not execute batch

  • Set hibernate.jdbc.batch_size and reorder_inserts=true
  • Ensure ID generation strategy supports batching (not IDENTITY)
java3 fixes

Spring Boot unresolved property placeholder

Could not resolve placeholder '.*' in value

  • Add the property to application.properties/yml
  • Use ${property:default} syntax to provide a default value
java3 fixes

Maven dependency resolution failure

maven.*Could not resolve dependencies.*Could not find artifact

  • Check the repository URLs in pom.xml or settings.xml
  • Verify artifact coordinates (groupId:artifactId:version) are correct
java3 fixes

Maven BOM version conflict

maven.*BOM.*dependencyManagement.*version conflict

  • Import BOMs in correct order: specific before general
  • Use <exclusions> to override transitive dependency versions
java3 fixes

Maven Shade plugin overlapping class conflict

maven-shade-plugin.*overlapping classes

  • Add <filters> to exclude conflicting META-INF files
  • Use <relocations> to rename conflicting packages
java3 fixes

Gradle compile classpath resolution failure

Gradle.*Could not resolve all files for configuration.*compileClasspath

  • Run 'gradle --refresh-dependencies' to force cache refresh
  • Check repository declarations in build.gradle
java3 fixes

Gradle multi-module compile error - missing symbol

Gradle.*Execution failed for task.*compileJava.*error: cannot find symbol

  • Add project dependency: implementation project(':module-name')
  • Ensure dependent module is built first (check task ordering)
java3 fixes

JVM out of heap memory

OutOfMemoryError: Java heap space

  • Increase heap: -Xmx4g (or appropriate size)
  • Profile with VisualVM/JFR to find memory leaks
java3 fixes

JVM Metaspace out of memory

OutOfMemoryError: Metaspace

  • Increase Metaspace: -XX:MaxMetaspaceSize=512m
  • Check for classloader leaks (common in hot-redeploy scenarios)
java3 fixes

JVM spending too much time in garbage collection

GC overhead limit exceeded

  • Increase heap size with -Xmx
  • Switch to a different GC: -XX:+UseG1GC or -XX:+UseZGC
java3 fixes

JVM stack overflow from deep recursion

java\.lang\.StackOverflowError

  • Increase stack size: -Xss2m
  • Convert recursion to iteration
java3 fixes

Multiple Spring Boot configuration classes found

Found multiple.*@SpringBootConfiguration.*annotated classes

  • Ensure only one class has @SpringBootApplication in test context
  • Use @SpringBootTest(classes=MainApp.class) to specify explicitly
java3 fixes

Class not found during native image serialization

ClassNotFoundException.*during.*native.*serialization

  • Add class to serialization-config.json for GraalVM
  • Use @RegisterForReflection (Quarkus) or RuntimeHints (Spring)
java3 fixes

Java 21 virtual thread pinned on synchronized block

VirtualThread.*pinned.*synchronized

  • Replace synchronized with ReentrantLock
  • Use java.util.concurrent locks that support virtual threads
java3 fixes

Java sealed class illegal subclass

IllegalCallerException.*sealed.*permits

  • Add the subclass to the 'permits' clause of the sealed class
  • Ensure subclass is in the same module or package as sealed parent
java3 fixes

Java 21 non-exhaustive pattern match

MatchException.*pattern matching.*exhaustive

  • Add a default case to the switch expression/statement
  • Cover all permitted subtypes of the sealed class
java3 fixes

Java record pattern incompatible class change

IncompatibleClassChangeError.*record.*component

  • Recompile all modules that use the record pattern
  • Ensure record definition matches the destructuring pattern
java3 fixes

JVM thread deadlock detected in thread dump

Thread dump.*BLOCKED.*waiting for monitor entry

  • Acquire locks in consistent order across all threads
  • Use tryLock with timeout instead of synchronized
java3 fixes

Spring proxy class cast exception

ClassCastException.*cannot be cast to.*at.*proxy

  • Use interface-based injection instead of concrete class
  • Set spring.aop.proxy-target-class=true for CGLIB proxies
java3 fixes

Class available at compile time but missing at runtime

NoClassDefFoundError.*at runtime.*but was available at compile

  • Change dependency scope from 'provided' to 'compile' if needed at runtime
  • Ensure the JAR with the class is included in the deployment
java3 fixes

Java module system access error

IllegalAccessError.*tried to access.*from.*module

  • Add --add-opens module/package=target.module to JVM args
  • Add requires/exports to module-info.java
java3 fixes

JPA modification query without transaction

TransactionRequiredException.*Executing an update/delete query

  • Add @Transactional annotation to the method or class
  • Add @Modifying annotation on the repository method
java3 fixes

JPA optimistic locking conflict

ObjectOptimisticLockingFailureException.*Row was updated or deleted

  • Implement retry logic for OptimisticLockException
  • Refresh entity state before retrying the operation
java3 fixes

Spring Security multiple filter chains with same order

spring\.security.*SecurityFilterChain.*order.*conflict

  • Set @Order annotation on each SecurityFilterChain bean
  • Use securityMatcher() to scope each chain to specific paths
java3 fixes

Spring MVC content negotiation failure

HttpMediaTypeNotAcceptableException.*Could not find acceptable representation

  • Add appropriate HttpMessageConverter to configuration
  • Check Accept header matches controller's produces attribute
java3 fixes

Spring Bean Validation constraint violation

ConstraintViolationException.*validation constraints.*Bean Validation

  • Add @Valid annotation on @RequestBody parameter
  • Check input data satisfies @NotNull, @Size, @Pattern constraints
java3 fixes

Hibernate schema validation failure - table not found

spring\.jpa\.hibernate.*table.*not found.*schema-validation

  • Run migrations to create the missing table
  • Change ddl-auto from 'validate' to 'update' in development
java3 fixes

Spring RestTemplate/WebClient rate limited

HttpClientErrorException.*429 Too Many Requests

  • Implement retry with exponential backoff using @Retryable
  • Use resilience4j RateLimiter to throttle outgoing requests
java3 fixes

Spring WebClient connection refused

WebClientResponseException.*Connection refused

  • Verify target service is running and accessible
  • Check service discovery configuration (Eureka/Consul)
java3 fixes

Gradle Java toolchain version incompatible

gradle.*incompatible.*toolchain.*java.*version

  • Set java toolchain in build.gradle: java { toolchain { languageVersion = JavaLanguageVersion.of(21) } }
  • Install the required JDK version on the system
java3 fixes

Spring Boot autoconfiguration condition not met

spring\.autoconfigure\.condition.*ConditionEvaluationReport.*negative matches

  • Run with --debug to see condition evaluation report
  • Add missing dependencies that the autoconfiguration requires
java3 fixes

Spring Security JWT issuer resolution failure

spring\.security\.oauth2.*JwtDecoder.*could not resolve issuer

  • Verify issuer-uri is reachable from the application
  • Check .well-known/openid-configuration endpoint returns valid config
java3 fixes

Spring Boot reactive web server startup failure

ApplicationContextException.*Unable to start.*reactive.*web server

  • Ensure spring-boot-starter-webflux is on classpath (not spring-boot-starter-web)
  • Check for port conflicts with server.port property
java3 fixes

Hibernate entity identifier changed

HibernateException.*identifier.*altered.*from.*to

  • Never modify the @Id field after entity is persisted
  • Use a surrogate key if natural key can change
java3 fixes

Spring Boot test context fails to load DataSource

SpringBootTest.*Failed to load ApplicationContext.*DataSource

  • Use @DataJpaTest for JPA-only tests (auto-configures H2)
  • Add @AutoConfigureTestDatabase for test database config
java3 fixes

Gradle deprecated features warning for future version

gradle.*Deprecated Gradle features.*incompatible with Gradle 9

  • Run 'gradle --warning-mode all' to see all deprecation details
  • Update build scripts to use non-deprecated APIs
java3 fixes

Spring request scope accessed outside HTTP request

java\.lang\.IllegalStateException.*Scope 'request' is not active

  • Ensure request-scoped beans are only accessed within HTTP request lifecycle
  • Use ObjectFactory<T> or Provider<T> for lazy resolution
java3 fixes

PostgreSQL serialization failure in JPA

JpaSystemException.*could not serialize access due to concurrent update

  • Implement retry logic for serialization failures
  • Use READ_COMMITTED isolation level if strict serializability isn't needed
java3 fixes

Java 21 StructuredTaskScope subtask failure

StructuredTaskScope.*subtask.*failed

  • Handle FailedException in the scope's join()
  • Use ShutdownOnFailure policy to fail fast on first error
java3 fixes

Java 21 ScopedValue accessed when not bound

ScopedValue.*not bound

  • Ensure code runs within ScopedValue.where().run() block
  • Use ScopedValue.orElse(default) for optional access
java3 fixes

Java module reflection access denied

java\.lang\.reflect\.InaccessibleObjectException.*module.*does not.*open

  • Add --add-opens java.base/java.lang=ALL-UNNAMED to JVM args
  • Use official API instead of reflective access
java3 fixes

Spring Data query returned multiple results expecting one

spring\.data.*IncorrectResultSizeDataAccessException.*expected 1.*actual \d+

  • Add LIMIT 1 or use findFirst...() method naming
  • Add unique constraint if data should be unique
java3 fixes

JPA entity not found by ID

EntityNotFoundException.*Unable to find.*with id

  • Use findById() which returns Optional instead of getOne()/getReferenceById()
  • Check entity exists before operations: repository.existsById()
java3 fixes

Maven multi-module parent SNAPSHOT not found

maven.*multi-module.*parent.*SNAPSHOT.*not found

  • Run 'mvn install' from the parent project first
  • Use relative path in child pom: <relativePath>../pom.xml</relativePath>
java3 fixes

Spring MVC unsupported HTTP method

spring\.web\.HttpRequestMethodNotSupportedException.*Request method.*not supported

  • Check controller mapping matches the HTTP method (@GetMapping vs @PostMapping)
  • Verify CORS preflight isn't being misrouted
java3 fixes

Spring application context not refreshed

AnnotationConfigApplicationContext.*has not been refreshed yet

  • Call context.refresh() after registering bean definitions
  • Use SpringApplication.run() which handles context lifecycle
java3 fixes

Spring Security no authentication credentials found

spring\.security.*AuthenticationCredentialsNotFoundException

  • Ensure SecurityContext is populated (authentication filter ran)
  • Check filter order - authentication must come before authorization
java3 fixes

Hibernate JPQL property resolution failure

hibernate\.QueryException.*could not resolve property

  • Check property name matches the Java field name (not column name)
  • Use the exact case of the field in the entity class
java3 fixes

Hibernate null ID assertion failure

org\.hibernate\.AssertionFailure.*null id.*entry

  • Ensure @GeneratedValue strategy is configured correctly
  • Check that the database sequence/auto-increment is working
java3 fixes

JVM ZGC allocation stall

ZGC.*Allocation Stall.*GC.*not keeping up

  • Increase heap size to give ZGC more room
  • Set -XX:SoftMaxHeapSize to a value below -Xmx
java3 fixes

JVM G1GC full GC from allocation failure

G1GC.*Full GC.*Allocation Failure

  • Increase heap size with -Xmx
  • Tune G1 with -XX:G1HeapRegionSize and -XX:InitiatingHeapOccupancyPercent
java3 fixes

JVM class file format error

ClassFormatError.*Incompatible magic value

  • Rebuild the project from clean: mvn clean package
  • Check for corrupted JAR files in local repository
java3 fixes

Java class compiled with newer version than runtime

UnsupportedClassVersionError.*class file version \d+.*this Java Runtime only recognizes

  • Upgrade runtime JDK to match or exceed compilation target
  • Set --release flag in compiler to target older JVM version
java3 fixes

Spring Boot port already in use

spring\.boot\.web\.server.*PortInUseException

  • Change server.port in application.properties
  • Kill the process using the port: lsof -i :8080 then kill
java3 fixes

Spring Data derived query property not found

QueryCreationException.*No property '.*' found for type

  • Ensure method name segments match entity property names exactly
  • Use @Query annotation for complex queries instead of method naming
java3 fixes

Hibernate inheritance mapping class mismatch

hibernate\.WrongClassException.*Object.*was not of the specified subclass

  • Check @Inheritance strategy and discriminator values
  • Ensure discriminator column has correct value for each subclass
java3 fixes

Spring Data unable to acquire database connection

DataAccessResourceFailureException.*Unable to acquire JDBC Connection

  • Increase connection pool size: spring.datasource.hikari.maximum-pool-size
  • Check database server is running and accessible
java3 fixes

Spring R2DBC reactive timeout

spring\.r2dbc.*R2dbcTimeoutException

  • Increase statement timeout in R2DBC connection factory config
  • Optimize the slow query causing the timeout
java3 fixes

Java 21 record pattern accessor not found

RecordComponent.*accessor.*not found.*during pattern match

  • Ensure record component names match the pattern variable names
  • Recompile the record class if components were recently changed
java3 fixes

Jackson cannot deserialize - no default constructor

spring\.jackson\.InvalidDefinitionException.*Cannot construct instance.*no Creators

  • Add @JsonCreator on constructor or static factory method
  • Add @NoArgsConstructor (Lombok) or default constructor
java3 fixes

Spring Boot @MockBean injection failure

spring\.boot\.test.*MockBean.*could not inject

  • Ensure @MockBean field type matches the actual bean type
  • Use @SpyBean if you want to spy on real implementation
java3 fixes

Database lock wait timeout in Spring Data

CannotAcquireLockException.*Lock wait timeout exceeded

  • Reduce transaction scope to hold locks briefly
  • Use @Transactional(timeout=30) to set explicit timeout
java3 fixes

Spring Retry all attempts exhausted

spring\.retry\.ExhaustedRetryException

  • Increase maxAttempts in @Retryable annotation
  • Add @Recover method for graceful fallback
java3 fixes

Maven enforcer plugin Java version check failed

maven.*enforcer.*RequireJavaVersion.*failure

  • Install the required Java version specified by the project
  • Update enforcer plugin rule to match your Java version
java3 fixes

Spring test context cache overflow

spring\.test.*context\.caching.*too many contexts

  • Reduce unique @MockBean combinations across tests
  • Share test configurations with @Import or @ContextConfiguration
java3 fixes

Hibernate no dialect mapping for JDBC type

hibernate\.type\.descriptor.*No Dialect mapping for JDBC type

  • Register custom type with @TypeDef or AttributeConverter
  • Use @Column(columnDefinition=...) to specify exact SQL type
java3 fixes

Spring Security method security on non-public method

spring\.security\.MethodSecurityInterceptor.*method.*is not public

  • Make the secured method public
  • Use AspectJ mode for non-public method security: @EnableMethodSecurity(mode=AdviceMode.ASPECTJ)
java3 fixes

Project Reactor duplicate subscription error

reactor\.core\.Exceptions.*Duplicate.*Subscription

  • Use .cache() or .share() for hot publishers subscribed multiple times
  • Ensure each subscriber gets its own subscription (cold publisher)
java3 fixes

Blocking call in reactive context

IllegalStateException.*block\(\)/blockFirst\(\)/blockLast\(\).*not supported.*reactive

  • Replace block() with subscribe() or chain with flatMap/then
  • Use Schedulers.boundedElastic() for wrapping blocking calls
java3 fixes

Hibernate batch update affected 0 rows

hibernate\.HibernateException.*Batch update.*unexpected row count.*0.*expected.*1

  • Entity may have been deleted by another transaction
  • Check @Version field for stale optimistic lock version
java3 fixes

Spring Cloud Config Server property source not found

spring\.cloud\.config.*Could not locate PropertySource

  • Verify config server is running and accessible
  • Check application name and profile match config repository structure
java3 fixes

NoSuchMethodError from Java version mismatch in dependencies

java\.lang\.NoSuchMethodError.*java\.(17|21).*compiled against older version

  • Align all dependencies to the same Java version target
  • Update the library that was compiled against a different version
java3 fixes

HikariCP connection pool timeout

HikariPool.*Connection is not available.*request timed out

  • Increase spring.datasource.hikari.connection-timeout
  • Increase pool size: spring.datasource.hikari.maximum-pool-size
java3 fixes

Spring GraphQL query complexity limit exceeded

spring\.graphql.*QueryComplexityExceededException

  • Simplify the client query (reduce nesting/fields)
  • Increase max complexity in GraphQL config if legitimate
java3 fixes

Spring Boot test REST call timeout

spring\.test.*TestRestTemplate.*SocketTimeoutException

  • Increase timeout on TestRestTemplate with RequestConfig
  • Check test server is started - use @SpringBootTest(webEnvironment=RANDOM_PORT)
java3 fixes

Spring Batch flat file parsing error

spring\.batch.*FlatFileParseException.*at line

  • Check field delimiter and line format matches tokenizer configuration
  • Add fault tolerance: .faultTolerant().skip(FlatFileParseException.class)
java3 fixes

Spring Cache annotation missing cache name

spring\.cache.*CacheOperationAnnotationParser.*no cache names

  • Specify cache name: @Cacheable('myCache')
  • Configure default cache in application.properties
java3 fixes

Gradle compilation task failure

org\.gradle\.api\.tasks.*TaskExecutionException.*Compilation failed

  • Check compiler error messages in build output
  • Ensure all dependencies are resolved: gradle dependencies
java3 fixes

Jakarta Bean Validation constraint declaration error

jakarta\.validation.*ConstraintDeclarationException.*overriding.*constraint

  • Don't add constraints on overriding methods (violates LSP)
  • Apply constraints only on interface or parent class methods
java3 fixes

Flyway migration checksum mismatch

spring\.flyway.*FlywayMigrateException.*migration checksum mismatch

  • Never modify already-applied migrations - create a new one
  • Use flyway repair to fix checksum in schema history table
java3 fixes

Java 21 virtual thread executor rejected task

VirtualThreadPerTaskExecutor.*RejectedExecutionException

  • Check if the executor has been shut down
  • Ensure no limit was set on the virtual thread executor
java3 fixes

Keycloak Realm Not Found

Keycloak.*realm.*not found

  • Verify realm name in Keycloak admin console
  • Check realm name casing (case-sensitive)
java3 fixes

Keycloak Client Secret Mismatch

Keycloak.*client.*secret.*mismatch.*unauthorized_client

  • Regenerate client secret in Keycloak admin
  • Update KEYCLOAK_CLIENT_SECRET environment variable
java3 fixes

Keycloak Token Not Active

Keycloak.*invalid_token.*not active

  • Refresh token using refresh_token grant type
  • Check token introspection endpoint for active status
java3 fixes

Keycloak User Not Found in Realm

Keycloak.*user.*not.*found.*realm

  • Verify user exists in correct realm
  • Check user federation/LDAP sync is working
java3 fixes

Keycloak Admin CORS Blocked

Keycloak.*CORS.*admin.*console.*blocked

  • Add frontend URL to Web Origins in client settings
  • Set Valid Redirect URIs to include admin console URL
java3 fixes

Keycloak Token Mapper Claim Missing

Keycloak.*mapper.*claim.*not found

  • Add protocol mapper in client configuration
  • Verify mapper type matches claim format needed
java3 fixes

XML External Entity (XXE) Attack

XXE.*external entity.*DOCTYPE.*processing

  • Disable DTD processing: factory.setFeature(DISALLOW_DOCTYPE, true)
  • Use JSON instead of XML where possible
java3 fixes

Unsafe Deserialization RCE

deserialization.*gadget.*chain.*RCE

  • Never deserialize untrusted data
  • Use allowlist of classes for ObjectInputStream
java3 fixes

LDAP Injection in Search Filter

LDAP.*injection.*filter.*unescaped

  • Escape special characters: *, (, ), \, NUL
  • Use parameterized LDAP filters
java3 fixes

Keycloak Invalid Redirect URI

Keycloak.*redirect_uri.*not.*valid

  • Add exact redirect URI in client settings (no wildcards in prod)
  • Check protocol and port match exactly
java3 fixes

SAML Response Signature Invalid

SAML.*response.*signature.*invalid

  • Verify IdP certificate is up to date
  • Check signature algorithm matches expected (SHA-256)
java3 fixes

SAML Assertion Expired

SAML.*assertion.*expired.*NotOnOrAfter

  • Synchronize server clocks with NTP
  • Add clock skew tolerance in SAML config
java3 fixes

Keycloak Token Exchange Permission Denied

Keycloak.*token.*exchange.*denied

  • Enable token exchange in realm settings
  • Add token-exchange scope to target client
java3 fixes

Keycloak Client Scope Configuration Error

Keycloak.*client.*scope.*not.*optional

  • Add scope as optional client scope in client settings
  • Check scope exists in realm client scopes list
java3 fixes

Keycloak Impersonation Permission Denied

Keycloak.*impersonation.*not.*allowed

  • Grant impersonation role to admin user
  • Enable impersonation in realm settings
java3 fixes

Circuit Breaker in Open State

CircuitBreaker.*state.*OPEN.*requests.*failing

  • Wait for reset timeout before retry
  • Check downstream service health independently
java3 fixes

Circuit Breaker Half-Open Test Failed

CircuitBreaker.*HALF_OPEN.*test.*request.*failed

  • Downstream service still unhealthy - stays OPEN
  • Increase reset timeout to give service more recovery time
java3 fixes

Circuit Breaker Fallback Method Error

CircuitBreaker.*fallback.*method.*exception

  • Ensure fallback method signature matches original
  • Return cached/default data in fallback
java3 fixes

Service Discovery No Instances Found

ServiceDiscovery.*no.*instances.*available

  • Check service is registered with correct name
  • Verify health check is passing on service instances
java3 fixes

Service Discovery DNS Resolution Failed

DNS.*resolution.*failed.*service.*name

  • Verify service DNS name is correct in Kubernetes/Consul
  • Check CoreDNS/kube-dns is running and healthy
java3 fixes

Service Health Check Failing

HealthCheck.*endpoint.*returned.*503.*unhealthy

  • Check dependency health in health check endpoint
  • Verify DB connections and external service access
java3 fixes

Eureka Service Registration Failed

Eureka.*registration.*failed.*connection.*refused

  • Verify Eureka server URL in application config
  • Check Eureka server is running and accessible
java3 fixes

Kafka Offset Commit Failed

kafka.*CommitFailedException.*offset.*commit.*failed

  • Increase session.timeout.ms (consumer may have been kicked)
  • Reduce processing time per batch to stay within poll interval
java3 fixes

Kafka Topic Authorization Failed

kafka.*TopicAuthorizationException.*not authorized

  • Grant ACLs for consumer group on topic
  • Check SASL credentials and authentication
java3 fixes

Kafka Record Too Large

kafka.*RecordTooLargeException.*max\.message\.bytes

  • Increase max.message.bytes on topic configuration
  • Compress messages with compression.type=snappy
java3 fixes

Kafka Not Leader for Partition

kafka.*NotLeaderOrFollowerException

  • Refresh metadata with producer.flush() or consumer.poll()
  • Implement retry with backoff for transient leader changes
java3 fixes

Kafka Group Coordinator Not Available

kafka.*GroupCoordinatorNotAvailableException

  • Wait for coordinator election (transient during rebalance)
  • Check offsets.topic.replication.factor >= running brokers
java3 fixes

Kafka Consumer Rebalance Timeout

kafka.*consumer.*rebalance.*timeout.*revoked

  • Increase max.poll.interval.ms for long processing
  • Use incremental cooperative rebalancing (CooperativeStickyAssignor)
java3 fixes

RabbitMQ Connection Reset

RabbitMQ.*connection.*reset.*by peer

  • Implement connection recovery with automatic reconnect
  • Set heartbeat timeout: requestedHeartbeat=60
java3 fixes

RabbitMQ Queue Declaration Conflict

RabbitMQ.*PRECONDITION_FAILED.*inequivalent arg

  • Delete and recreate queue with correct arguments
  • Match all args: durable, exclusive, autoDelete, arguments
java3 fixes

RabbitMQ Resource Locked

RabbitMQ.*channel.*closed.*RESOURCE_LOCKED

  • Another connection has exclusive access to queue
  • Close exclusive consumers before accessing queue
java3 fixes

RabbitMQ Dead Letter Queue Routing Failure

RabbitMQ.*dead.*letter.*routing.*key.*unroutable

  • Verify dead letter exchange exists and has binding
  • Set x-dead-letter-exchange and x-dead-letter-routing-key on source queue
java3 fixes

RabbitMQ Message Requeue Loop (Poison Message)

RabbitMQ.*message.*nacked.*requeued.*loop

  • Set x-delivery-count limit with quorum queues
  • Move to DLQ after N retries instead of requeuing
java3 fixes

Event Sourcing Duplicate Event Detected

idempotency.*key.*duplicate.*already.*processed

  • Return cached response for duplicate idempotency key
  • Store idempotency keys with TTL in Redis
java3 fixes

Eventual Consistency Stale Read

eventual.*consistency.*stale.*read.*after.*write

  • Use causal consistency tokens for read-your-writes
  • Implement polling/WebSocket for UI to get latest state
java3 fixes

Saga Compensation Step Failed

saga.*compensation.*failed.*inconsistent.*state

  • Implement compensation retry with exponential backoff
  • Log failed compensation for manual intervention
java3 fixes

Saga Step Timeout No Response

saga.*step.*timeout.*no.*response

  • Implement step timeout with compensation trigger
  • Use deadline mechanism for long-running sagas
java3 fixes

Saga Orchestrator State Corrupted

saga.*orchestrator.*state.*corrupted

  • Persist saga state to durable store before each step
  • Implement saga state recovery from event log
java3 fixes

Distributed Tracing Correlation ID Missing

distributed.*tracing.*correlation.*ID.*missing

  • Add correlation ID middleware that generates if absent
  • Propagate X-Correlation-ID/traceparent header in all calls
java3 fixes

Distributed Tracing Span Not Reported

Jaeger.*span.*not.*reported.*collector.*unavailable

  • Check Jaeger/OTLP collector endpoint is reachable
  • Use batch span processor with retry logic
java3 fixes

OpenTelemetry Exporter Connection Failed

OpenTelemetry.*exporter.*failed.*connection.*refused

  • Verify OTEL_EXPORTER_OTLP_ENDPOINT is correct
  • Check collector is running and accepting gRPC/HTTP
java3 fixes

Trace Context Lost in Async Processing

trace.*context.*propagation.*lost.*async

  • Use Context.current().with() for async continuations
  • Pass trace context explicitly in message headers
java3 fixes

CQRS Read Model Stale Data

CQRS.*read.*model.*stale.*not.*projected

  • Check projection is processing events (no lag)
  • Implement read-model freshness indicator with timestamps
java3 fixes

CQRS Command Validation Rejected

CQRS.*command.*validation.*rejected.*aggregate

  • Return specific validation error to client
  • Validate command invariants before sending to aggregate
java3 fixes

CQRS Projection Rebuild Timeout

CQRS.*projection.*rebuild.*timeout

  • Use batch processing for projection rebuild
  • Implement incremental rebuild from last checkpoint
java3 fixes

CQRS No Command Handler Registered

CQRS.*command.*bus.*no.*handler.*registered

  • Register command handler in DI container
  • Verify command type matches handler's command type
java3 fixes

Kafka Schema Registry Serialization Error

kafka.*serialization.*error.*schema.*registry

  • Check schema registry is accessible
  • Verify schema compatibility mode allows evolution
java3 fixes

Message Queue Consumer Lag Growing

message.*queue.*consumer.*lag.*increasing

  • Scale up consumer instances
  • Increase consumer throughput (batch processing)
java3 fixes

Distributed Lock Expired During Operation

distributed.*lock.*expired.*before.*completion

  • Increase lock TTL to exceed worst-case processing time
  • Implement lock renewal/fencing with monotonic token
java3 fixes

Redis Distributed Lock Type Error

distributed.*lock.*Redis.*WRONGTYPE

  • Use dedicated Redis key prefix for locks
  • Delete conflicting key if type mismatch
java3 fixes

Saga Step Already Completed (Duplicate)

saga.*step.*already.*completed.*duplicate

  • Implement idempotency checks in each saga step
  • Store step completion status in saga state
java3 fixes

Event Bus Subscriber Unhandled Exception

event.*bus.*subscriber.*exception.*unhandled

  • Wrap subscriber logic in try-catch with error logging
  • Send failed events to dead letter topic
java3 fixes

Outbox Pattern Missing Events

outbox.*pattern.*polling.*missed.*events

  • Use CDC (Change Data Capture) instead of polling
  • Reduce polling interval for outbox table
java3 fixes

Service Discovery Stale Endpoints

service.*discovery.*stale.*endpoint.*removed

  • Reduce TTL on service registrations
  • Implement client-side health checking before calls
java3 fixes

Bulkhead Thread Pool Exhausted

bulkhead.*rejected.*thread pool.*exhausted

  • Increase bulkhead max concurrent calls
  • Add queue waiting capacity for burst traffic
java3 fixes

Retry Policy Exhausted All Attempts

retry.*exhausted.*max attempts.*giving up

  • Increase max retry attempts for transient failures
  • Add circuit breaker to prevent hammering failed service
java3 fixes

Kafka Transaction Timeout

kafka.*transaction.*timeout.*producer

  • Increase transaction.timeout.ms in producer config
  • Reduce batch size for transactional processing
java3 fixes

Kafka Idempotent Producer Sequence Error

kafka.*idempotent.*producer.*OutOfOrderSequenceException

  • Producer must be restarted (get new producer ID)
  • Set max.in.flight.requests.per.connection=5 or less
java3 fixes

RabbitMQ Unacked Messages Exceeded Prefetch

RabbitMQ.*consumer.*unacked.*exceeded.*prefetch

  • Increase prefetch count if consumer can handle more
  • Ack messages faster (batch ack with multiple=true)
java3 fixes

Event Replay Ordering Violation

event.*replay.*ordering.*guarantee.*violated

  • Use single partition per aggregate for Kafka ordering
  • Add sequence number to events for detection
java3 fixes

CQRS Query Handler Timeout on Large Dataset

CQRS.*query.*handler.*timeout.*large.*dataset

  • Add pagination to query handler
  • Implement materialized view for complex queries
java3 fixes

Circuit Breaker Slow Call Rate Threshold

circuit.*breaker.*slow.*call.*rate.*threshold

  • Set slowCallRateThreshold appropriately (e.g., 50%)
  • Define slowCallDurationThreshold for what counts as slow
java3 fixes

OpenTelemetry Baggage Not Propagating

OpenTelemetry.*baggage.*propagation.*not.*working

  • Register BaggagePropagator in TextMapPropagator composite
  • Set baggage before making outbound calls
java3 fixes

Two-Phase Commit Coordinator Crash

distributed.*transaction.*2PC.*coordinator.*crash

  • Use saga pattern instead of 2PC for microservices
  • Implement coordinator recovery from transaction log
java3 fixes

Event Sourcing Snapshot Outdated

event.*sourcing.*snapshot.*outdated.*too.*many.*events

  • Create new snapshot after N events (e.g., every 100)
  • Implement snapshot scheduling based on event count
java3 fixes

Message Deduplication Window Expired

message.*deduplication.*window.*expired

  • Increase deduplication window size
  • Implement idempotent message processing instead
java3 fixes

Kafka Consumer Group No Partition Assignment

kafka.*consumer.*group.*empty.*no.*assignment

  • Check topic has enough partitions for all consumers
  • Verify consumer group.id is consistent
java3 fixes

RabbitMQ Exchange Not Found

RabbitMQ.*exchange.*not found.*404

  • Declare exchange before publishing
  • Use passive declare to check exchange existence
java3 fixes

CQRS Event Handler Missing Idempotency Key

CQRS.*event.*handler.*idempotency.*key.*missing

  • Add event ID or position as idempotency key
  • Store processed event IDs in handler-specific table
java3 fixes

Distributed Cache Multi-Region Inconsistency

distributed.*cache.*inconsistency.*multi-region

  • Use write-through cache with async replication
  • Implement cache versioning with conflict resolution
java3 fixes

Async Request-Reply Correlation Timeout

async.*request-reply.*correlation.*ID.*timeout

  • Increase reply timeout for slow downstream
  • Implement correlation store with TTL cleanup
java3 fixes

Orchestration Partial Failure Rollback

orchestration.*step.*partial.*failure.*rollback

  • Implement compensating transactions for completed steps
  • Design each step to be independently reversible
java3 fixes

Distributed Tracing Missing Traces (Low Sampling)

distributed.*tracing.*sampling.*rate.*too.*low

  • Increase sampling rate for debugging: OTEL_TRACES_SAMPLER_ARG=1.0
  • Use tail-based sampling for error/slow traces
java3 fixes

Event Sourcing Aggregate Version Conflict

event.*sourcing.*aggregate.*version.*conflict

  • Reload aggregate from store and retry command
  • Implement conflict resolution based on event types
java3 fixes

Message Ordering Not Guaranteed (FIFO)

message.*ordering.*fifo.*not.*guaranteed

  • Use single partition/queue for ordered messages
  • Set message group ID for SQS FIFO ordering
java3 fixes

Distributed Rate Limiter Sync Failure

rate.*limiter.*distributed.*sync.*failed

  • Fall back to local rate limiting on sync failure
  • Use Redis-based rate limiter with MULTI/EXEC
java3 fixes

Service Registry Split Brain

service.*registry.*split.*brain.*network.*partition

  • Configure quorum-based consensus for registry
  • Use gossip protocol with anti-entropy repair
java3 fixes

Distributed Saga Event Timeout

distributed.*saga.*timeout.*no.*events.*received

  • Implement saga timeout handler with compensation
  • Query service directly as fallback for lost events
java3 fixes

Event Sourcing Stream Not Found

event.*sourcing.*stream.*not found.*aggregate

  • Verify aggregate ID is correct
  • Check stream naming convention matches
java3 fixes

CQRS Read Store Schema Migration Failed

CQRS.*read.*store.*migration.*failed

  • Drop and rebuild read model from event store
  • Apply incremental migration with backward compatibility
java3 fixes

Kafka Exactly-Once Transaction Aborted

kafka.*exactly.*once.*transaction.*abort

  • Handle TransactionAbortedException and retry entire batch
  • Set transactional.id unique per producer instance
java3 fixes

RabbitMQ Publisher Confirm Nack

RabbitMQ.*publisher.*confirm.*nack

  • Retry publishing with exponential backoff
  • Check queue capacity and disk space on broker
java3 fixes

Distributed Tracing Context Injection Failed

distributed.*tracing.*context.*injection.*failed

  • Verify TextMapPropagator is registered globally
  • Check carrier (HttpHeaders) supports put operation
java3 fixes

Event Sourcing Old Event Schema Upcasting

event.*sourcing.*upcasting.*old.*event.*schema

  • Implement upcaster to transform old events to new schema
  • Version events with schema_version field
java4 fixes

NullPointerException thrown

java\.lang\.NullPointerException

  • Add null check before accessing the object
  • Use Optional<T> to wrap potentially null values
java3 fixes

Class not found at runtime

java\.lang\.ClassNotFoundException:\s*(.+)

  • Verify the class is on the classpath
  • Check for typos in the fully qualified class name
java3 fixes

Method not found at runtime

java\.lang\.NoSuchMethodError:\s*(.+)

  • Check for version mismatch between compile-time and runtime dependencies
  • Run mvn dependency:tree to find conflicting versions
java4 fixes

Java heap space exhausted

java\.lang\.OutOfMemoryError:\s*Java heap space

  • Increase heap size with -Xmx flag (e.g., -Xmx2g)
  • Profile memory usage with VisualVM or Eclipse MAT to find leaks
java3 fixes

Collection modified during iteration

java\.util\.ConcurrentModificationException

  • Use Iterator.remove() instead of Collection.remove() during iteration
  • Use ConcurrentHashMap or CopyOnWriteArrayList for concurrent access
java3 fixes

Stack overflow from deep recursion

java\.lang\.StackOverflowError

  • Add a base case to terminate recursion
  • Convert recursive algorithm to iterative with an explicit stack
java3 fixes

Array index out of bounds

java\.lang\.ArrayIndexOutOfBoundsException:\s*Index\s*(\d+)

  • Check array length before accessing index
  • Use a for-each loop instead of index-based access
java3 fixes

Invalid class cast

java\.lang\.ClassCastException:\s*(.+)\s*cannot be cast to\s*(.+)

  • Use instanceof check before casting
  • Review generic type parameters for type erasure issues
java4 fixes

Network IO connection failure

java\.io\.IOException.*Connection\s*(refused|reset|timed\s*out)

  • Verify the target service is running and accessible
  • Check firewall rules and network connectivity
java4 fixes

Spring Boot bean not found for injection

No qualifying bean of type.*available

  • Add @Component, @Service, or @Repository annotation to the class
  • Verify component scanning includes the package (@ComponentScan)
java3 fixes

Spring bean not defined in configuration

Consider defining a bean of type.*in your configuration

  • Create a @Bean method in a @Configuration class
  • Add @EnableAutoConfiguration or the specific @Enable annotation
java4 fixes

Maven dependency resolution failed

Could not resolve dependencies for project

  • Run mvn dependency:resolve to see detailed errors
  • Check if the repository URL is accessible
java3 fixes

Gradle Java compilation failed

Execution failed for task.*compileJava

  • Check the compiler error messages above this line for the actual issue
  • Verify sourceCompatibility matches your JDK version
java3 fixes

Metaspace memory exhausted

java\.lang\.OutOfMemoryError:\s*Metaspace

  • Increase metaspace with -XX:MaxMetaspaceSize=512m
  • Check for classloader leaks (common in hot-reloading scenarios)
java3 fixes

Spring circular dependency detected

BeanCurrentlyInCreationException.*Requested bean is currently in creation

  • Refactor to remove the circular dependency (extract shared logic to a third bean)
  • Use @Lazy on one of the injection points to break the cycle
java3 fixes

File not found on filesystem

java\.io\.FileNotFoundException.*\(No such file or directory\)

  • Verify the file path is correct and the file exists
  • Use getClass().getResourceAsStream() for classpath resources
java3 fixes

Class compiled with newer JDK than runtime

java\.lang\.UnsupportedClassVersionError.*class file version\s*(\d+)

  • Upgrade your runtime JDK to match or exceed the compile version
  • Set -source and -target flags to compile for the older JDK
java3 fixes

Spring unsatisfied dependency injection

org\.springframework\.beans\.factory\.UnsatisfiedDependencyException

  • Check that the required bean exists and is properly annotated
  • Use @Autowired(required = false) if the dependency is optional
java3 fixes

Duplicate key in stream Collectors.toMap

java\.lang\.IllegalStateException.*Duplicate key

  • Provide a merge function as third argument to Collectors.toMap()
  • Use Collectors.groupingBy() instead if duplicates are expected
java3 fixes

Gradle plugin not found

Plugin.*was not found in any of the following sources

  • Add the plugin's repository to settings.gradle pluginManagement block
  • Check that the plugin ID and version are correct