2016-01-06 161 views
1

这是我在这里的第一篇文章。我通常会尽力自己找到所有的东西,但我觉得我已经击中了每一堵墙。我很抱歉,如果我不够具体,但希望有人在这里可以帮助我。 我刚开始使用jHipster并成功生成了一个项目,并将它添加到IntelliJ IDEA(使用试用版)。不幸的是,我一直无法让应用程序运行。我继续收到此错误(必须减少以适应字符限制):JHipster

2016-01-06 11:46:58.838 ERROR 8188 --- [ost-startStop-1] 
o.a.c.c.C.[Tomcat].[localhost].[/]  : Exception starting filter 
springSecurityFilterChain 
org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 
'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration': 
Injection of autowired dependencies failed; 2016-01-06 11:46:58.841 
ERROR 8188 --- [ost-startStop-1] 
o.apache.catalina.core.StandardContext : One or more Filters failed 
to start. Full details will be found in the appropriate container log 
file 2016-01-06 11:46:58.843 ERROR 8188 --- [ost-startStop-1] 
o.apache.catalina.core.StandardContext : Context [] startup failed 
due to previous errors 2016-01-06 11:46:59.897 ERROR 8188 --- [ 
restartedMain] o.s.boot.SpringApplication    : Application 
startup failed 
org.springframework.beans.factory.UnsatisfiedDependencyException: 
Error creating bean with name 'liquibase' defined in class path 
resource [com/contactapp/config/DatabaseConfiguration.class]: 
Unsatisfied dependency expressed through constructor argument with 
index 0 of type [javax.sql.DataSource]: : Error creating bean with 
name 'dataSource' defined in class path resource 
[com/contactapp/config/DatabaseConfiguration.class]: Bean 
instantiation via factory method failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to 
instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw 
exception; nested exception is 
com.zaxxer.hikari.pool.PoolInitializationException: Exception during 
pool initialization: Connection to localhost:5432 refused. Check that 
the hostname and port are correct and that the postmaster is accepting 
TCP/IP connections.; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'dataSource' defined in class path resource 
[com/contactapp/config/DatabaseConfiguration.class]: Bean 
instantiation via factory method failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to 
instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw 
exception; nested exception is 
com.zaxxer.hikari.pool.PoolInitializationException: Exception during 
pool initialization: Connection to localhost:5432 refused. Check that 
the hostname and port are correct and that the postmaster is accepting 
TCP/IP connections. 2016-01-06 11:46:59.907 WARN 8188 --- [ 
restartedMain] o.s.boot.SpringApplication    : Error 
handling failed (Error creating bean with name 
'delegatingApplicationListener' defined in class path resource 
[org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: 
BeanPostProcessor before instantiation of bean failed; nested 
exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 
'org.springframework.cache.annotation.ProxyCachingConfiguration': 
Initialization of bean failed; nested exception is 
org.springframework.beans.factory.NoSuchBeanDefinitionException: No 
bean named 
'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' 
is defined) 

Process finished with exit code 1 

这些只是我收到的错误的开始。我遵循jHipster网站上列出的所有安装程序,包括安装node.js,npm,bower,yo,grunt,maven,git。我正在尝试为此使用Java 8,但没有看到问题是什么,我无法运行没有错误的未修改生成的项目。我遵循指示将Spring添加到模块项目结构中,但无济于事。该项目将进行编译但不会运行。运行“grunt serve”会启动一个空的服务器并使用mvn spring-boot:运行会关闭上面列出的错误,这与仅尝试运行Java应用程序相同。只是要注意我也尝试使用Eclipse的相同错误。如果有人需要更多的信息来帮助我解决这个错误,我会非常乐意提供任何必要的细节。我可以弄清楚在获取应用程序运行后应该做什么,但是无法达到这一点。如果任何人都可以得到任何帮助,我将不胜感激。感谢大家!

+0

com.zaxxer.hikari.pool.PoolInitializationException连接到本地主机:5432拒绝。检查主机名和端口是否正确,postmaster是否接受TCP/IP连接可能是问题的根源 –

+0

'Connection to localhost:5432 refused'是您本地的postgre实例是否正常运行? –

+0

所以我从来没有意识到我需要一个运行在我的机器上的postgres实例(初学者的错误),现在将安装它,看看是否解决了这个问题! – mpgrahov

回答

1

它看起来像错误是连接到您的postgres服务器。确保你有一个数据库名称为application.yml中定义的postgres。如果你不想使用postgres,你可以配置jHipster使用嵌入的H2数据库。

这是错误跟踪是相关的部分:池初始化期间异常:

com.zaxxer.hikari.pool.PoolInitializationException: Exception during 
pool initialization: Connection to localhost:5432 refused. Check that 
the hostname and port are correct and that the postmaster is accepting 
TCP/IP connections.