Openshift WildFly custom system properties and datasource definitions do not survive an app restart

StackOverflow https://stackoverflow.com/questions/23425730

  •  14-07-2023
  •  | 
  •  

Pergunta

My application needs EclipseLink, thus after I created my WildFly cart I ssh to the account and do:

jboss-cli.sh -c --controller=$OPENSHIFT_WILDFLY_IP:$OPENSHIFT_WILDFLY_MANAGEMENT_HTTP_PORT
/system-property=eclipselink.archive.factory:add(value=org.jipijapa.eclipselink.JBossArchiveFactoryImpl)

the system property is defined fine. However it is lost after

ctl_app restart

It is the same for a newly defined datasource.

It looks like Openshift resets everything and deploys the cart from scratch. Any opinions why?

Foi útil?

Solução

The recommended way to make configuration changes is to update the standalone.xml configuration file that exists inside your OpenShift application .openshift/config directory. Every OpenShift application has .openshift directory that contains configuration files that you can update. Everytime you push the source code OpenShift takes your standalone.xml file and apply it. So when you restart the application your changes are overridden. Refer to documentation https://community.jboss.org/wiki/JBossAS7SystemProperties to learn how to add system properties to standalone.xml

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top