[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Openshift v3 WAR deployment with database



----- Original Message -----
> From: "Sebastian Lorenz" <sebastian p lorenz gmail com>
> To: users lists openshift redhat com
> Sent: Wednesday, May 27, 2015 11:35:20 AM
> Subject: Openshift v3 WAR deployment with database
> 
> Hi,
> I successfully deployed the jee sample app from bparees/javaee7-hol. Now I'm
> trying to use this as a template for my war application with a postgresql
> db.
> The POD for the db is started successfully and the service is available. But
> when starting the application it fails since the Persistence Unit cannot be
> started. If I look into the standalone.xml of the server I see that the
> POSTGRESQL_USER,... env. variables have not been replaced during
> build/deployment. The "enabled" flag for the postgresql db is not set to
> true. From the javaee7-hol example I cannot figure out what triggers the
> enabled flag of the mysql datasource to true? I set the environment
> variables in the ...-sti.json the same way as in the example. But nothing is
> replaced in standalone.xml.
> How/when is the replacement done?

I assume you're doing this with the wildfly-8-centos builder image?  it's a bit hackish i'm afraid since the wildfly image was one of our early samples ported from v2 code (our EAP and EWS images will be/are cleaner), but here's the relevant bit you probably missed:

https://github.com/openshift/wildfly-8-centos/blob/master/wfbin/standalone.conf#L34

So you need to ensure you are a setting a POSTGRESQL_DB_NAME env variable on your pod.

The javaee sample repo does the equivalent for mysql here:
https://github.com/bparees/javaee7-hol/blob/master/application-template-jeebuild.json#L116

that should get this set to true:
https://github.com/openshift/wildfly-8-centos/blob/master/wfcfg/standalone.xml#L165


> 
> Regards, Sebastian
> 
> _______________________________________________
> users mailing list
> users lists openshift redhat com
> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
> 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]