Bug 1019260

Summary: User shouldn't be able to use empty JNDI name ('java:/' or 'java:jboss/')
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Petr Kremensky <pkremens>
Component: JCAAssignee: tom.jenkinson
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kremensky <pkremens>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: dandread, kkhan, mnovak, msimka, sjadhav, tom.jenkinson
Target Milestone: DR8   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:30:03 UTC
Description of problem:
 Currently the only validation for JNDI names is: JNDI name has to start with 'java:/' or 'java:jboss/'. But user is able to enter just 'java:/' or 'java:jboss/' as JNDI name. Using this JNDI name for eg. data-source will lead to java.lang.IllegalArgumentException: Empty name segment is not allowed for jboss. Further more this data-source cannot be removed (expect deleting from XML directly).


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

How reproducible:
 Always

Steps to Reproduce:
 1. Start out-of-box EAP 
 2. Connect to EAP eg. via web console
 3. Add a new Datasource (use 'java:/' or 'java:jboss/' as JNDI name)
 4. Enable the datasource

Actual results:
13:26:02,708 ERROR [org.jboss.as.controller.management-operation] (HttpManagementService-threads - 2) JBAS014612: Operation ("enable") failed - address: ([
    ("subsystem" => "datasources"),
    ("data-source" => "test")
]): java.lang.IllegalArgumentException: Empty name segment is not allowed for java

Expected results:
 User is unable to use 'java:/' or 'java:jboss/' as JNDI name.

Comment 1 Jesper Pedersen 2014-09-02 14:02:53 UTC
Corner case, so not a priority

Comment 2 Jeff Zhang 2014-09-24 00:34:10 UTC
https://github.com/wildfly/wildfly/pull/6738
upstream PR sent.

Comment 3 Kabir Khan 2014-11-03 09:53:37 UTC
https://github.com/jbossas/jboss-eap/pull/1871

Comment 4 Petr Kremensky 2014-11-06 07:05:25 UTC
Verified on EAP 6.4.0.DR8