Bug 1123846 - DataSource and XADataSource standalone and profile components can not be configured when JARs are deployed to EAP server
Summary: DataSource and XADataSource standalone and profile components can not be conf...
Keywords:
Status: CLOSED DUPLICATE of bug 1127869
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Plugin -- JBoss EAP 6, UI
Version: JON 3.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: JON 3.3.0
Assignee: Michael Burman
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On: 1120411 1127869
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-28 12:52 UTC by Michael Burman
Modified: 2014-08-25 09:09 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1120411
Environment:
Last Closed: 2014-08-25 09:09:37 UTC
Type: Bug


Attachments (Terms of Use)

Description Michael Burman 2014-07-28 12:52:27 UTC
+++ This bug was initially created as a clone of Bug #1120411 +++

Description of problem:
When one or more JARs are deployed to an JBoss EAP server as a managed deployment -- such as EJBs, JDBC4 drivers, libraries, and other managed deployments which have a file name that ends with .jar -- DataSource and XADataSource component configuration can not be updated. This is because the _Driver Name_ property contains an invalid value and the available items from the list do not reflect installed or available drivers in the JBoss EAP server.

If there are three or less JARs installed and the current configuration value does not equal the name of one of the JARs, navigating to a DataSource resource's configuration page, the user sees the following error:

    The following configuration properties have invalid values: [Driver Name]. The values must be corrected before the configuration can be saved.

If there are four or more JARs installed, the property changes from a radio-button to a drop-down list. In this case, the error is not displayed but if the target driver is installed as a module or has a corresponding driver entry in the JBoss EAP server's configuration, it is not listed in the drop-down. Meaning that configuration can not be updated or changed. 

This issue also affects new data sources being created.

Version-Release number of selected component (if applicable):
3.2.1

How reproducible:
Always

Steps to Reproduce:
1.  Install and start JBoss EAP 6 standalone server.
2.  Deploy some fake JAR files to JBoss EAP server:

        (
            JBOSS_HOME="${TESTENV_DIR}"'/jboss-eap-6.2.0.GA'
            _tmp="$(mktemp -d)"
            mkdir -p "${_tmp}"/fake-jar-01
            mkdir -p "${_tmp}"/fake-jar-02
            mkdir -p "${_tmp}"/fake-jar-03
            touch "${_tmp}"/fake-jar-01/empty-file
            touch "${_tmp}"/fake-jar-02/empty-file
            touch "${_tmp}"/fake-jar-03/empty-file
            cd "${_tmp}"
            zip -r fake-jar-01.jar fake-jar-01
            zip -r fake-jar-02.jar fake-jar-02
            zip -r fake-jar-03.jar fake-jar-03
            mv *.jar /tmp
            cd /tmp
            rm -rf "${_tmp}"
            "$JBOSS_HOME"/bin/jboss-cli.sh --connect --command="deploy /tmp/fake-jar-01.jar"
            "$JBOSS_HOME"/bin/jboss-cli.sh --connect --command="deploy /tmp/fake-jar-02.jar"
            "$JBOSS_HOME"/bin/jboss-cli.sh --connect --command="deploy /tmp/fake-jar-03.jar"
        )

3.  Install and start JBoss ON system.
4.  Import JBoss EAP standalone server into inventory.
5.  Update connection settings for JBoss EAP resource as needed.
6.  Navigate to the current configuration page of the EAP / datasources / DataSource (Standalone) / ExampleDS resource.
7.  Add another fake JAR file to the JBoss EAP server:

        (
            JBOSS_HOME="${TESTENV_DIR}"'/jboss-eap-6.2.0.GA'
            _tmp="$(mktemp -d)"
            mkdir -p "${_tmp}"/fake-jar-04
            touch "${_tmp}"/fake-jar-04/empty-file
            cd "${_tmp}"
            zip -r fake-jar-04.jar fake-jar-04
            mv *.jar /tmp
            cd /tmp
            rm -rf "${_tmp}"
            "$JBOSS_HOME"/bin/jboss-cli.sh --connect --command="deploy /tmp/fake-jar-04.jar"
        )

8.  Invoke service discovery and wait for it to complete.
9.  Navigate to the current configuration page of the EAP / datasources / DataSource (Standalone) / ExampleDS resource.
10. From _Driver Name_ drop-down, select _fake-jar-01.jar_.
11. Attempt to change _Driver Name_ drop-down back to _h2_ -- its original and correct value.

