首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

把轻量级j2ee工程,从jboss移栽到websphere须注意事项

2012-11-12 
把轻量级j2ee工程,从jboss移植到websphere须注意事项1、websphere数据源获取方式:在web.xml加入数据源的引

把轻量级j2ee工程,从jboss移植到websphere须注意事项
1、websphere数据源获取方式:
在web.xml加入数据源的引用,如(OracleDS数据源):
          <resource-ref id="OracleDS_ResourceRef">
<res-ref-name>OracleDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>

配置hibernate的数据源属性(一定得以java:comp/env方式引用数据源):
<bean id="dataSource"    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource"/>
</property>     
<property name="configLocation">
<value>
classpath:com/hc360/mmt/db/cfg/topicdb.cfg.xml
</value>
</property>
   </bean>

2、如果在运行中出现错误,一般情况下都是因为jar包的原因,要不少包,要不包的版本不对。我在实际应用中,发现使用Hibernate的createQuery老是通不过,发现原来是少了antlr.jar包。

热点排行