您的位置:程序门 -> java -> j2se / 基础类



tomcat中可以运行ejb吗?应该怎样部署?


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


tomcat中可以运行ejb吗?应该怎样部署?[已结贴,结贴人:qq77504166]
发表于:2008-02-18 18:02:44 楼主
谢谢大家
发表于:2008-02-18 18:12:491楼 得分:0
可以运行ejb,但是怎么部署我倒不知道。
发表于:2008-02-18 22:27:242楼 得分:10
目前的版本不支持。以后的版本估计也不支持
tomcat是一个servlet和jsp的容器不是j2ee的容器
发表于:2008-02-19 08:33:183楼 得分:0
二楼正解
发表于:2008-02-19 09:01:384楼 得分:0
apache有个openejb项目,可以与tomcat进行集成。

具体方式参考:
发表于:2008-02-19 12:09:545楼 得分:0
当然可以,只是不能使用ejb的所有功能,下面是不可用的功能(应用官方文档原文):
·xa   connection   pool   is   not   available   yet.
·when   embedding   into   tomcat,   you   still   require   a   jboss   specific   jndi   implementation.   tomcat's
jndi   is   read-only.
·you   still   must   use   the   jboss   transaction   manager   even   when   embedding   in   another   app   server   vendor.
this   will   be   remedied   in   the   future   when   the   jboss   aop/microcontainer   integration   is   complete.
·distributed   remote   communication   is   not   supported   yet.
·ejb   timer   service   not   supported
·even   though   @remote   interfaces   are   local,   you   can   only   communicate   through   local   connections.
·you   cannot   access   jms   remotely.   only   locally.   thus,   you   have   to   lookup   the
"java:/connectionfactory".
·jndi   is   not   available   remotely

用现在的ejb3的话,如下就可以部署在tomcat中:
1.根据应用的需要,把调用ejb所依赖的jar   包拷贝到tomcat下的/shared/lib目录或web应用的
    web-inf/lib下,所依赖的jar   一般在jboss安装目录的client,/server/all/deploy/jboss-aop-jdk50.deployer,/server/all/deploy/ejb3.deployer,/lib/endorsed等文件夹下。
    下面的jar   文件是必需的:
    [jboss安装目录]\client\jbossall-client.jar
    [jboss安装目录]\server\all\deploy\jboss-aop-jdk50.deployer\jboss-aop-jdk50.jar
    [jboss安装目录]\server\all\deploy\jboss-aop-jdk50.deployer\jboss-aspect-library-jdk50.jar
    [jboss安装目录]\server\all\deploy\ejb3.deployer\jboss-ejb3.jar
    [jboss安装目录]\client\jboss-remoting.jar
2.把调用的ejb接口拷贝到应用的/web-inf/classes/目录下
要注意的是:在此环境下不能调用ejb的local   接口,因为他与jboss不在同一个vm中。


快速检索

最新资讯
热门点击