以文本方式查看主题 - W3CHINA.ORG讨论区 - 语义网·描述逻辑·本体·RDF·OWL (http://bbs.xml.org.cn/index.asp) -- 『 Java/Eclipse 』 (http://bbs.xml.org.cn/list.asp?boardid=41) ---- (转贴)JBoss3学习笔记 (http://bbs.xml.org.cn/dispbbs.asp?boardid=41&rootid=&id=11100) |
-- 作者:mfc42d -- 发布时间:10/18/2004 2:35:00 PM -- (转贴)JBoss3学习笔记 作者: Thatway (mailto:outhatway (at) hotmail (dot) com) 来自: http://www.hibernate.org.cn 修订记录: 2003.9.30 JBoss MQ 报错。主要原因为前版本把 DefaultDS 数据源去掉了。 目 录 一. 运行环境 -------------------------------------------------------------------------------- 一. 运行环境 应用服务器:Jboss3.x 数据库:MySQL4.x 虚拟机: SUN JDK1.4.x 二. 准备工作 2.请下载Jboss3.x。主站地址 http://www.jboss.org/ 。 3.请下载并安装MySQL4.x。主站地址 http://www.mysql.org/ 。 4. 请下载xpetstore3.x。主页地址 http://xpetstore.sourceforge.net/ 。 三. 安装 2. 设置JBOSS_HOME变量。进行命令窗口,运行bin目录下的run.bat命令。请注意后台有没有抛出异常。 3. 约半分钟后启动完毕,请访问 http://localhost:8080/jmx-console/ 。如果成功显示页面,说明安装成功。 4. 进行命令窗口,运行bin目录下的 shutdown.bat -S 命令可以停止JBOSS。 四. 配置实例xPetStore 2. 配置JMS This xml file should look like this: <?xml version="1.0" encoding="UTF-8"?> <!-- $Id: jbossmq-destinations-xpetstore-service.xml,v 1.0 2003-8-11 15:47 et Exp $ --> <server> <mbean code="org.jboss.mq.server.jmx.Queue" </server> 3. 配置JDBC Create JBOSS_HOME/server/xpetstore/deploy/mysql-ds.xml. (Do NOT change the hsqldb-ds.xml, keep it.) Edit mysql-ds.xml to create the datasource java:/xpetstoreDS。 JBOSS_HOME/server/xpetstore/deploy/mysql-ds.xml should look like this: <?xml version="1.0" encoding="UTF-8"?> <!-- $Id: mysql-ds.xml,v 1.0 2003-8-11 15:56 et Exp $ --> 4. 配置JavaMail Make sure that JBOSS_HOME/server/xpetstore/deploy/mail-service.xml look like this: <server> <mbean code="org.jboss.mail.MailService" 5. 启动JBOSS 6. 指定xPetStore的应用服务器 Edit the file XPETSTORE_HOME/conf/as/appserver.properties and set the property app.server=jboss. You may want to review XPETSTORE_HOME/conf/as/jboss.properties to make sure that all the properties are properly set. 7. 指定数据库 Edit the file XPETSTORE_HOME/conf/db/mysql.properties to configure the database.You must set the following properties: db.driver PS: Don't change the hibernate properties. 8. Build源代码 build.bat This command will : Generate Java code in XPETSTORE_HOME/xpetstore-servlet/build/java Generate the deployment descriptors at XPETSTORE_HOME/xpetstore- servlet/build/META-INF and XPETSTORE_HOME/xpetstore- servlet/build/WEB-INF Compile the source code and build .jar, .war and .ear files at XPETSTORE_HOME/dist 经测试,事实上这样build是不足够的,在发布运行的过程中会出错。但考虑到官方文件是这样说的,并且这些的确是正确的主要步骤。之所以不能运行,完全是“意外”问题。因此,我们暂且跳过,到运行时再把步骤补全。 9. 发布应用 10. 初始化数据库 11. 运行应用 12. 意外错误排除 再发布时会抛出错误:Exception processing TLD at resource path /META-INF/taglib.tld。此时,可以手工将XPETSTORE_HOME\lib\main\com.opensymphony.module.webwork\webword.jar\META-INF中的taglib.tld 拷贝到XPETSTORE_HOME\xpetstore-servlet\web\META-INF目录下。(META-INF是手工建立的)。再编辑XPETSTORE_HOME\xpetstore-servlet\build.xml,在“WAR”栏加入以下语句把taglib.tld拷贝进war中。再运行build。 <!-- Added by thatway 2003-8-5 13:40--> 发布时还会提出错误,主要原因是Hibernate getConnection时不能通过JBOSS的安全验证。此时,要修改JBOSS_HOME/server/xpetstore/conf/login_config.xml和JBOSS_HOME/server/xpetstore/deploy/mydql_ds.xml。 先说login_config.xml。参照HsqlDbRealm段,添加如下代码。 <application-policy name = "MysqlDbRealm"> 再到mysql_ds.xml。修改security-domain值。 <security-domain>MysqlDbRealm</security-domain> 五. 结束语 此番配置有两个目的,一是熟悉JBOSS,二是便于学习xpetstore源代码。第一个目标我们是达到了,但第二个目标现在才开始,所以让我们一起共勉,继续努力。 Last update 03 3月 04, 15:51, up to 9523 views.
[此贴子已经被作者于2004-10-19 20:19:35编辑过]
|
-- 作者:xmzhy -- 发布时间:3/10/2005 11:28:00 AM -- ding |
W 3 C h i n a ( since 2003 ) 旗 下 站 点 苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》 |
2,191.406ms |