王朝网络
分享
 
 
 

如何在JBoss+MySQL环境下运行obe

王朝mysql·作者佚名  2008-05-31
宽屏版  字体: |||超大  

**************************************************

*** 在JBoss+mysql环境下运行obe ***

**************************************************

我按照obe文档的说明试着在JBoss+MySQL环境下运行obe程序,在部署obe程序后启动JBoss,总是一堆的异常信息;我曾试过好几个版本的JBoss(3.2.3/3.2.5/4.0.0)都没有成功,从cvs下载最新的源码后认真阅读了obe的文档,最后选择了JBoss 4.0.1,并对ConfigurationProperties文件中使用的JBoss数据源配置进行了修改,当然我们也需要在JBoss中配置对应的数据源信息。

##################################################

### obe文档中几个要害的说明部分

##################################################

1、关于运行obe的应用服务器(这是我们选择应用服务器的依据)

-----------------------------------------------------------------------------------------

Application Servers

The OBE build system is highly configurable and can easily be adapted to run on any J2EE

application server that is supported by XDoclet.The OBE server runtime is known to work

with the following application servers:

JBoss 3.2.3+

JBoss 4.0.1+ (but not JBoss 4.0)

WebLogic 7.x

WebLogic 8.x

Note that of these, only JBoss 4.0.1 supports Servlet 1.3 as required by the OBE Web-based

Worklist Handler client

------------------------------------------------------------------------------------------

2、运行obe的应用服务器的资源配置(这段内容说明了运行obe所需要的数据源、JMS队列以及JAAS)

------------------------------------------------------------------------------------------

Configure the application server, to ensure that the resources required by OBE will be available.

The resources required include:

One DataSource, JNDI name (default 'MySQLDS') to match

Two JMS Queues, JNDI names 'OBEAsyncRequest' and 'OBEApplicationEvent'.

One JAAS Configuration, default name 'other'

------------------------------------------------------------------------------------------

3、关于运行obe的JBoss服务器的配置(这段内容说明了如何配置Jboss应用服务器)

------------------------------------------------------------------------------------------

OBE provides some preconfigured resources for use with JBoss, under ${staging.dir}/j2ee/jboss.

The conf and deploy Directories can be copied to the ${as.dir}/server/default directory - you

will need to rename / edit the *-ds.XML data source definition file in the conf directory to

suit your database type and connection properties.The 'default' server configuration should

be adequate for most purposes.Do not use the 'minimal' server configuration - it does not provide

all the J2EE container functionality required by OBE.

Note that OBE provides a modified version of the Castor XML library that fixes certain critical bugs,

so it is necessary either to delete the one that comes with JBoss in ${jboss.home}/server/default/deploy/snmp-adaptor.sar,

or to replace it with the OBE version (castor-0.9.5.3.jar) if you wish to use the JBoss SNMP adaptor.

This incompatibility is the result of the JBoss UnifiedClassLoader3 merging the classpaths of the

various J2EE applications.

------------------------------------------------------------------------------------------

##################################################

### 运行环境说明

##################################################

1、操作系统:Windows2000 pro

2、JBoss(4.0.1):(http://sourceforge.net/project/showfiles.PHPgroup_id=22866&package_id=16942&release_id=305380)

3、MySQL(4.14):(http://www.mysql.com)

4、JDBC驱动程序:我使用的是mysql-connector-Java-3.1.7-bin.jar,最新的驱动程序可以在(http://dev.mysql.com/downloads/connector/j)下载

##################################################

### 从cvs上下载的obe源程序

##################################################

1、cvs工具可以使用wincvs/TortoiseCVS

2、下载方法(转贴)

--------------------------------------------------

界面方式:

认证方式:pserver

路径:/cvsroot/obe

主机地址:cvs.sourceforge.net

用户名:anonymous

登陆,密码为空,检出模块为 .(注重:一个点,表示下载当前目录下的所有东西)

命令方式:

$cvs -d:pserver:anonymous@cvs.sf.net:/cvsroot/obe login

$cvs -d:pserver:anonymous@cvs.sf.net:/cvsroot/obe checkout .

--------------------------------------------------

##################################################

### 在MySQL中创建运行obe需要的数据库、用户名和密码

##################################################

mysqlcreate database obe;

mysqlgrant all on *.* to obe@localhost identified by 'obe' with grant option;

##################################################

### 在JBoss中创建运行obe需要的数据源

##################################################

obe文档中指导我们在Jboss中配置的数据源名称为MySQLDS,我试着在Jboss中配置这个数据源,但是配置后运行obe出现了其他的问题,所以我就参照Jboss的相关文档把obe使用MySQL的数据源配置为DefaultDS,同时修改Jboss的相关配置让这个数据源可以正常使用。下面就如何在Jboss中配置obe使用的DefaultDS数据源作具体说明。(注:在Jboss中,默认的DefaultDS数据源是hsql使用的)

1、首先把我们要使用的JDBC驱动程序拷贝到$JBOSS_HOME/server/default/lib目录下;

2、然后拷贝$JBOSS_HOME/docs/examples/jca/mysql-ds.xml到$JBOSS_HOME/server/default/deploy目录下;

3、用文本编辑器打开mysql-ds.xml文件,搜索找到配置项[<jndi-nameMySqlDS</jndi-name],修改该配置

项为[<jndi-nameDefaultDS</jndi-name],同时修改配置项[connection-url]、[driver-class]、[user-name]、

[passWord]以符合我们自己的环境。下面是我修改完成后的mysql-ds.xml配置文件内容:

------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?

<!-- $Id: mysql-ds.xml,v 1.3.2.1 2004/12/01 11:46:00 schrouf EXP $ --

<!--Datasource config for MySQL using 3.0.9 available from:

http://www.mysql.com/downloads/api-jdbc-stable.Html

--

<datasources

<local-tx-datasource

<jndi-nameDefaultDS</jndi-name

<connection-urljdbc:mysql://localhost:3306/obe</connection-url

<driver-classcom.mysql.jdbc.Driver</driver-class

<user-nameobe</user-name

<passwordobe</password

<exception-sorter-class-nameorg.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name

<!-- sql to call when connection is created

<new-connection-sqlsome arbitrary sql</new-connection-sql

--

<!-- sql to call on an existing pooled connection when it is oBTained from pool

<check-valid-connection-sqlsome arbitrary sql</check-valid-connection-sql

--

<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) --

<metadata

<type-mappingmySQL</type-mapping

</metadata

</local-tx-datasource

</datasources

------------------------------------------------------------------------------------------

4、由于$JBOSS_HOME/server/default/deploy目录下的hsqldb-ds.xml文件配置的数据源也为DefaultDS,所以必须把这个文件删除掉

5、接下来配置Jboss的消息队列以可以使用我们配置的DefaultDS(for MySQL)数据源。

A、拷贝$JBOSS_HOME/docs/examples/jms/mysql-jdbc2-service.xml到$JBOSS_HOME/server/default/deploy/jms目录下;

B、同样为了避免和hsqldb的冲突,需要把$JBOSS_HOME/server/default/deploy/jms目录下的hsqldb-jdbc2-service.xml删除掉;

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
>>返回首页<<
推荐阅读
 
 
频道精选
 
静静地坐在废墟上,四周的荒凉一望无际,忽然觉得,凄凉也很美
© 2005- 王朝网络 版权所有