0

Here's what i have been beating my head against for a day now.
I have an older version of jboss (jboss4), and from within it i am launching some code to go out and connect to an implementation of sonic mq (7.6, i think) where i am running as a client. I am running java 1.6.0_23. That being said i am seeing very weird behavior that i cant seem to figure out.

When my process starts i load all of the jndi props that i need to establish a connection to the sonic mq server, then i call out like this

Context ic = new InitialContext(jndiEnv);

however i see no traffic on my wire shark at that point and it is baffling me. Eventually this will time out giving me the exception

javax.naming.NamingException.  Root exception is com.sonicsw.mf.comm.ConnectTimeoutException: Timeout occured while attempting to connect

The real kick in the teeth is that i run my process from a standalone jar (instead of from within jboss) on the same server and it connects fine?

Sameera Thilakasiri
  • 9,452
  • 10
  • 51
  • 86
nemisis enforcer
  • 349
  • 3
  • 18

2 Answers2

4

Hey anyone that comes across this... So i solved my issue and thought i would share it ...

it turns out that even tho the sonic tech team said that their code never looks at the jvm variable javax.ssl.keystore ... it does...

It was set like this javax.ssl.keystore=C:something which would cause the initial context generation to hang until time out. however this javax.ssl.keystore=C:\something would work. and if its not set it will work as well...

i would have expect some kind of exception to be thrown :?

I hope this helps someone sometime! :)

thanks J

nemisis enforcer
  • 349
  • 3
  • 18
0

Two things:
Can you check required jars in the class path on the JBoss server?
Are you setting Domain name property of Sonic MQ which is needed to get initial context object ref of sonic directory service?

private Properties getConnectionEnv(String initialContextFactory,String providerURL, String domain, String userName, String password) {
  Properties connectionEnv = new Properties();
  if (initialContextFactory != null && initialContextFactory.length() != 0) {
    connectionEnv.put(Context.INITIAL_CONTEXT_FACTORY,initialContextFactory);
  }
  if (providerURL != null && providerURL.length() != 0)
    connectionEnv.put(Context.PROVIDER_URL, providerURL);
  if (domain != null && domain.length() != 0)
    connectionEnv.put("com.sonicsw.jndi.mfcontext.domain", domain); 
  if (userName != null && userName.length() != 0) {
    connectionEnv.put(Context.SECURITY_PRINCIPAL, userName);
    connectionEnv.put(Context.SECURITY_CREDENTIALS, password);
  }
  return connectionEnv;
}

Hope this helps to you..

GK

Eran Egozi
  • 775
  • 1
  • 7
  • 18
GKo
  • 1
  • GK - thanks for the reply, i am setting everything needed to connect, and this was working at one time but then stopped after a restart of the Jboss. – nemisis enforcer Jan 13 '12 at 18:45
  • The two things that i am looking into right now to solve this are how to up the client side logging for the Sonic libs, and looking into if it is possible for jboss not to be able to resolve the address or not have access to the port... – nemisis enforcer Jan 13 '12 at 19:02