Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.98 KB  |  hits: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. jboss and sonic mq not playing nice
  2. Context ic = new InitialContext(jndiEnv);
  3.        
  4. javax.naming.NamingException.  Root exception is com.sonicsw.mf.comm.ConnectTimeoutException: Timeout occured while attempting to connect
  5.        
  6. private Properties getConnectionEnv(String initialContextFactory,String providerURL, String domain, String userName, String password) {
  7.   Properties connectionEnv = new Properties();
  8.   if (initialContextFactory != null && initialContextFactory.length() != 0) {
  9.     connectionEnv.put(Context.INITIAL_CONTEXT_FACTORY,initialContextFactory);
  10.   }
  11.   if (providerURL != null && providerURL.length() != 0)
  12.     connectionEnv.put(Context.PROVIDER_URL, providerURL);
  13.   if (domain != null && domain.length() != 0)
  14.     connectionEnv.put("com.sonicsw.jndi.mfcontext.domain", domain);
  15.   if (userName != null && userName.length() != 0) {
  16.     connectionEnv.put(Context.SECURITY_PRINCIPAL, userName);
  17.     connectionEnv.put(Context.SECURITY_CREDENTIALS, password);
  18.   }
  19.   return connectionEnv;
  20. }