Bug 1478094

Summary: The environment and cache fields are not shown on the JBoss ON page when viewing the configuration of /subsystem=naming/binding entries
Product: [JBoss] JBoss Operations Network Reporter: Filip Brychta <fbrychta>
Component: Plugin -- JBoss EAP 7Assignee: Ruben Vargas Palma <rvargasp>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: high    
Version: JON 3.3.8CC: bkramer, fbrychta, mfoley, rvargasp, spinder
Target Milestone: CR01Keywords: Triaged
Target Release: One-off release   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1477945 Environment:
Last Closed: 2018-02-16 10:02:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1477947    
Bug Blocks: 1387292    

Description Filip Brychta 2017-08-03 14:44:43 UTC
+++ This bug was initially created as a clone of Bug #1477945 +++

Description of problem:
The environment and cache fields are not shown on the JBoss ON page when viewing the configuration of /subsystem=naming/binding entries

Version-Release number of selected component (if applicable):
JBoss ON 3.3.8

How reproducible:
Every time

Steps to Reproduce:
1. Add object-factory JNDI to the EAP 6 and EAP 7. For instance something like this is added in the standalone.xml file:

*********************************
<subsystem xmlns="urn:jboss:domain:naming:2.0">
    <bindings>
      <object-factory name="java:global/MongoClient" module="com.mongodb.jndi" class="com.mongodb.jndi.MongoClientJNDIFactory">
          <environment>
            <property name="mongoClientURI" value="mongodb://username:password:27017,username:password:27017"/>
          </environment>
      </object-factory>
    </bindings>
    <remote-naming/>
</subsystem>
*********************************
Full instructions for this can be found in: https://stackoverflow.com/questions/25311699/custom-jndi-object-factory-in-wildfly-8-for-cdi

2. Start both EAP 6 and EAP 7;
3. Discover newly started EAP 6 and EAP 7 and add them to the inventory;
4. Navigate to JBoss ON UI -> EAP 6 resource -> Subsystem -> naming -> Bindings -> java:global/MongoClient resource -> Configuration tab -> and check what's visible there.

Actual results:
Visible fields are: Binding Type, Class, Lookup, Module, Type and Value. However, Environment and Cache fields are not there.

Expected results:
Everything should be visible - including Environment and Cache fields. 

Additional info:

Comment 1 Ruben Vargas Palma 2017-11-02 03:29:48 UTC
commit 4eea9fcdb513829bfa9015b8769b1a3327afd215
Merge: 1c3fe4e 345ee33
Author: Josejulio Martínez <finwemartinez>
Date:   Mon Oct 30 12:31:45 2017 -0600

    Merge pull request #331 from rubenvp8510/BZ1477945
    
    BZ 1477945 Added environment and cache fields to subsystem=naming/binding entries

commit 345ee331465cb94a3eb5cb3ac2c7a3ca917fa08e
Author: Ruben Vargas <ruben.vp8510>
Date:   Thu Oct 19 03:26:53 2017 -0500

    Added cache field on subsystem=naming/binding

commit e0dc488165bd7d8b321c174244a2a8ba5097d5bc
Author: Ruben Vargas <ruben.vp8510>
Date:   Wed Oct 18 18:54:58 2017 -0500

    Enviroment parameter added to named subsystem



* BZ name on the commit message is wrong.

Comment 4 Filip Brychta 2017-11-16 14:24:20 UTC
Missing fields are added but attempt to update Cache field fails with {WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:={Operation step-7=WFLYNAM0061: Binding type object-factory can not take a 'cache' attribute}}, rolled-back=true

Update of Environment properties works fine.

Issue is visible in both standalone and domain.

Comment 5 Ruben Vargas Palma 2017-11-17 05:11:18 UTC
@Filip

According to the documentation found here: https://docs.jboss.org/author/display/WFLY10/Global+Bindings+Configuration

It seems like the only binding type that has cache attribute (or allow it) is the "external-context" binding type, so that is why setting cache attribute on an "object-factory" binding type throws an error.

By the way, it seems like we don't support "external-context" binding type. (there is no way to set that type of binding on the UI)

So is it OK to remove the cache attribute?

Also it seems like the same happens for other binding types, for instance "simple" binding type doesn't allow to set environment attribute , so I think is ok if the user tries to set it and the operation fails.

WDYT?

Comment 6 Filip Brychta 2017-11-20 11:53:05 UTC
Discussed the issue with EAP QE. This behavior is expected. jboss-cli is showing all attributes for all binding types and keeps those which are not applicable for given binding type as undefined. Attempt to update attribute which is not applicable for given binding type fails. User is expected to only update expected attributes.

Marking as verified

I created new bz1515201 for missing external-context type