Actual results:
After step 6., the error banner at the top of the page displays:

    The following configuration properties have invalid values: [Driver Name]. The values must be corrected before the configuration can be saved.
    
You are unable to update any configuration due to the _Driver Name_ field containing an invalid value with no way of fixing it.

After step 9., the control changes from a radio-button to a drop-down and you can now update other configuration properties but as demonstrated in step 11. you can not set _Driver Name_ to a valid driver defined in the JBoss EAP configuration.

Expected results:
_Driver Name_ field after step 6. and step 11. only displays _h2_ as this is the only driver installed in JBoss EAP 6.2.

No error message is displayed at step 6.

Additionally, perhaps a separate test case, if a JDBC 4 driver has been deployed, it too show appear as a valid option.

Additional info:
The UI control switch between step 6. and step 9. seems strange. It would make sense that the current selection -- of _h2_ -- appear as a radio-button after step 6. However, I am sure it would if the available drivers were actually being displayed.

One can see the actual available drivers:

    "$JBOSS_HOME"/bin/jboss-cli.sh --connect --command="/subsystem=datasources:installed-drivers-list"

    {
        "outcome" => "success",
        "result" => [{
            "driver-name" => "h2",
            "deployment-name" => undefined,
            "driver-module-name" => "com.h2database.h2",
            "module-slot" => "main",
            "driver-datasource-class-name" => "",
            "driver-xa-datasource-class-name" => "org.h2.jdbcx.JdbcDataSource",
            "driver-class-name" => "org.h2.Driver",
            "driver-major-version" => 1,
            "driver-minor-version" => 3,
            "jdbc-compliant" => true
        }]
    }

If you deploy a JDBC 4 driver, it too will appear in the above output.

The root cause of this issue is that the _Dirver Name_ property is populated with a list of all JARs deployed in the JBoss EAP server. Not sure why we are doing this as JARs on their own do not equate to datasource driver names. Only JARs that are self-contained JDBC version 4+ drivers can be deployed in this manner. Modules or user defined datasources or XA datasource drivers are configured via modules and server configuration and will never show up in _Deployments_:

        <c:simple-property name="driver-name" required="true" type="string" description="Name of the (existing) JDBC driver to use" readOnly="false">
          <c:option-source target="resource" expression="type=^Deployment$" filter=".*\.jar"/>
        </c:simple-property>

--- Additional comment from Larry O'Leary on 2014-07-16 17:02:59 EDT ---

Screen shot showing error and UI radio-buttons at Step 6. This error prevents the user from updating any of the configuration for ExampleDS datasource.

--- Additional comment from Larry O'Leary on 2014-07-16 18:05:01 EDT ---

Screen shot showing UI drop-down at Step 9. No error here because the drop-down is populated with _ha_ and this is selected by default.

--- Additional comment from Larry O'Leary on 2014-07-16 18:09:25 EDT ---

Screen shot showing UI drop-down at Step 11. Notice that _h2_ is no longer in the drop-down.

Comment 1 Michael Burman 2014-07-28 20:35:06 UTC
Fixed in master

commit e99089debfa95ad99d333c38414ff780b3ecf446
Author: Michael Burman <miburman@redhat.com>
Date:   Mon Jul 28 15:02:43 2014 +0300

    [BZ 1120411] Only allow selecting a proper jdbc driver in the datasource configuration

Comment 2 Michael Burman 2014-07-29 05:21:36 UTC
Hello all, please notice that there is two michael burman in red had.
mburman and miburman. the one who reported this bug is miburman.
So i'm changing the assign for this bug to mibruman@redhat.com.
Best regards, mburman(michael burman-rhevm qe network).

Comment 3 Michael Burman 2014-07-30 20:27:58 UTC
Commits in master solve issues with testing and Profile (need to be applied in this order):

a106392596b6f8e717ee57c7a7b33d8ea891b9e4
c83e8c4536b07b7ea9b6571ef68af11c41018234

Comment 4 Michael Burman 2014-08-25 09:09:37 UTC
Closing as duplicate of BZ 1127869

*** This bug has been marked as a duplicate of bug 1127869 ***


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