jboss 和 sonic mq 玩得不好

发布于 2024-12-26 18:24:21 字数 559 浏览 0 评论 0原文

这就是我一天以来一直在苦思冥想的事情。
我有一个旧版本的 jboss (jboss4),从它内部我启动了一些代码来连接到我作为客户端运行的 sonic mq (7.6,我认为) 的实现。我正在运行java 1.6.0_23。话虽这么说,我看到了非常奇怪的行为,我似乎无法弄清楚。

当我的进程启动时,我加载了建立与 sonic mq 服务器的连接所需的所有 jndi 道具,然后我像这样喊叫,

Context ic = new InitialContext(jndiEnv);

但是我在那时看到我的 wire shark 上没有流量,这让我感到困惑。最终这会超时,给我一个例外

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

真正的打击是我从同一服务器上的独立jar(而不是从jboss内)运行我的进程并且它连接正常?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

玻璃人 2025-01-02 18:24:21

嘿,任何遇到这个问题的人...所以我解决了我的问题,并认为我会分享它...

事实证明,即使 sonic 技术团队说他们的代码从不查看 jvm 变量 javax.ssl.keystore ..原来如此……

就这么设定了
javax.ssl.keystore=C: 东西
这将导致初始上下文生成挂起直到超时。
然而这个
javax.ssl.keystore=C:\某事
会起作用的。
如果它没有设置它也会工作......

我会期望抛出某种异常:?

我希望这可以帮助别人! :)

谢谢
J

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

白色秋天 2025-01-02 18:24:21

两件事:
您可以在 JBoss 服务器上的类路径中检查所需的 jar 吗?
您是否正在设置 Sonic MQ 的域名属性,该属性需要获取 sonic 目录服务的初始上下文对象引用?

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;
}

希望这对你有帮助

..GK

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文