简体   繁体   English

JBoss EAP 6.1连接到WebSphere 7 EJB

[英]JBoss EAP 6.1 connecting to WebSphere 7 EJB

Has anyone ever actually successfully done this? 有人真的成功做到了吗? I've seen different suggestions on different sites. 我在不同的网站上看到了不同的建议。 I've tried using the WebSphere client, but that breaks everything else inside my JBoss application that needs to use JNDI lookups. 我尝试使用WebSphere客户端,但是这破坏了我的JBoss应用程序中需要使用JNDI查找的所有其他内容。

I've tried using Jacorb but it gets non-descriptive errors returned, I've tried searching those errors with no luck. 我试过使用Jacorb,但返回的是非描述性错误,我试过搜索这些错误而没有运气。

I've tried using the Sun context factory but I get class cast exceptions. 我曾尝试使用Sun上下文工厂,但遇到类强制转换异常。

Nothing I have tried works. 我没有尝试过任何工作。 Has anyone gotten this to work? 有没有人得到这个工作? I was able to get it to work in a standalone app using several different methods. 我能够使用几种不同的方法使其在独立应用程序中工作。

It should be possible using the AluniteClassLoader : 应该可以使用AluniteClassLoader

ClassLoader previous = Thread.currentThread().getContextClassLoader();            
try {
  ClassLoader cl = new AluniteClassLoader(new URL[]{new URL("file://path/to/websphere/client.jar")}, previous);
  Thread.currentThread().setContextClassLoader(cl);

  //Service lookup & method invocation
} finally {
  Thread.currentThread().setContextClassLoader(previous);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM