posts - 8,  comments - 11,  trackbacks - 0
  2007年12月18日
2月10日,大年初三,jboss5又发布了beta4,不知什么时候才有release啊
posted @ 2008-02-14 18:29 Archer 阅读(810) | 评论 (3)编辑 收藏
又一个新版本的netbeans发布了,希望这次在JBoss, Websphere上支持多一些
posted @ 2008-02-01 12:23 Archer 阅读(2145) | 评论 (6)编辑 收藏
Jboss5 Beta2已经大半年了,正式版还没见影。
posted @ 2007-12-19 17:07 Archer 阅读(447) | 评论 (0)编辑 收藏
GlassFish V2 是一个比较完整的ejb3服务器,性能也有了很大的提高,因此最近试用了一下,并通过Tomcat进行了分布式调用。
Session Bean: com.test.session.TestSessionBean, TestSessionRemote
web项目: test_web

要作以下处理:
1 Tomcat的test_web/WEB-INF/lib加载GlassFish的Client包,可以通过https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html查看官方的说明,我的类包中含有:
C:\\Java\\glassfish-v2\\lib\\appserv-ws.jar;C:\\Java\\glassfish-v2\\lib\\install\\applications\\jmsra\\imqjmsra.jar;C:\\Java\\glassfish-v2\\lib\\install\\applications\\jmsra\\imqjmx.jar;C:\\Java\\glassfish-v2\\lib\\javaee.jar;C:\\Java\\glassfish-v2\\lib\\appserv-ee.jar;C:\\Java\\glassfish-v2\\lib\\appserv-ext.jar;C:\\Java\\glassfish-v2\\lib\\appserv-deployment-client.jar;C:\\Java\\glassfish-v2\\lib\\jmxremote_optional.jar;C:\\Java\\glassfish-v2\\lib\\appserv-rt_ja.jar
2 如果没在classpath中设置ant,则还要在%Tomcat%/lib下加入ant.jar,ant-launcher.jar.
3 Context的设置

Properties props = new Properties();
        props.setProperty("java.naming.factory.initial",
                                 "com.sun.enterprise.naming.SerialInitContextFactory");
        props.setProperty("java.naming.factory.url.pkgs",
                                 "com.sun.enterprise.naming");
        props.setProperty("java.naming.factory.state",
                                 "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");

        // optional.  Defaults to localhost.  Only needed if web server is running
        // on a different host than the appserver   
        props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");

        // optional.  Defaults to 3700.  Only needed if target orb port is not 3700.
        props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");

        InitialContext ic = new InitialContext(props);

4 在lookup时,要用Bean的完整类名:com.test.TestSessionRemote
5 日志输出
   java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE, "exception caught", ne);


OK。Tomcat与GlassFish的EJB3就可以合作了。
posted @ 2007-12-18 19:00 Archer 阅读(1301) | 评论 (0)编辑 收藏