Bug 1019241

Summary: Fix JNDI input validation.
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Petr Kremensky <pkremens>
Component: InstallerAssignee: Miles Tjandrawidjaja <mtjandra>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kremensky <pkremens>
Severity: high Docs Contact: Russell Dickenson <rdickens>
Priority: unspecified    
Version: 6.2.0CC: mtjandra, thauser
Target Milestone: CR3   
Target Release: EAP 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-15 16:23:01 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:

Description Petr Kremensky 2013-10-15 11:09:28 UTC
Description of problem:
 Currently the JNDI input fields must start with java:/ or java:jboss/ , but there is no validation for empty jndi names (eg. "java:/"). Creating datasource with such a name ends with IllegalArgumentException once we try to enable it.

Version-Release number of selected component (if applicable):
 EAP 6.2.0.ER5

How reproducible:
 always

Steps to Reproduce:
 1. Start gui installer, use default values until you get into Post-Install Configuration screen.
 2. Select to Install JDBC driver and Datasource
 3. On Datasource setup screen enter "java:jboss/" as JNDI Name
 4. Finish the installation

Actual results:
 No error dialog, installation will end successfully.

Expected results:
 Error dialog on Datasource screen.

Additional info:
 - There is another JNDI input field on Infinispan Configuration screen, fix also this please.
 - I'll create another BZ for domain management component, but we should cover this also on installer's side.
 - java.lang.IllegalArgumentException: Empty name segment is not allowed for jboss

Comment 1 Miles Tjandrawidjaja 2013-10-15 14:49:44 UTC
Validation has been added for JNDI input field for Datasource page and Infinispan Configuration screen.

http://git.app.eng.bos.redhat.com/jbossas-installer.git/commit/?h=eap-6.2

Comment 3 Petr Kremensky 2013-10-18 09:36:05 UTC
CLI actually trims the string so it ends like "java:/".

Comment 4 Miles Tjandrawidjaja 2013-11-18 19:41:23 UTC
"java:/ " and "java:/" both considered invalid.
CLI should not logner trim JNDI name.
This allows from something like "java:/ space "

According to http://docs.oracle.com/javase/jndi/tutorial/beyond/misc/policy.html the JNDI does not define any naming policy of its own.

http://git.app.eng.bos.redhat.com/jbossas-installer.git/commit/?h=eap-6.2&id=297bcd46da8123eae6344c27b6fd8d970536de4f

Comment 5 Petr Kremensky 2013-11-19 12:03:58 UTC
JNDI validation now works fine, but you accidentally removed it from Infinispan configuration panel, so it is working only for Datasource setup.

Comment 6 Miles Tjandrawidjaja 2013-11-19 16:35:31 UTC
Yes your right.
Added validation back in, also made sure spaces are retained.

http://git.app.eng.bos.redhat.com/jbossas-installer.git/commit/?h=eap-6.2

Comment 7 Petr Kremensky 2013-11-22 09:16:11 UTC
Verified on EAP 6.2.0.CR3 installer. JNDI validation is now working on all panels.