Bug 1093504 - Failed to resolve expression: ${jndi.name}" ,when configuring Resource adapter for Google spreadsheet
Summary: Failed to resolve expression: ${jndi.name}" ,when configuring Resource adapte...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss Data Virtualization 6
Classification: JBoss
Component: Configuration
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Van Halbert
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-01 23:00 UTC by Anu Saji
Modified: 2018-12-09 17:48 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-05-02 13:42:47 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Anu Saji 2014-05-01 23:00:00 UTC
Description of problem:
***********************
Unable to create Resource adatper using the 
 cli script => create-google-ds.cli and 
 properties file create-google-ds.properties


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

How reproducible:
On windows Taking the command execution exactly as the customer states
*************
C:\jboss-eap-6.1\bin>jboss-cli.bat -c --file=%TEIID_HOME%\docs\teiid\datasources
\google\create-google-ds.cli --properties=%TEIID_HOME%\docs\teiid\datasources\go
ogle\create-google-ds.properties
{"outcome" => "success"}
{
    "outcome" => "failed",
    "failure-description" => "JBAS014802: Cannot resolve expression 'expression
\"${jndi.name}\"' -- java.lang.IllegalStateException: Failed to resolve expressi
on: ${jndi.name}",
    "rolled-back" => true

Same issue in seen when executed on a RHEL box too.



But executing the cli commands individually works

like below

/subsystem=resource-adapters/resource-adapter=google:add(module=org.jboss.teiid.resource-adapter.google)

 /subsystem=resource-adapters/resource-adapter=google/connection-definitions=googleDS:add(jndi-name="java:/spreadsheet", class-name=org.teiid.resource.adapter.google.SpreadsheetManagedConnectionFactory, enabled=true, use-java-context=true)

/subsystem=resource-adapters/resource-adapter=google/connection-definitions=googleDS/config-properties=AuthMethod:add(value="ClientLogin" )

 /subsystem=resource-adapters/resource-adapter=google/connection-definitions=googleDS/config-properties=SpreadsheetName:add(value="changeME" )

/subsystem=resource-adapters/resource-adapter=google/connection-definitions=googleDS/config-properties=Username:add(value="ChangeMe" )

/subsystem=resource-adapters/resource-adapter=google/connection-definitions=googleDS/config-properties=Password:add(value="ChangeMe" )
 /subsystem=resource-adapters/resource-adapter=google/connection-definitions=googleDS/config-properties=BatchSize:add(value="4096" )

/subsystem=resource-adapters/resource-adapter=google:activate


Steps to Reproduce:
*******************
As indicated in the above section

Actual results:
***************
{
    "outcome" => "failed",
    "failure-description" => "JBAS014802: Cannot resolve expression 'expression
\"${jndi.name}\"' -- java.lang.IllegalStateException: Failed to resolve expressi
on: ${jndi.name}",
    "rolled-back" => true


Expected results:
*******************
<resource-adapter id="google">
            <module slot="main" id="org.jboss.teiid.resource-adapter.google"/>
            <transaction-support>NoTransaction</transaction-support>
            <connection-definitions>
                <connection-definition class-name="org.teiid.resource.adapter.google.SpreadsheetManagedConnectionFactory" jndi-name="java:/google" enabled="true" use-java-context="true" pool-name="google">
                    <config-property name="AuthMethod">
                        ClientLogin
                    </config-property>
                    <config-property name="SpreadsheetName">
                        ChangeMe
                    </config-property>
                    <config-property name="Username">
                        ChangeMe
                    </config-property>
                    <config-property name="Password">
                        ChangeMe
                    </config-property>
                    <config-property name="BatchSize">
                        4096
                    </config-property>
                </connection-definition>
            </connection-definitions>
        </resource-adapter>


Additional info:

Comment 2 Van Halbert 2014-05-02 13:42:47 UTC
The problem is the property substitution isn't being performed.  To enable this, you need to edit the jboss-cli.xml, in the bin directory, and change the following property to "true":

<resolve-parameter-values>false</resolve-parameter-values>

By default, this is false, and must be enabled when trying to use the --properties option for property substitution when running CLI scripts.


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