This closes #2783
This commit is contained in:
commit
e218678e4f
|
@ -56,7 +56,7 @@ public class ActiveMQInitialContextFactory implements InitialContextFactory {
|
|||
Map<String, Object> data = new ConcurrentHashMap<>();
|
||||
|
||||
String providerUrl = (String) environment.get(javax.naming.Context.PROVIDER_URL);
|
||||
if (providerUrl != null) {
|
||||
if (providerUrl != null && !providerUrl.isEmpty()) {
|
||||
try {
|
||||
JMSFactoryType providedFactoryType = getFactoryType(providerUrl);
|
||||
if (providedFactoryType == null) {
|
||||
|
|
|
@ -103,6 +103,18 @@ public class SimpleJNDIClientTest extends ActiveMQTestBase {
|
|||
connectionFactory.createConnection().close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyConnectionFactoryString() throws NamingException, JMSException {
|
||||
Hashtable<String, String> props = new Hashtable<>();
|
||||
props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
|
||||
props.put("connectionFactory.ConnectionFactory", "vm://0");
|
||||
|
||||
//IIB v10 assumes this property is mandatory and sets it to an empty string when not specified
|
||||
props.put("java.naming.provider.url", "");
|
||||
new InitialContext(props);//Must not throw an exception
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVMCF1() throws NamingException, JMSException {
|
||||
Hashtable<String, String> props = new Hashtable<>();
|
||||
|
|
Loading…
Reference in New Issue