Why I am getting Fetching config from server at: http://localhost:8888, everytime I am running spring boot application? - spring-boot

Is it a bug? I followed this Link. Is there any work-around....my Stack-Trace is below
Fetching config from server at : http://localhost:8888
Connect Timeout Exception on Url - http://localhost:8888. Will be trying the next url if available
Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/application/default": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
No active profile set, falling back to default profiles: default
Bootstrapping Spring Data repositories in DEFAULT mode.
Finished Spring Data repository scanning in 31ms. Found 0 repository interfaces.
BeanFactory id=691d8d29-ed5e-3599-85d5-3143f172a939
Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$e56f3e25] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$1894122] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.autoconfigure.RefreshAutoConfiguration$JpaInvokerConfiguration': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class

Related

Error creating bean with name 'springSecurityFilterChain' defined in class path

Hoping are well.
I'm not using web.xml for my spring configuration, and when running my repository tests after migrating to JHipster I'm getting this error:
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'springSecurityFilterChain' defined in
class path resource
[org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]:
Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate [javax.servlet.Filter]: Factory method
'springSecurityFilterChain' threw exception; nested exception is
java.lang.IllegalStateException: Cannot apply
org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer#7744f9fa
to already built object
Is there any recommendation?

Unable to run my springboot web application

I have an spring cloud based project. When I run my application it shows the following error:
Error creating bean with name 'swaggerConfiguration' defined in class path resource [com/humatics/base/commons/swagger/autoconfigure/SwaggerAutoConfiguration.class]:
Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [io.swagger.jaxrs.config.BeanConfig]: Factory method 'swaggerConfiguration' threw exception; nested exception is java.lang.NoSuchMethodError:
com.google.common.collect.Sets$SetView.iterator()Lcom/google/common/collect/UnmodifiableIterator;

Spring Boot + HikariCP - non-deterministic failure to auto-configure a DataSource

On my local machine, when I run one of my Spring Boot 2.0.0 applications from IntelliJ, the application periodically fails to start and the following message is displayed in the console:
Application Failed to Start
Description:
Failed to auto-configure a DataSource: 'spring.datasource.url' is not specified and no embedded datasource could be auto-configured.
Reason: Failed to determine a suitable drive class
When I get this error, if I try to run the application again it will (sometimes) start. The behavior seems non-deterministic. Sometimes the application starts on the first try, sometimes it takes a few consecutive attempts.
Edit ----------------------------------------------------------------------------
The error appears to be caused by the application failing to determine what profile is active. When the application fails to start, the Spring logging output states "No active profile set, falling back to default profiles: default". When the application starts successfully, the logging output states "The following profiles are active: local,permitall", which are the profiles I set to active in application.properties.
Unfortunately, whether or not Spring determines what profile is active when starting is a roll of the dice for me.
----------------------------------------------------------------------------------
My application is configured to use spring-boot-starter-data-jpa and connect to a Postgres database. For connection pooling I use HikariCP 2.7.8.
The console error (see below) implies that Hikari is failing to load a data source. Since this error is non-deterministic, maybe it depends on the order that Spring creates beans during startup?
The spring.datasource.url property is defined in my local application properties file. The application properties file sets the spring active profile property to local.
This is my application.properties file
spring.profiles.active=local,permitall
management.endpoints.web.base-path=/
spring.datasource.driver-class-name=org.postgresql.Driver
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
This is my application-local.properties
spring.datasource.url=jdbc:postgresql://localhost/vms?currentSchema=vms
spring.datasource.username=postgres
spring.datasource.password=postgres
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=update
I haven't found a pattern to the failures or the successes. Any ideas on solving or troubleshooting this problem are appreciated.
Console error message
2018-05-18 13:53:49.667 ERROR 16228 --- [ost-startStop-1] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource
[org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.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.BeanCreationException: Error creating bean with name 'healthEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Bean instantiation via factory method failed;
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthEndpoint]: Factory method 'healthEndpoint' threw exception;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthIndicatorAutoConfiguration': Bean instantiation via constructor failed;
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthIndicatorAutoConfiguration$$EnhancerBySpringCGLIB$$61a24aeb]: Constructor threw exception;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed;
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception;
nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class

Springboot datasource exception

when i put jpaDependencency compile('org.springframework.boot:spring-boot-starter-data-jpa')
i am getting this Exception
2018-02-28 13:18:20.062 WARN 15208 --- [ restartedMain]
ationConfigEmbeddedWebApplicationContext : Exception encountered
during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'inMemoryDatabaseShutdownExecutor'
defined in class path resource
[org/springframework/boot/devtools/autoconfigure/DevToolsDataSourceAutoConfiguration.class]:
Unsatisfied dependency expressed through method
'inMemoryDatabaseShutdownExecutor' parameter 0; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'dataSource' defined in class path resource
[org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]:
Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method
'dataSource' threw exception; nested exception is
org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException:
Cannot determine embedded database driver class for database type
NONE. If you want an embedded database please put a supported one on
the classpath. If you have database settings to be loaded from a
particular profile you may need to active it (no profiles are
currently active).
You need to add a Database driver JAR. If you include an embedded one, Spring Boot will pick and configure it by default.
You can add:
compile("com.h2database:h2")
Check out this getting started guide: https://spring.io/guides/gs/accessing-data-jpa/

Spring Returning eagerly cached - a consequence of a circular reference

I am working on a problem in one of the application I am working on. I am getting the below error.
| DEBUG | org.springframework.beans.factory.support.DefaultListableBeanFactory [237] | Returning eagerly cached instance of singleton bean 'cdmManager' that is not fully initialized yet - a consequence of a circular reference
17 Feb 2014 09:31:43,394 | DEBUG | org.springframework.beans.factory.support.DefaultListableBeanFactory [1307] | Ignoring bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'quoteValidationManager' defined in ServletContext resource [/WEB-INF/applicationContext-service.xml]: Cannot create inner bean 'Full Package of quoteManager' of type [Full Package of Full Package of quoteManager] while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Full Package of quoteManager' defined in ServletContext resource [/WEB-INF/applicationContext-service.xml]: Cannot resolve reference to bean 'onlineManager' while setting bean property 'onlineManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'onlineManager' defined in ServletContext resource [/WEB-INF/applicationContext-service.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'cdmManager': org.springframework.beans.factory.FactoryBeanNotInitializedException: FactoryBean is not fully initialized yet
I could not able to figure why this error is coming. And I could not able to figure out where the Circular reference present in the Object graph.
FYI quoteManager has onlineManager and it has cdmManager.
Please help me how to solve this

Resources