How can i deploy Session Bean on another computer with Client JSP/Servlet

喜你入骨 提交于 2019-11-28 08:47:43
  1. Create a "client jar" with the remote interfaces, deploy in on the client

  2. Provide the app server client jar (not necessary in your scenario)

  3. Provide a jndi.properties on the classpath with the following content (assuming GlassFish to GlassFish communication):

    java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory
    java.naming.factory.url.pkgs=com.sun.enterprise.naming
    java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl
    org.omg.CORBA.ORBInitialHost=<hostname>
    org.omg.CORBA.ORBInitialPort=3700
    
  4. Use the mappedName attribute of the @EJB annotation to specify the global JNDI name of the target Remote EJB component (If there is no jndi-name set in sun-ejb-jar.xml - or no sun-ejb-jar.xml at all - the global jndi-name defaults to the fully qualified Remote 3.0 Business interface class name) :

    @EJB(mappedName="com.acme.app.StatelessRemote")
    private StatelessRemote remote;
    

Resources

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!