tagbangers / wallride

multilingual easy-to-customize open source CMS made by Java
http://wallride.org/
Apache License 2.0
96 stars 81 forks source link

deploying 1.0.0.M15 on beanstalk #90

Closed msegura closed 7 years ago

msegura commented 7 years ago

deploying 1.0.0.M15 on beanstalk seems to fail because with:

log/tomcat8/catalina.2017-08-21.log:Caused by: java.lang.IllegalStateException: wallride.home is empty

Per https://github.com/tagbangers/wallride/issues/69 I suppose a java property wallride.home= is the missing in the beanstalk configuration. http://wallride.org/docs/guide.html#getting-started explains it should be in the s3 bucket.

So I have used something like:

https://s3.us-east-2.amazonaws.com/elasticbeanstalk-us-east-2-../wallride_home

as wallride.home

in the bucket elasticbeanstalk-us-east-2-.. I created wallride_home/config/application.properties with the following content:

# DATASOURCE
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://<value>.us-east-2.rds.amazonaws.com:3306/ebdb
spring.datasource.username=<value>
spring.datasource.password=<value>
spring.datasource.max-active=100
spring.datasource.max-idle=8
spring.datasource.min-idle=8
spring.datasource.initial-size=10
spring.datasource.validation-query=SELECT 1
spring.datasource.test-on-borrow=true
spring.datasource.test-on-return=false
spring.datasource.test-while-idle=true
spring.datasource.time-between-eviction-runs-millis=3600000
spring.datasource.min-evictable-idle-time-millis=10800000
spring.datasource.platform=mysql
spring.datasource.continue-on-error=true

# EMAIL
spring.mail.host=
spring.mail.port=
spring.mail.username=
spring.mail.password=
spring.mail.default-encoding=
spring.mail.properties.mail.smtp.from=
spring.mail.properties.mail.smtp.auth=
spring.mail.properties.mail.smtp.starttls.enable=
spring.mail.properties.mail.smtp.starttls.required=
spring.mail.properties.mail.smtp.localhost=
spring.mail.properties.mail.from=

# THYMELEAF
spring.thymeleaf.prefix.admin=classpath:/templates/admin/
spring.thymeleaf.prefix.guest=classpath:/templates/guest/
spring.thymeleaf.prefix.mail=classpath:/mail/
spring.thymeleaf.suffix=.html
spring.thymeleaf.view-names=*
spring.thymeleaf.mode=HTML5
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.content-type=text/html
spring.thymeleaf.cache=true

# MVC
spring.mvc.static-path-pattern=/resources/**

# HIBERNATE
spring.jpa.database=MYSQL
spring.jpa.properties.hibernate.dialect=org.wallride.autoconfigure.ExtendedMySQL5InnoDBDialect
spring.jpa.properties.hibernate.globally_quoted_identifiers=true
spring.jpa.properties.hibernate.physical_naming_strategy=org.wallride.autoconfigure.PhysicalNamingStrategySnakeCaseImpl
spring.jpa.properties.hibernate.show_sql=false
spring.jpa.properties.hibernate.format_sql=false

# HIBERNATE SEARCH
spring.jpa.properties.hibernate.search.default.directory_provider=org.wallride.autoconfigure.InfinispanSingletonCacheManagerDirectoryProvider
spring.jpa.properties.hibernate.search.default.exclusive_index_use=false
#spring.jpa.properties.hibernate.search.default.directory_provider=infinispan
#spring.jpa.properties.hibernate.search.infinispan.configuration_resourcename=default-hibernatesearch-infinispan.xml
#spring.jpa.properties.hibernate.search.infinispan.configuration.transport_override_resourcename=${jgroups.configurationFile}
spring.jpa.properties.hibernate.search.analyzer=org.apache.lucene.analysis.ja.JapaneseAnalyzer
spring.jpa.properties.hibernate.search.lucene_version=LUCENE_CURRENT

# SERVER
server.error.whitelabel.enabled=false

# JGROUPS
jgroups.configurationFile=jgroups-ec2.xml
jgroups.s3.bucket=elasticbeanstalk-us-east-2..

The value of spring.datasource.url, spring.datasource.username and spring.datasource.password came from an RDS instance created through beanstalk (as the data tier).

However tomcat keeps failing with

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource' defined in class path resource [org/wallride/autoconfigure/WallRideMessageSourceConfiguration.class]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.cache.annotation.ProxyCachingConfiguration': Unsatisfied dependency expressed through method 'setConfigurers' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.wallride.autoconfigure.WallRideCacheConfiguration': Unsatisfied dependency expressed through field 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:479)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
    at org.springframework.context.support.AbstractApplicationContext.initMessageSource(AbstractApplicationContext.java:713)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
    at org.springframework.boot.web.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:151)
    at org.springframework.boot.web.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:131)
    at org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:86)
    at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    ... 10 more

any clue? does http://wallride.org/docs/guide.html#getting-started apply to the master branch and not to the release version?

thanks a lot !

bourbonizable commented 7 years ago

Hi @msegura ! We're sorry that our documentation was short of information We added "how to run the app" section in it Please look at the link, which describes running app using AWS Elastic Beanstalk The only thing you missed is to add the environment properties for Elastic Beanstalk. Would you try it again and let us know how it goes?

BTW we have released the version M16, please have a look when you are available!

msegura commented 7 years ago

hey this is awesome ! I will give it a try and let you know how it goes ! thanks a bunch !

msegura commented 7 years ago

it worked thanks a lot !