Our team is using Sonatype's Nexus IQ to tag vulnerabilities within our projects. We've upgraded one project successfully from 2.4.5 to 2.6.8 of the spring framework.
This particular project uses Redis and changing the Spring Framework past 2.4.x causes issues with Jenkins Deployments. Locally everything runs fine but when trying to deploy to PCF through Jenkins the following error comes up.
Are there any configuration changes that need to be handled for Redis when moving the Spring Framework past 2.4.x?
> 2022-06-22T11:22:03.513-04:00 [APP/PROC/WEB/0] [OUT]
> {"timestamp":"2022-06-22T15:22:03.513Z","message":"Exception
> encountered during context initialization - cancelling refresh
> attempt:
> org.springframework.beans.factory.UnsatisfiedDependencyException:
> Error creating bean with name 'routeConsumerServiceCache': Unsatisfied
> dependency expressed through field 'redisCacheDao'; nested exception
> is org.springframework.beans.factory.UnsatisfiedDependencyException:
> Error creating bean with name 'redisCacheDaoImpl' defined in file
> [/home/vcap/app/BOOT-INF/classes/com/portal/dao/RedisCacheDaoImpl.class]:
> Unsatisfied dependency expressed through constructor parameter 1;
> nested exception is
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'redisCacheTemplate' defined in class path
> resource [com/portal/config/redis/RedisConfiguration.class]:
> Bean instantiation via factory method failed; nested exception is
> org.springframework.beans.BeanInstantiationException: Failed to
> instantiate [org.springframework.data.redis.core.RedisTemplate]:
> Factory method 'redisCacheTemplate' threw exception; nested exception
> is org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'redisCacheConnectionFactory' defined in class
> path resource
> [com/portal/config/redis/RedisConfiguration.class]:
> Invocation of init method failed; nested exception is
> java.lang.NoSuchMethodError:
> 'io.netty.resolver.dns.DnsNameResolverBuilder
> io.netty.resolver.dns.DnsNameResolverBuilder.socketChannelType(java.lang.Class)'","logger":"o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext","thread":"main","level":"WARN","app_name":"route-consumer-service"}
Related
I am upgrading springboot 2.7 from 1.5 and using springdoc.
I can compile and generate war file but when running it in webserver, there is this error:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webConversionServiceProvider' defined in class path resource [org/springdoc/core/SpringDocConfiguration$WebConversionServiceConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'mvcConversionService' available
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'mvcConversionService' available
I am running the springboot in tomcat version 8.5.
I am trying to upgrade from spring boot 2.4.6 to 2.5.4 and have started receiving following error
Error starting ApplicationContext. To display the conditions report
re-run your application with 'debug' enabled. 2021-09-28 14:10:37
[main] ERROR o.s.boot.SpringApplication - Application run failed
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'supplierInitializer' defined in class path
resource
[org/springframework/cloud/stream/function/FunctionConfiguration.class]:
Invocation of init method failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
'inMemorySwaggerResourcesProvider_integrationflow.org.springframework.integration.config.SourcePollingChannelAdapterFactoryBean#0':
Invocation of init method failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'integrationGlobalProperties' defined in class
path resource
[org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.class]:
Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate
[org.springframework.integration.context.IntegrationProperties]:
Factory method 'integrationGlobalProperties' threw exception; nested
exception is java.lang.IllegalAccessError: class
org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration
tried to access private method 'void
org.springframework.integration.context.IntegrationProperties.()'
(org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration
and org.springframework.integration.context.IntegrationProperties are
in unnamed module of loader 'app')
Not able to understand what has changed in spring boot 2.5.X , although upgrading till version 2.4.11 works fine.
I guess you have an old version of spring-integration-core library. Delete all the folders under .m2/repository/org/springframework/integration That should fix it.
I am using io.springfox 3.0.0 version in my project. I added the dependency to my build.gradle file as following:
implementation group: 'io.springfox', name: 'springfox-boot-starter', version: '3.0.0'
The external libraries were created as expected:
io.springfox:springfox-boot-starter:3.0.0
io.springfox:springfox-core:3.0.0
io.springfox:springfox-data-rest:3.0.0
io.springfox:springfox-oas:3.0.0
io.springfox:springfox-schema:3.0.0
io.springfox:springfox-spi:3.0.0
io.springfox:springfox-spring-web:3.0.0
io.springfox:springfox-spring-web-flux:3.0.0
io.springfox:springfox-spring-web-mvc:3.0.0
io.swagger.core.v3:swagger-annotation:2.1.2
io.swagger.core.v3:swagger-models:2.1.2
I am using Spring Boot 2.4.2 and Java 11.
When I run my Spring boot application, I get the following error:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'swagger2ControllerWebMvc' defined in URL [jar:file:/opt/rally/dynamicscreen-service/lib/springfox-swagger2.jar!/springfox/documentation/swagger2/web/Swagger2ControllerWebMvc.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jsonSerializer' defined in springfox.documentation.spring.web.SpringfoxWebConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [springfox.documentation.spring.web.json.JsonSerializer]: Factory method 'jsonSerializer' threw exception; nested exception is java.lang.NoClassDefFoundError: io/swagger/v3/oas/models/OpenAPI
Where could I be doing wrong?
I upgraded my Spring Version from 1.5 to 2.0 and upgraded Prometheus version 0.3.0 to 0.6.0. But unfortunately, it was not working. I was told I have to use MicroMeter instead of SimpleClient and added io.micrometer to my pom.xml and #EnablePrometheusEndpointremoved for my MetricConfig class but I come across with following error. Do you know why I get such kind of error ?
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'servletEndpointRegistrar' defined in
class path resource
[org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]:
Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate
[org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]:
Factory method 'servletEndpointRegistrar' threw exception; nested
exception is
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'routeControllerEndpoint' defined in
class path resource
[org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointAutoConfiguration.class]:
Unsatisfied dependency expressed through method
'routeControllerEndpoint' parameter 0; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'camelContext' defined in class path resource
[org/apache/camel/spring/boot/CamelAutoConfiguration.class]:
Post-processing of merged bean definition failed; nested exception is
java.lang.IllegalStateException: Failed to introspect Class
[org.apache.camel.impl.DefaultCamelContext] from ClassLoader
[jdk.internal.loader.ClassLoaders$AppClassLoader#77556fd]
I am getting the following issue when Spring boot hibernates Connection.
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bookController': Unsatisfied dependency expressed through field 'bookService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bookServiceImp': Unsatisfied dependency expressed through field 'bookDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bookDaoImp': Unsatisfied dependency expressed through field 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getSessionFactory' defined in class path resource [com/go/myapp/Config/AppConfig.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
If you are building your project with maven look for the pom file. when you add dependencies there are Compile Dependencies for those dependencies. For an Example SpringBoot Starter 1.5.8.Release has https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter/1.5.8.RELEASE
SpringBoot 1.5.8.Release
SpringCore 4.3.12.Release
So please check your dependencies and there compile dependencies .
posting your POM file would help