简体   繁体   English

Tomcat 7访问glassfish 3上的EJB

[英]Tomcat 7 accessing EJB on glassfish 3

I've seen very many post, and i googled a lot but i'm not able to get out of this problem. 我看过很多帖子,而且谷歌搜索了很多,但我无法摆脱这个问题。

I have an EJB module deployed on a glassfish v 3.1.2, and i want to access it by a tomcat v 7. There seems to be no problem when the servers runs on the same host, but when they are on different hosts(namely different machines) raises very many problems. 我在glassfish v 3.1.2上部署了一个EJB模块,我希望通过tomcat v 7访问它。当服务器在同一主机上运行时,但是当它们在不同的主机上时,似乎没有问题(即不同的机器)引发了很多问题。 Even with two glassfish servers. 即使有两个glassfish服务器。

I followed http://technology.amis.nl/2006/10/20/connecting-to-an-ejb-30-remote-sessionbean-from-tomcat/ 我关注了http://technology.amis.nl/2006/10/20/connecting-to-an-ejb-30-remote-sessionbean-from-tomcat/

and a lot of other similar link that can be found also here in the stackexchange, that i will not report here because they all suggest the same thing, that is: 还有很多其他类似的链接也可以在stackexchange中找到,我不会在这里报告,因为它们都提出相同的建议,即:

put this lines of codes in your code, ie a servlet: 将这行代码放在代码中,即servlet:

Properties props = new Properties(); 属性props = new Properties(); props.put("java.naming.factory.initial","com.sun.enterprise.naming.SerialInitContextFactory"); props.put( “java.naming.factory.initial的”, “com.sun.enterprise.naming.SerialInitContextFactory”); props.put("java.naming.factory.url.pkgs","com.sun.enterprise.naming"); props.put( “java.naming.factory.url.pkgs”, “com.sun.enterprise.naming”); props.put("java.naming.factory.state","com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl"); props.put( “java.naming.factory.state”, “com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl”); props.setProperty("org.omg.CORBA.ORBInitialHost", "10.23.2.150"); props.setProperty(“org.omg.CORBA.ORBInitialHost”,“10.23.2.150”); props.setProperty("org.omg.CORBA.ORBInitialPort", "3700"); props.setProperty(“org.omg.CORBA.ORBInitialPort”,“3700”);

And also many of you suggest to include in the path the: 还有许多人建议在路径中包括:

  • gf-client of glassfish (do you evermind that on tomcat i may not be able to refer to the glassfish libraries) glassfish的gf-client(你有没有想过在tomcat上我可能无法引用glassfish库)
  • or all the libraries which refers to the gf-client (close to 10 mega of files) 或所有引用gf-client的库(接近10兆的文件)

but the does't work.. 但是没有用..

I still get the initialcontext directory not found problem.. 我仍然得到initialcontext目录未找到问题..

May you suggest me any solution? 你能建议我解决一下吗? may you suggest me any step by step "tutorial" to follow in order to make everything work out? 你可以建议我一步一步“教程”,以使一切顺利吗?

if you need any piece of the code or the complete error just answer me please, is almost 1 week i'm trying to resolve this problem.. 如果您需要任何一段代码或完整的错误请回答我,差不多1周我正试图解决这个问题..

thank you very much indeed 非常感谢你

TO JEFF: I found out solution and here is it: Hi i really suggest you to follow this Java for the web 杰夫:我找到了解决方案,就是这样:您真的建议您在网上关注这个Java

I maintain this blog together with a colleague of mine. 我和我的同事一起维护这个博客。 I think this should work also for tomcat 6. 我认为这也适用于tomcat 6。

I hope this will work! 我希望这会奏效! let us now how does it proceed. 现在让我们来看看它是如何进行的。

LG LG

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

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