从JHipster开始

时间:2016-01-06 18:16:54

标签: java spring maven intellij-idea jhipster

这是我在这里发表的第一篇文章。我一般都试图找到自己的一切,但我觉得我已经碰到了所有可能的墙。如果我不够具体但我希望有人可以帮助我,我道歉。 我刚开始使用jHipster并成功生成了一个项目,并将其添加到IntelliJ IDEA(使用试用版)。不幸的是我无法运行应用程序。我继续收到此错误(必须减少以适应字符约束):

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添加到模块项目结构中但无济于事。该项目将进行编译但不会运行。跑步"咕噜声"启动一个空的服务器并使用mvn spring-boot:run close与上面列出的错误一样,只是尝试运行Java应用程序。请注意,我也试图使用具有相同错误的Eclipse。如果有人需要更多信息来帮助我解决这个错误,我非常乐意提供任何必要的细节。我可以弄清楚在运行应用程序后要做什么,但却无法达到目的。如果有人可以提供任何帮助,我不仅仅是欣赏它。谢谢大家!

1 个答案:

答案 0 :(得分:1)

看起来错误在于连接到postgres服务器。确保您运行的postgres具有application.yml中定义的数据库名称。如果您不想使用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.