我正在尝试将默认的JHipster UUA应用程序部署到我的cloudfoundry(prod配置文件),并将MySQL作为数据库选项。 MySQL服务已创建并正确绑定到应用程序。我已经发布了下面的stackstrace和cf env。请注意,我用[括号之间的东西]模糊了连接信息。
两个主要错误突出,我怀疑第一个错误与另一个相关:
我正在使用yo jhipster:cloudfoundry
进行部署,选择prod配置文件(但也尝试过手动)并编辑了bootstrap-prod.yml
和application-prod.yml
以包含我的Jhipster-registry实例的网址在相同的cloudfoundry空间运行(并没有问题)。因此spring.cloud.config.uri
和client.serviceUrl.defaultZone
成为:http://admin:admin@jhipsterregistry.[my.domain.com]/config
。此外,我使用sping conneorers进行cloudfoundry,并为在生产中部署时使用的云配置文件定义了数据源。见下文。
@Configuration
@Profile(Constants.SPRING_PROFILE_CLOUD)
public class CloudDatabaseConfiguration extends AbstractCloudConfig {
private final Logger log = LoggerFactory.getLogger(CloudDatabaseConfiguration.class);
@Bean
public DataSource dataSource(CacheManager cacheManager) {
log.info("Configuring JDBC datasource from a cloud provider");
return connectionFactory().dataSource();
}
}
的pom.xml
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-cloudfoundry-connector</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-spring-service-connector</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-localconfig-connector</artifactId>
</dependency>
和我的主要app.java。
@ComponentScan
@EnableAutoConfiguration(exclude = { MetricFilterAutoConfiguration.class, MetricRepositoryAutoConfiguration.class })
@EnableConfigurationProperties({ JHipsterProperties.class, LiquibaseProperties.class })
@EnableEurekaClient
public class JanusApp { .. }
以下是环境变量和失败应用程序的日志。 JHipster网站上未提供其他信息。任何帮助将不胜感激。
应用环境变量:
$ cf env janus
Getting env variables for app janus in org [something] / space dev as [someone@something.com]...
OK
System-Provided:
{
"VCAP_SERVICES": {
"p-mysql": [
{
"credentials": {
"hostname": "10.10.32.14",
"jdbcUrl": "jdbc:mysql://[generated]:[generated]@10.10.32.14:3306/cf_42fa757f_80f1_[remainder]",
"name": "cf_42fa757f_80f1_[remainder]",
"password": "[generated]",
"port": 3306,
"uri": "mysql://[generated]:[generated]@10.10.32.14:3306/cf_42fa757f_80f1_[remainder]?reconnect=true",
"username": "[generated]"
},
"label": "p-mysql",
"name": "janus",
"plan": "100mb-dev",
"provider": null,
"syslog_drain_url": null,
"tags": [
"mysql"
]
}
]
}
}
{
"VCAP_APPLICATION": {
"application_id": "435b6c8c-ca4b-46b8-a769-65fc5eacd7dd",
"application_name": "janus",
"application_uris": [
"janus.[my.domain.com]"
],
"application_version": "4c8084ec-3f83-4518-8129-4bf3c3e38594",
"limits": {
"disk": 1024,
"fds": 16384,
"mem": 1024
},
"name": "janus",
"space_id": "eba312c0-9643-45b7-ba36-d6dfd523e4ae",
"space_name": "dev",
"uris": [
"janus.[my.domain.com]"
],
"users": null,
"version": "4c8084ec-3f83-4518-8129-4bf3c3e38594"
}
}
应用程序日志:
2016-08-12T07:49:32.56+0200 [DEA/56] OUT Stopping app instance (index 0) with guid 435b6c8c-ca4b-46b8-a769-65fc5eacd7dd
2016-08-12T07:49:32.56+0200 [DEA/56] OUT Stopped app instance (index 0) with guid 435b6c8c-ca4b-46b8-a769-65fc5eacd7dd
2016-08-12T07:56:06.08+0200 [DEA/12] OUT Starting app instance (index 0) with guid 435b6c8c-ca4b-46b8-a769-65fc5eacd7dd
2016-08-12T07:56:11.15+0200 [App/0] OUT 05:56:11.147 [main] DEBUG org.springframework.beans.factory.config.YamlPropertiesFactoryBean - Loading from YAML: class path resource [config/application.yml]
2016-08-12T07:56:11.19+0200 [App/0] OUT 05:56:11.198 [main] DEBUG org.springframework.beans.factory.config.YamlPropertiesFactoryBean - Merging document (no matchers set): {eureka={instance={appname=janus, instanceId=janus:${spring.application.instance_id:${random.value}}}}, ribbon={eureka={enabled=true}}, management={context-path=/management, health={mail={enabled=false}}}, spring={application={name=janus}, profiles={active=prod}, jackson={serialization.write_dates_as_timestamps=false}, jpa={open-in-view=false, hibernate={ddl-auto=none, naming-strategy=org.springframework.boot.orm.jpa.hibernate.SpringNamingStrategy}}, messages={basename=i18n/messages}, mvc={favicon={enabled=false}}, thymeleaf={mode=XHTML}}, security={basic={enabled=false}}, jhipster={async={corePoolSize=2, maxPoolSize=50, queueCapacity=10000}, mail={from=janus@localhost}, swagger={title=janus API, description=janus API documentation, version=0.0.1, termsOfServiceUrl=null, contactName=null, contactUrl=null, contactEmail=null, license=null, licenseUrl=null}, ribbon={displayOnActiveProfiles=dev}}}
2016-08-12T07:56:11.19+0200 [App/0] OUT 05:56:11.199 [main] DEBUG org.springframework.beans.factory.config.YamlPropertiesFactoryBean - Loaded 1 document from YAML resource: class path resource [config/application.yml]
2016-08-12T07:56:13.14+0200 [App/0] OUT 2016-08-12 05:56:13.145 INFO 29 --- [ main] pertySourceApplicationContextInitializer : Adding 'cloud' PropertySource to ApplicationContext
2016-08-12T07:56:13.26+0200 [App/0] OUT 2016-08-12 05:56:13.266 INFO 29 --- [ main] nfigurationApplicationContextInitializer : Adding cloud service auto-reconfiguration to ApplicationContext
2016-08-12T07:56:14.11+0200 [App/0] OUT 2016-08-12 05:56:14.116 INFO 29 --- [ main] urceCloudServiceBeanFactoryPostProcessor : Auto-reconfiguring beans of type javax.sql.DataSource
2016-08-12T07:56:14.12+0200 [App/0] OUT 2016-08-12 05:56:14.119 INFO 29 --- [ main] urceCloudServiceBeanFactoryPostProcessor : No beans of type javax.sql.DataSource found. Skipping auto-reconfiguration.
2016-08-12T07:56:15.25+0200 [App/0] OUT ██ ██ ██ ████████ ███████ ██████ ████████ ████████ ███████
2016-08-12T07:56:15.25+0200 [App/0] OUT ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
2016-08-12T07:56:15.25+0200 [App/0] OUT ██ ████████ ██ ███████ █████ ██ ██████ ███████
2016-08-12T07:56:15.25+0200 [App/0] OUT ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
2016-08-12T07:56:15.25+0200 [App/0] OUT ██████ ██ ██ ████████ ██ ██████ ██ ████████ ██ ██
2016-08-12T07:56:15.25+0200 [App/0] OUT :: JHipster :: Running Spring Boot 1.3.6.RELEASE ::
2016-08-12T07:56:15.25+0200 [App/0] OUT :: http://jhipster.github.io ::
2016-08-12T07:56:15.86+0200 [App/0] OUT 2016-08-12 05:56:15.861 INFO 29 --- [ main] nfigurationApplicationContextInitializer : Adding cloud service auto-reconfiguration to ApplicationContext
2016-08-12T07:56:15.86+0200 [App/0] OUT 2016-08-12 05:56:15.863 INFO 29 --- [ main] com.philips.janus.JanusApp : The following profiles are active: cloudfoundry,prod,cloudfoundry,cloud
2016-08-12T07:56:19.13+0200 [App/0] OUT 2016-08-12 05:56:19.135 WARN 29 --- [ main] o.s.c.a.ConfigurationClassPostProcessor : Cannot enhance @Configuration bean definition 'org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerEndpointsConfiguration$TokenKeyEndpointRegistrar' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
2016-08-12T07:56:19.13+0200 [App/0] OUT 2016-08-12 05:56:19.135 WARN 29 --- [ main] o.s.c.a.ConfigurationClassPostProcessor : Cannot enhance @Configuration bean definition 'refreshScope' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
2016-08-12T07:56:19.48+0200 [App/0] OUT 2016-08-12 05:56:19.481 INFO 29 --- [ main] urceCloudServiceBeanFactoryPostProcessor : Skipping auto-reconfiguring beans of type javax.sql.DataSource
2016-08-12T07:56:19.48+0200 [App/0] OUT 2016-08-12 05:56:19.482 INFO 29 --- [ main] ongoCloudServiceBeanFactoryPostProcessor : Skipping auto-reconfiguring beans of type org.springframework.data.mongodb.MongoDbFactory
2016-08-12T07:56:19.48+0200 [App/0] OUT 2016-08-12 05:56:19.482 INFO 29 --- [ main] bbitCloudServiceBeanFactoryPostProcessor : Skipping auto-reconfiguring beans of type org.springframework.amqp.rabbit.connection.ConnectionFactory
2016-08-12T07:56:19.48+0200 [App/0] OUT 2016-08-12 05:56:19.482 INFO 29 --- [ main] edisCloudServiceBeanFactoryPostProcessor : Skipping auto-reconfiguring beans of type org.springframework.data.redis.connection.RedisConnectionFactory
2016-08-12T07:56:20.85+0200 [App/0] OUT 2016-08-12 05:56:20.853 INFO 29 --- [ main] c.h.instance.DefaultAddressPicker : [LOCAL] [dev] [3.6.1] Prefer IPv4 stack is true.
2016-08-12T07:56:20.86+0200 [App/0] OUT 2016-08-12 05:56:20.867 INFO 29 --- [ main] c.h.instance.DefaultAddressPicker : [LOCAL] [dev] [3.6.1] Picked Address[10.254.1.126]:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701], bind any local is true
2016-08-12T07:56:21.62+0200 [App/0] OUT 2016-08-12 05:56:21.627 INFO 29 --- [ main] com.hazelcast.spi.OperationService : [10.254.1.126]:5701 [dev] [3.6.1] Backpressure is disabled
2016-08-12T07:56:22.59+0200 [App/0] OUT 2016-08-12 05:56:22.594 INFO 29 --- [ main] com.hazelcast.system : [10.254.1.126]:5701 [dev] [3.6.1] Hazelcast 3.6.1 (20160228 - d0d2a77) starting at Address[10.254.1.126]:5701
2016-08-12T07:56:22.59+0200 [App/0] OUT 2016-08-12 05:56:22.594 INFO 29 --- [ main] com.hazelcast.system : [10.254.1.126]:5701 [dev] [3.6.1] Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
2016-08-12T07:56:22.59+0200 [App/0] OUT 2016-08-12 05:56:22.594 INFO 29 --- [ main] com.hazelcast.system : [10.254.1.126]:5701 [dev] [3.6.1] Configured Hazelcast Serialization version : 1
2016-08-12T07:56:22.60+0200 [App/0] OUT 2016-08-12 05:56:22.607 INFO 29 --- [ main] com.hazelcast.instance.Node : [10.254.1.126]:5701 [dev] [3.6.1] Creating MulticastJoiner
2016-08-12T07:56:22.61+0200 [App/0] OUT 2016-08-12 05:56:22.614 INFO 29 --- [ main] com.hazelcast.core.LifecycleService : [10.254.1.126]:5701 [dev] [3.6.1] Address[10.254.1.126]:5701 is STARTING
2016-08-12T07:56:25.78+0200 [App/0] OUT 2016-08-12 05:56:25.780 INFO 29 --- [ main] c.h.cluster.impl.MulticastJoiner : [10.254.1.126]:5701 [dev] [3.6.1]
2016-08-12T07:56:25.78+0200 [App/0] OUT Members [1] {
2016-08-12T07:56:25.78+0200 [App/0] OUT Member [10.254.1.126]:5701 this
2016-08-12T07:56:25.78+0200 [App/0] OUT }
2016-08-12T07:56:25.84+0200 [App/0] OUT 2016-08-12 05:56:25.847 INFO 29 --- [ main] com.hazelcast.core.LifecycleService : [10.254.1.126]:5701 [dev] [3.6.1] Address[10.254.1.126]:5701 is STARTED
2016-08-12T07:56:28.16+0200 [App/0] OUT 2016-08-12 05:56:28.165 INFO 29 --- [ost-startStop-1] com.philips.janus.config.WebConfigurer : Web application configuration, using profiles: [ cloudfoundry, prod, cloudfoundry, cloud]
2016-08-12T07:56:28.17+0200 [App/0] OUT 2016-08-12 05:56:28.175 INFO 29 --- [ost-startStop-1] com.philips.janus.config.WebConfigurer : Web application fully configured
2016-08-12T07:56:29.31+0200 [App/0] OUT 2016-08-12 05:56:29.315 INFO 29 --- [ost-startStop-1] c.p.j.config.CloudDatabaseConfiguration : Configuring JDBC datasource from a cloud provider
2016-08-12T07:56:29.80+0200 [App/0] OUT 2016-08-12 05:56:29.807 WARN 29 --- [ost-startStop-1] o.a.tomcat.jdbc.pool.ConnectionPool : maxIdle is larger than maxActive, setting maxIdle to: 4
2016-08-12T07:56:29.91+0200 [App/0] OUT 2016-08-12 05:56:29.917 ERROR 29 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Exception starting filter springSecurityFilterChain
2016-08-12T07:56:29.91+0200 [App/0] OUT org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.setFilterChainProxySecurityConfigurer(org.springframework.security.config.annotation.ObjectPostProcessor,java.util.List) throws java.lang.Exception; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uaaWebSecurityConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.security.core.userdetails.UserDetailsService com.philips.janus.config.UaaWebSecurityConfiguration.userDetailsService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.philips.janus.repository.UserRepository com.philips.janus.security.UserDetailsService.userRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Cannot create inner bean '(inner bean)#5b9e4908' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#5b9e4908': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [com/philips/janus/config/DatabaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.DatabaseException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "[generated]@10.10.32.14:3306"'.
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:368)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1060)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.web.filter.DelegatingFilterProxy.initDelegate(DelegatingFilterProxy.java:326)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.web.filter.DelegatingFilterProxy.initFilterBean(DelegatingFilterProxy.java:235)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:199)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:109)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4689)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5329)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397)
2016-08-12T07:56:29.91+0200 [App/0] OUT at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2016-08-12T07:56:29.91+0200 [App/0] OUT at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
2016-08-12T07:56:29.91+0200 [App/0] OUT at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
2016-08-12T07:56:29.91+0200 [App/0] OUT at java.lang.Thread.run(Thread.java:745)
2016-08-12T07:56:29.91+0200 [App/0] OUT Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.setFilterChainProxySecurityConfigurer(org.springframework.security.config.annotation.ObjectPostProcessor,java.util.List) throws java.lang.Exception; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uaaWebSecurityConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.security.core.userdetails.UserDetailsService com.philips.janus.config.UaaWebSecurityConfiguration.userDetailsService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.philips.janus.repository.UserRepository com.philips.janus.security.UserDetailsService.userRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Cannot create inner bean '(inner bean)#5b9e4908' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#5b9e4908': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [com/philips/janus/config/DatabaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.DatabaseException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "[generated]@10.10.32.14:3306"'.
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:661)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
2016-08-12T07:56:29.91+0200 [App/0] OUT at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
2016-08-12T07:56:29.91+0200 [App/0] OUT ... 31 common frames omitted
2016-08-12T07:56:29.91+0200 [App/0] OUT Caused by: org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uaaWebSecurityConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.security.core.userdetails.UserDetailsService com.philips.janus.config.UaaWebSecurityConfiguration.userDetailsService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.philips.janus.repository.UserRepository com.philips.janus.security.UserDetailsService.userRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Cannot create inner bean '(inner bean)#5b9e4908' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#5b9e4908': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [com/philips/janus/config/DatabaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.DatabaseException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "[generated]@10.10.32.14:3306"'.
答案 0 :(得分:1)
No beans of type javax.sql.DataSource found. Skipping auto-reconfiguration.
消息来自Java Buildpack auto-reconfiguration库。只要检测到Spring应用程序正在部署,JBP就会在暂存期间将此库添加到应用程序类路径中。该库在Spring应用程序上下文中查找单个类型为DataSource
的bean,如果找到则将其交换为配置了绑定关系数据库服务的连接详细信息的DataSource
bean。
您是否希望此JHipster应用程序在Spring应用程序上下文中提供DataSource
bean?
不要期望JBP自动重新配置库为已经在应用程序中的bean替换现有的DataSource
bean,更好的方法是让Spring Cloud Connectors生成DataSource
绑定到应用程序的数据库中的bean。为此,您只需将Connectors dependencies添加到项目中,并在Spring配置中添加enable service scanning。