mpgrahov
mpgrahov

Reputation: 11

Starting with JHipster

this is my first post on here. I generally try to find everything myself but I feel like I've hit every possible wall. I apologize if I'm not specific enough but hope someone here can help me. I just started using jHipster and have successfully generated a project and have also added it to IntelliJ IDEA (using the trial edition). Unfortunately I have not been able to get the application to run. I continue to receive this error (had to cut down to fit in the character constraints):

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

These are just the beginning of errors I have received. I have followed the all of the setup procedures listed on the jHipster website including installing node.js, npm, bower, yo, grunt, maven, git. I am attempting to use Java 8 for this but don't see what the problem is that I can't run an unchanged generated project without errors. I followed instructions to add Spring to the module project structure but to no avail. The project will make and compile but will not run. Running "grunt serve" starts up an empty server and using mvn spring-boot:run closes with the errors listed above which is the same as just trying to run the Java application. Just to note I have also attempted to use Eclipse with the same errors. If anyone needs more information in helping me with this error I'd be more than happy to provide any necessary details. I can figure out what to do after getting the application to run but just can't get it to that point. If anyone can be of any assistance I'd more than appreciate it. Thanks everyone!

Upvotes: 1

Views: 1265

Answers (1)

TheKojuEffect
TheKojuEffect

Reputation: 21081

It looks like the error is with connecting to your postgres server. Make sure you have a postgres running with database name as defined in application.yml. If you don't want to use postgres, you can configure jHipster to use an embedded H2 database.

This is the segment of the error trace that is relevant :

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.

Upvotes: 1

Related Questions