I have a cluster of servers (Windows & UNIX). When I'm running a jar file I'm receiving this error on some of the servers at my cluster (regardless of the OS type).
***************************
APPLICATION FAILED TO START
***************************
Description:
Field settingsDao in com.ogydocs.wave.service.ApplicationSettingsLoader required a bean named 'cacheManager' that could not be found.
The injection point has the following annotations:
- #org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean named 'cacheManager' in your configuration.
Related
Whenever I am trying to connect my SQL server to the spring boot in java with the use of Connection string I am getting these two error
java.lang.RuntimeException: Driver com.microsoft.sqlserver.jdbc.SQLServerDriver claims to not accept jdbcUrl
Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Bean instantiation via factory method failed;
I am using this connection string
--> spring.datasource.url="jdbc:sqlserver://Server name;" + "databaseName=databasename;"
spring.datasource.username=userid
spring.datasource.password=password
and using this driver class
--> spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SQLServerDialect
I am developling a Springboot Application with an active database. First, I tried configuring my database by adding the following in application.properties:
spring.datasource.url = jdbc:mysql://127.0.0.1:3306/schema_name?characterEncoding=UTF-8&serverTimezone=GMT%2B8
spring.datasource.username = root
spring.datasource.password = password
spring.datasource.driver-class-name = com.mysql.jdbc.Driver
spring.jpa.properties.hibernate.hdm2ddl.auto = update
spring.jpa.show-sql = true
spring.jpa.properties.hibernate.format_sql = true
The Springboot Application can run perfectly fine with this configuration. However, as I try to move the above configuration lines in application-dev.properties and add spring.profiles.active = dev in my original application.properties, the following error yields:
2021-04-10 11:29:59.097 WARN 58148 --- [ restartedMain] ConfigServletWebServerApplicationContext : 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$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
2021-04-10 11:29:59.103 INFO 58148 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2021-04-10 11:29:59.134 INFO 58148 --- [ restartedMain] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-04-10 11:29:59.172 ERROR 58148 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (the profiles dev are currently active).
I searched for solutions but all of them suggests to either disable/exclude JPA (not the case) or configure the database connection properly (which I did, and succeeded in the main profile); from the error message it is also shown that dev profile is active. How can I solve this problem?
I`m working on a Spring Boot project and I tried to switch our IDE from STS to Intellij CE. Everything is working fine except when debugging. Whenever I change a Java class, the Spring tries to restart the whole application and fail with the following message:
web - 2018-09-27 08:39:18,494 [restartedMain] WARN o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.xyz.service.IUserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#org.springframework.beans.factory.annotation.Autowired(required=true)}
web - 2018-09-27 08:39:18,496 [restartedMain] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default'
web - 2018-09-27 08:39:18,498 [restartedMain] INFO o.a.catalina.core.StandardService - Stopping service [Tomcat]
web - 2018-09-27 08:39:18,524 [restartedMain] INFO o.s.b.a.l.AutoConfigurationReportLoggingInitializer -
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
web - 2018-09-27 08:39:18,871 [restartedMain] ERROR o.s.b.d.LoggingFailureAnalysisReporter -
***************************
APPLICATION FAILED TO START
***************************
Description:
Field userService in com.xyz.controller.UserController required a bean of type 'com.xyz.service.IUserService' that could not be found.
Action:
Consider defining a bean of type 'com.xyz.service.IUserService' in your configuration.
Here is some context about the environment:
The spring-boot-devtools 1.5.9 dependency is added to our pom.xml
The option "Preferences->Build, Execution, Deployment->Compiler->Build project automatically" is checked
I've tried debug with the option "cmd+shift+a->Registry->compiler.automake.allow.when.app.running" both checked and unchecked
The IDE version is
IDE version
The spring-boot-starter-parent version is 1.5.9.RELEASE
The following structure describes the class hierarchy:
com.xyz
|-service
| |-IUserService
| |-impl
| |-UserService
|-controller
|-UserController
UserService.java is annotated with #org.springframework.stereotype.Service
UserController has the following field: #Autowired
private IUserService userService
Also, I've tried all the answers from this thread but didn't manage to solve the problem. Has anyone faced this issue? The expected behavior is not restart the whole application and hot swap only the changed artifacts.
Edit:
Here's the UserController sample:
#org.springframework.web.bind.annotation.RestController
#RequestMapping(value = "/user", produces = MediaType.APPLICATION_JSON_VALUE)
public class UserController{
#Autowired
private IUserService userService;
...
}
There is an option in the Spring Boot run configuration to try hot swapping before restarting the application context:
The correct trigger file option will automatically be added to the command line.
ERROR: org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Cannot
create PoolableConnectionFactory (Access denied for user
'root'#'localhost' (using password: YES))
WARN :
org.springframework.web.context.support.XmlWebApplicationContext -
Exception encountered during context initialization - cancelling
refresh attempt:
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'userDao': Unsatisfied dependency
expressed through field 'sessionFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException:
Error
creating bean with name 'sessionFactory' defined in ServletContext
resource [/WEB-INF/spring/appServlet/dao-context.xml]: Invocation of
init method failed; nested exception is
org.hibernate.exception.GenericJDBCException: Unable to open JDBC
Connection for DDL execution ERROR:
org.springframework.web.context.ContextLoader - Context initialization
failed
JDBC Connection properties file
jdbc.username = root
jdbc.password= 1234
jdbc.driverClassName = com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/estore
mysql grant follow picture
My spring web project is not running by MySQL Access deny Error
Please Help me
I have created a uaa war by following these steps:
$ git clone git://github.com/cloudfoundry/uaa.git
$ cd uaa
$ ./gradlew :cloudfoundry-identity-uaa:war
When i deploy the war to tomcat i am getting the following exception
[2017-04-19 15:24:20.797] cloudfoundry-identity-server/uaa - ???? [localhost-startStop-1] .... ERROR --- DispatcherServlet: Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'identityZoneConfigurationBootstrap' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Could not resolve placeholder 'login.serviceProviderKey' in string value "${login.serviceProviderKey}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'login.serviceProviderKey' in string value "${login.serviceProviderKey}"
I am trying to deploy this on tomcat version 9 running locally and plan to get an AWS instance running with tomcat and deploy uaa on it.
Are there any steps i'm missing when deploying to tomcat? Can we deploy a uaa war to tomcat this way or do i have to deploy it to cloudfoundry?
A default configuration is embedded in the war file, you can ask to load it adding to the JVM options :
-DLOGIN_CONFIG_URL=classpath:required_configuration.yml