Im having trouble replacing hashtable for hashmap because the method im using receives a hashtable:
private Context getInitialContext() throws NamingException {
final Hashtable<String, Object> jndiProperties = new Hashtable<>();
jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
// This "new InitialContext()" receives a Hastable, and I can't modify that
// because that is part of a jar
// "javax.naming.InitialContext.InitialContext(Hashtable<?, ?> environment)
// throws NamingException"
context = new InitialContext(jndiProperties);
return context;
}
Run Code Online (Sandbox Code Playgroud)
InitialContext method:
public InitialContext(Hashtable<?,?> environment)
throws NamingException
{
if (environment != null) {
environment = (Hashtable)environment.clone(); …Run Code Online (Sandbox Code Playgroud)