Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prod deployment is not working #315

Closed
jackygrahamez opened this issue May 18, 2014 · 5 comments
Closed

prod deployment is not working #315

jackygrahamez opened this issue May 18, 2014 · 5 comments
Milestone

Comments

@jackygrahamez
Copy link

I managed to get the dev deployment working ok so I decided to try the prod profile. First I tried this method which failed:

mvn -Pprod spring-boot:run

Then I tried building then running java

mvn -Pprod package
java -jar target/john-g-shultz-0.1-SNAPSHOT.war --spring.profiles.active=prod

In both instances the deploy seems to fail to with the same errors that indicate to me that I need to configure the port and hostname, but I don't know where to configure these.

jgsmacbook:john_g_shultz jgs$ java -jar target/john-g-shultz-0.1-SNAPSHOT.war --spring.profiles.active=prod
[INFO] com.john_g_shultz.site.Application - Starting Application on jgsmacbook.home with PID 34645 (started by jgs)
[ERROR] com.zaxxer.hikari.HikariPool - Maximum connection creation retries exceeded: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
[ERROR] com.zaxxer.hikari.HikariPool - Maximum connection creation retries exceeded: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
[ERROR] com.zaxxer.hikari.HikariPool - Maximum connection creation retries exceeded: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
[ERROR] com.zaxxer.hikari.HikariPool - Maximum connection creation retries exceeded: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
[ERROR] com.zaxxer.hikari.HikariPool - Timeout of 5000ms encountered waiting for connection.
[ERROR] com.zaxxer.hikari.HikariPool - Maximum connection creation retries exceeded: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
[ERROR] com.zaxxer.hikari.HikariPool - Timeout of 5000ms encountered waiting for connection.
[WARN] org.hibernate.engine.jdbc.internal.JdbcServicesImpl - HHH000342: Could not obtain connection to query metadata : Timeout of 5000ms encountered waiting for connection.
objc[34645]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home//bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
[INFO] com.john_g_shultz.site.config.MetricsConfiguration - Initializing Metrics JMX reporting
[INFO] com.john_g_shultz.site.config.WebConfigurer - Web application configuration, using profiles: [prod]
[INFO] com.john_g_shultz.site.config.WebConfigurer - Web application fully configured
[INFO] com.john_g_shultz.site.Application - Running with Spring profile(s) : [prod]
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - Scanning for api listing references
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - Adding resource to group com_john_g_shultz_site_web_rest_AccountResource for handler method: changePassword
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - Adding resource to group com_john_g_shultz_site_web_rest_AccountResource for handler method: isAuthenticated
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - Adding resource to group com_john_g_shultz_site_web_rest_AccountResource for handler method: getAccount
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - Adding resource to group com_john_g_shultz_site_web_rest_AccountResource for handler method: saveAccount
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - Adding resource to group com_john_g_shultz_site_web_rest_AccountResource for handler method: getCurrentSessions
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - Adding resource to group com_john_g_shultz_site_web_rest_AccountResource for handler method: invalidateSession
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - Adding resource to group com_john_g_shultz_site_web_rest_AuditResource for handler method: findByDates
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - Adding resource to group com_john_g_shultz_site_web_rest_AuditResource for handler method: findAll
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - Adding resource to group com_john_g_shultz_site_web_rest_LogsResource for handler method: getList
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - Adding resource to group com_john_g_shultz_site_web_rest_LogsResource for handler method: changeLevel
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - Adding resource to group com_john_g_shultz_site_web_rest_UserResource for handler method: getUser
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - RequestMappingInfo did not match any include patterns: | {[/api-docs/{resourceKey}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - RequestMappingInfo did not match any include patterns: | {[/api-docs],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - RequestMappingInfo did not match any include patterns: | {[/api-docs/{resourceKey}/{resource}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - RequestMappingInfo did not match any include patterns: | {[/error],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - RequestMappingInfo did not match any include patterns: | {[/error],methods=[],params=[],headers=[],consumes=[],produces=[text/html],custom=[]}
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - RequestMappingInfo did not match any include patterns: | {[/metrics/{name:.*}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - RequestMappingInfo did not match any include patterns: | {[/metrics],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - RequestMappingInfo did not match any include patterns: | {[/mappings],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - RequestMappingInfo did not match any include patterns: | {[/autoconfig],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - RequestMappingInfo did not match any include patterns: | {[/info],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - RequestMappingInfo did not match any include patterns: | {[/configprops],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - RequestMappingInfo did not match any include patterns: | {[/trace],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - RequestMappingInfo did not match any include patterns: | {[/env/{name:.*}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - RequestMappingInfo did not match any include patterns: | {[/env],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - RequestMappingInfo did not match any include patterns: | {[/dump],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - RequestMappingInfo did not match any include patterns: | {[/health],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - RequestMappingInfo did not match any include patterns: | {[/beans],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - Creating resource listing Path: http://localhost:8080/api-docs/john_g_shultz-api/com_john_g_shultz_site_web_rest_AccountResource Description: com.john_g_shultz.site.web.rest.AccountResource Position: 0
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - Creating resource listing Path: http://localhost:8080/api-docs/john_g_shultz-api/com_john_g_shultz_site_web_rest_AuditResource Description: com.john_g_shultz.site.web.rest.AuditResource Position: 1
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - Creating resource listing Path: http://localhost:8080/api-docs/john_g_shultz-api/com_john_g_shultz_site_web_rest_LogsResource Description: com.john_g_shultz.site.web.rest.LogsResource Position: 2
[INFO] com.mangofactory.swagger.scanners.ApiListingReferenceScanner - Creating resource listing Path: http://localhost:8080/api-docs/john_g_shultz-api/com_john_g_shultz_site_web_rest_UserResource Description: com.john_g_shultz.site.web.rest.UserResource Position: 3
[ERROR] com.zaxxer.hikari.HikariPool - Maximum connection creation retries exceeded: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
[ERROR] com.zaxxer.hikari.HikariPool - Timeout of 5000ms encountered waiting for connection.
[INFO] com.john_g_shultz.site.config.CacheConfiguration - Remove Cache Manager metrics
[INFO] com.john_g_shultz.site.config.CacheConfiguration - Closing Cache Manager
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [com/john_g_shultz/site/config/DatabaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.DatabaseException: java.sql.SQLException: Timeout of 5000ms encountered waiting for connection.
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:120)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:648)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:311)
    at com.john_g_shultz.site.Application.main(Application.java:62)
    ... 6 more
Caused by: liquibase.exception.DatabaseException: java.sql.SQLException: Timeout of 5000ms encountered waiting for connection.
    at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:301)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
    ... 19 more
Caused by: java.sql.SQLException: Timeout of 5000ms encountered waiting for connection.
    at com.zaxxer.hikari.HikariPool.getConnection(HikariPool.java:177)
    at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:77)
    at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:296)
    ... 21 more

Interestingly enough however, I just was able to deploy to heroku but it displays the "Development" banner in the top left corner.

This is how I deployed to Heroku

heroku deploy:war --war target/john-g-shultz-0.1-SNAPSHOT.war --app john-g-shultz
@jdubois
Copy link
Member

jdubois commented May 19, 2014

You need to configure your "prod" database access in your "prod" configuration file, for example (in the sample application) here:

https://github.com/jhipster/jhipster-sample-app/blob/master/src/main/resources/config/application-prod.yml

I realize it is not explained clearly in the documentation (it's the usual location, but for people new to Spring Boot this doesn't mean anything):

  • Can you tell me if it's working for you?
  • I will need to update the documentation anyway

@jackygrahamez
Copy link
Author

Ok so I got it to deploy. I had to install postgres. However, I'm missing some markup in the production version. It does not include the main view in production but it does in dev.

@jackygrahamez
Copy link
Author

The missing markup issue seemed to go away not sure why. Maybe the grunt build was not running properly or I had to do a bower update.

@jdubois jdubois added this to the 0.15 milestone May 26, 2014
MathieuAA referenced this issue in MathieuAA/generator-jhipster May 2, 2020
@pdorrestijn
Copy link

I have similar issues:
during startup a context refresh fails because de variables in de application.yml can no longer be resolved....

@atomfrede
Copy link
Member

Please don't comment on an old issue.
If you think this issue still applies, please create a new ticket with proper details.

If you have a question please use Stack Overflow, and tag the question with jhipster. This helps the project to keep the issue tracker clean. Also, Stack Overflow will give your question a larger audience:

  • This will increase your chances to get an answer
  • Answers will be of higher quality, as there is a voting system
  • This will also help other users who might have the same issue, as questions are tagged and easily searchable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants