在WebSphere7应用服务器,由于对EJB JNDI命名查找方法的不同,需要修改components.xml文件中的配置内容,首先需要去掉jndi-pattern属性值中的“/local”字符串,例如原的配置内容为:
< core:init jndi-pattern="java:comp/env/3mis/#{ejbName}/local " debug="true"/>
|
现在需要修改为:
<core:init jndi-pattern="java:comp/env/3mis/#{ejbName}" debug="true"/>
|
这样,才能保证Seam2在WebSphere7中能够正确运行。还需要修改EJB的实体Bean管理器,修改后的内容如下:
<transaction:entity-transaction entity-manager="#{entityManager}"/>
<persistence:entity-manager-factory name="mis"/>
<persistence:managed-persistence-context name="entityManager" auto-create="true"
entity-manager-factory="#{mis}"/>
|
如果在ejb-jar.xml配置文件中配置了ejb-ref-name属性的值,同样需样去掉属性值中的“/local”字符串,例如:
<session>
<ejb-name>RoplanmgtAction</ejb-name>
<ejb-local-ref>
<ejb-ref-name>3mis/RepOrderServiceImpl/local</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>com.newidea.mis.apm.service.RepOrderService</local>
</ejb-local-ref>
</session>
|
现在需要修改为:
<session>
<ejb-name>RoplanmgtAction</ejb-name>
<ejb-local-ref>
<ejb-ref-name>3mis/RepOrderServiceImpl</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>com.newidea.mis.apm.service.RepOrderService</local>
</ejb-local-ref>
</session>
|
这样,才能保证Seam2在WebSphere7中能够正确运行。
在WebSphere7中,需要在Web.xml配置文件中对Seam的会话Bean(包括Action)要在声明式配置,这样以便于Seam在运行期间能够找到用注解声明的EJB,这也是Seam在WebSphere7中配置变化最大的一块,也是配置极为不便的配置内容,因为又配置大量的配置内容,在JBOSS中则不需要在Web.xml配置文件中配置EJB类。同样需样去掉ejb-local-refs属性值中的“/local”字符串,例如:
<ejb-local-ref>
<ejb-ref-name>3mis/RoplanmgtAction/local</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>com.newidea.mis.apm.action.Roplanmgt</local>
</ejb-local-ref>
|
现在需要修改为:
<ejb-local-ref>
<ejb-ref-name>3mis/RoplanmgtAction </ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>com.newidea.mis.apm.action.Roplanmgt</local>
</ejb-local-ref>
|
这样,才能保证Seam2在WebSphere7中能够正确运行。
在WebSphere7中运行Seam2中的事务是能过JPA来管理,所以需要对持久化配置文件作一些修改,首在需要在persistence.xml中添加或修改如下内容:
<persistence-unit name="mis" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<!--<provider> org.apache.openjpa.persistence.PersistenceProviderImpl </provider>-->
<!--<jta-data-source>java:/misDatasource</jta-data-source>-->
<jta-data-source>misDatasource</jta-data-source>
<properties>
<property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.transaction.flush_before_completion" value="true"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9iDialect"/>
<!-- <property name="hibernate.hbm2ddl.auto" value="update"/> -->
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="false"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>
</properties>
</persistence-unit>
|
2. 在WebSphere7中运行Seam2所需的类库
需要下载最新的Seam2.2版本的才能在WebSphere7中正常运行,下面分别介绍所需要的基本类库。但这些类库在JBOSS中运行则不需要添加。
管理JPA所需要的Hibernate类库如下:
hibernate.jar
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-entitymanager.jar
hibernate-validator.jar
commons-collections.jar
jboss-common-core.jar
当然,还需要其他第三方类库,所需要最基本的类库列表如下:
antlr-runtime.jar
drools-compiler.jar
drools-core.jar
jboss-el.jar
jboss-seam.jar
jboss-seam-ui.jar
jboss-seam-pdf.jar
jboss-seam-ioc.jar
jboss-seam-mail.jar
jbpm-jpdl.jar
mvel14.jar
richfaces-api.jar
richfaces-ui.jar
richfaces-impl.jar jsf-facelets.jar
jxl.jar commons-collections.jar jboss-common-core.jar slf4j-log4j12.jar slf4j-api.jar log4j.jar drools-api.jar drools-decisiontables.jar
quartz.jar jasperreports-2.0.5.jar commons-digester.jar javassist.jar dom4j.jar hibernate-core.jar hibernate-annotations.jar hibernate-commons-annotations.jar
hibernate-entitymanager.jar hibernate-validator.jar commons-beanutils.jar concurrent.jar cglib.jar asm.jar antlr.jar
最后,还需要注意就是,不能在DAO模式中直接在继承EntityHome来进行实体Bean的操作,而是需要能过Action来封装对DAO的访问。这一点与在JBOSS中不同。
3. 在WebSphere7中部署Seam2应用程序
用开发工具Myeclipse打包Seam2应用程序后,现需要部署到WebSphere7中。
首先在浏览器地址栏中输入http://zhangf:9061/ibm/console,启动WebSphere7控制台,
输入管理员名和口令后, 进入控制台安装应用程序。
分享到:
相关推荐
在websphere7.0中配置mysql数据源,每一步的描述及截图,很具体的,自己整理的,操作成功了的
本文详细介绍了WebSphere的安装步骤和WebSphere在Myeclipse中的配置以及项目的部署。。。
IBM WebSphere Portal Express配置文档
websphere 6.1中配置DM7数据源
非本人原创,网上找的,但是调试不成功,偶调试成功后放上去
websphere 6.1安装配置指南websphere 6.1安装配置指南websphere 6.1安装配置指南websphere 6.1安装配置指南websphere 6.1安装配置指南websphere 6.1安装配置指南
linux下websphere的安装配置
WebSphere Application Server Network Deployment 6集群安装部署步骤.docxwebsphere6.1集群配置
Websphere-HTTPS配置.doc
4、在myEclipse6中配置websphere6及部署工程实践.doc 5、WAS ND安装手册.pdf 6、WAS+6[1].1安装手册installation+guide.pdf 7、websphere应用服务器(WAS)配置书籍.pdf 8、MyEclipse5.5GA配置Websphere V6.1.png
论WebSphere中流行数据库连接池的配置
详细的WebSphere数据源配置,一步步解析和分析。
详细描述了怎样在IBM WebSphere 6.1中配置IBM MQ,最后给出了通过JMS验证的方法和几个详细示例。
在websphere下,log4j打印的内容会被was接管,导致在tomcat下可以正常使用的log4j配置方法,在websphere下不打印任何日志到目标路径,本方法可以解决此问题并且是几乎所有开源jar包在websphere上碰上冲突时的标准...
论WebSphere中流行数据库连接池的配置.doc
Websphere部署与配置手册,websphere搭建
Websphere6.1 安装 配置 DataSource JDBC JNDI ORACLE
websphere安装配置图解详细教程 目 录 一、安装websphere软件 3 二、安装websphere补丁 15 三、配置websphere应用服务器 21 一、安装websphere软件 1、安装webshpere WAS6 的安装过程,使用缺省设置即可。需要注意...
Websphere内存线程配置 java
成功在WAS7_Linux群集安装过程记录文档。WebSphere Application Server