问题描述:

I am pretty new with Jhipster development.

I developped an application with Jhipster (v 3.4.2), the application is working well with postgre in dev mode (the application is running and I can save entities in the database), but when I switch to production mode using mvnw.cmd -Pprod,

the application is working well, but I can't save anything to the database (still postgre)

The odd thing is, I can see all of the created entities when in dev mode in the detailed page of the entity, but I can't add a new one in prod mode as I said.

Both application-dev.yml and application-prod.ymlfiles contain the same datasource (url, name, username and pass).

Moreover, there is no stacktrace when I try to save something in production mode, just an internal Server error on the page, no logs whatsoever.

thank you

网友答案:

To build jhipster with prod profile use:

./mvnw -Pprod package (as you already did)

Now, when starting application make sure u activete PROD profile for running app:

./jhipster-0.0.1-SNAPSHOT.war --spring.profiles.active=prod If you are on Windows, use: java -jar jhipster-0.0.1-SNAPSHOT.war --spring.profiles.active=prod

More details: http://jhipster.github.io/production/

相关阅读:
Top