FIWARE-TMForum / Business-API-Ecosystem

The FIWARE/TMForum Business API Ecosystem allows the monetization of different kind of assets (both digital and physical) during the whole service life cycle, from offering creation to its charging, accounting and revenue settlement and sharing
https://business-api-ecosystem.rtfd.io/
GNU Affero General Public License v3.0
39 stars 22 forks source link

Redeploy fiware-rss/target/DSRevenueSharing.war Fails #54

Closed ibstelix closed 5 years ago

ibstelix commented 5 years ago

Hello @all, please help trying to deploy the last release (v7.6.0) but it fails on: cd business-ecosystem-rss Redeploy fiware-rss/target/DSRevenueSharing.war ... ... `asadmin deploy --force true --contextroot DSRevenueSharing --name DSRevenueSharing fiware-rss/target/DSRevenueSharing.war

STDOUT: Command deploy failed.

STDERR: remote failure: Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cdrsManager': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private es.upm.fiware.rss.service.UserManager es.upm.fiware.rss.service.CdrsManager.userManager; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userManager': Injection of autowired dependencies failed; nested exception is org.springframework.beans.fact... (754 more, please see e.stderr)`

ibstelix commented 5 years ago

Running the deploy command manually fails with asadmin deploy --force true --contextroot DSRevenueSharing --name DSRevenueSharing fiware-rss/target/DSRevenueSharing.war remote failure: Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cdrsManager': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private es.upm.fiware.rss.service.UserManager es.upm.fiware.rss.service.CdrsManager.userManager; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userManager': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private es.upm.fiware.rss.common.properties.AppProperties es.upm.fiware.rss.service.UserManager.oauthProperties; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'oauthProperties' defined in file [/opt/biz-ecosystem/glassfish4/glassfish/domains/domain1/applications/DSRevenueSharing/WEB-INF/classes/META-INF/spring/database.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [es.upm.fiware.rss.common.properties.AppProperties]: Constructor threw exception; nested exception is java.lang.NullPointerException. Please see server.log for more details. Command deploy failed.

ibstelix commented 5 years ago

it was the same issue as in https://github.com/FIWARE-TMForum/business-ecosystem-rss/issues/14

fdelavega commented 5 years ago

there were a missing validation in the code. It should be fixed now

mkoutli commented 5 years ago

Hello, I'm facing a similar issue! At first I had to create the properties folder with the database.properties and oauth.properties files in it, then the output I get when when I run "./install.py redeploy" is:

RAN: /opt/biz-ecosystem/glassfish4/glassfish/bin/asadmin deploy --force true --contextroot DSRevenueSharing --name DSRevenueSharing fiware-rss/target/DSRevenueSharing.war

  STDOUT:
Command deploy failed.

STDERR:
remote failure: Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bmCurrencyLoader': Invocation of init method failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Could not open connection. Please see server.log for more details.

p.s. I can't run again "./install.py all" since it seems that resources and pools are already created in previous steps and this is causing an error, this is why I use "./install.py redeploy".

fdelavega commented 5 years ago

@mkoutli are you using the last version of the code (7.6.0)? there is a bug in previous version that produced such error

mkoutli commented 5 years ago

Yes I 'm using the attached install.py script, which specifies 7.6.0 version. Is there something I could possibly check or fix? Thank you. install.zip

fdelavega commented 5 years ago

@mkoutli from your trace I can see that your error is due to a problem connecting to the database, can you check mysql URL and database credentials in database.properties file?

mkoutli commented 5 years ago

Since there was no properties folder in the "business-api-ecosystem" project, I created a folder with default database.properties and oauth.properties. Then when install.py is executed it copies and modifies these two files in /etc/default/rss folder. I don't recall if I had manually copied the files in the /etc/default/rss folder but for sure they were not modified according to the variable values that exist in the install.py file(maybe permission issues). What I did was that I manually changed the variables values of the files and now redeploy is performed successfully, so it seems that my issue was not related to the problem described above. Thank you for the help.

fdelavega commented 5 years ago

@mkoutli Ok, so I am closing this issue, let us know if you face a new one