Bug 1126646 - Changes to wildfly datasource jndi name are ignored. Default JNDI name used in all cases even when standalone.xml is directly edited.
Summary: Changes to wildfly datasource jndi name are ignored. Default JNDI name used i...
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 2.x
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: libra bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2014-08-05 01:28 UTC by Andrew
Modified: 2015-05-15 00:44 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-08-15 14:19:10 UTC

Attachments (Terms of Use)

Description Andrew 2014-08-05 01:28:14 UTC
Description of problem:

The ability to change the jndi name for the mysql datasource doesn't work. Disabling the data source and changing the name results in the name changing in the UI, but the datasource will not reenable and the managment console shows a generic "an error occured" message in the overlay at the top. Directly editing the standalone.xml file to set the correct jndi name for my application worked until a restart of the application server was required. The name reverted to the original default even though the standalone.xml file still shows the correct (edited) JNDI name. 

Setting this name arbitrarily works on my local wildfly instance. The jndiname in question is java:/MinervaPortalDS which is a legal JNDI name as far as I know. 

Version-Release number of selected component (if applicable):
Current openshift cartridge version (8.1.0 of wildfly)

How reproducible:
Each and every gear restart, or if the gear is idle for a period of time. 

Steps to Reproduce:
1) Setup a fresh wildfly cartridge with a mysql instance. 
2) Attempt to use the mysql datasource after changing the jndi name. 

Actual results:
The datasource can no longer be enabled. The new JNDI name is not available to deployments resulting in unsatisfied dependencies. 

Expected results:
The datasource's jndi name should change and be available to deployments. 

Additional info:

Comment 1 Ben Parees 2014-08-05 17:18:58 UTC
Where did you edit the standalone.xml?  The only place you can make changes to the configuration and expect them to persist is in the .openshift/config/standalone.xml file in your app repository (and then you must push that change)

Otherwise changes you make will be overwritten when the app is restarted, as you observed.

Comment 2 Ben Parees 2014-08-15 14:19:10 UTC
Have not heard from reporter for 10 days...closing.

Andrew, please reopen if you can provide the information from comment #1, otherwise I'm afraid I can't make progress on diagnosing this bug.

Comment 3 Andrew 2014-08-15 14:25:19 UTC
Sorry for the lack of reply. I thought Bugzilla would notify me of updates to the ticket. 

I was editing it in ~/wildfly/standalone/configuration. It is likely that is the problem. I saw no documentation about that. However, shouldn't changes in the management console "take" or are those intended to be transient also? 


Comment 4 Ben Parees 2014-08-15 15:24:38 UTC
Those are also transient unless you set the following environment value:

if you set that, then openshift will not replace your config on each startup and you can freely manipulate it either by hand or via the console.

I believe you can also remove the standalone.xml from your .openshift/config directory in your repo and push the change, from then on the config will not be replaced on startup (since there is no config in your repo anymore).  But the env variable is the intended way to get this behavior.

Comment 5 Andrew 2014-08-15 16:33:23 UTC
Ok. Thanks!

Note You need to log in before you can comment on or make changes to this bug.