运行seam中的例子所遇到的问题

            近一年都要和seam打交道了,所以环境肯定要搭建的,显示下载seam框架,再是装jboss服务器,又下ant,按照reference的帮助文档来讲,这些再加上配置好的jdk环境的话就可以跑出seam中自带n多个例子的。启动jboss,ant seam-examples, 运行localhost,可是就是404啊,说明项目没有部署到jboss server中,随即打开server/deploy,的确没有xxx.ear,但明明提示的是build successf的,查看了下ant日志原来是没有copy到服务器中去,说白了工程的部署不就是把ear包copy到jboss服务器的deploy中,可就是完不成到服务器的部署,经过好长时间的排查,最终确定是路径的问题,设置build.properties中的jboss.home 时C:\\jboss-4.2.3.GA的路径斜杠在windows中必须是两个,否则就找不到服务器。

            整个过程中所需要的软件如下:

                                        ant1.8.2

                                        jdk5.0以上版本

                                        jboss as 4.2

                                        jboss seam 2.2.0

1:先配置jboss seam根目录下build.properties ,在最末一行添加一行:jboss.home  c:\\jboss根目录

2:启动jboss

3:部署booking这个例子,首先用cmd进入\booking 这个路径下面,直接ant deploy 结束后console会有提示,然后去jboss的\server\default\deploy 目录下面看看是否已经部署成功,如果部署成功,会有jboss-seam-booking.ear,jboss-seam-booking-ds.xml 这2个文件生成

4:修改jboss-seam-booking-ds.xml

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

<!DOCTYPE datasources
PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
"http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">

<datasources>
<local-tx-datasource>
<jndi-name>bookingDatasource</jndi-name>
<connection-url>jdbc:hsqldb:yourdb</connection-url>
<driver-class>org.hsqldb.jdbcDriver</driver-class>
<user-name>sa</user-name>
<password></password>
</local-tx-datasource>
</datasources>

修改完后你可以去你的hsqldb下面去找生成的数据,jboss自己带一个tool 可以查看数据,这个tool是个awt程序,在jboss console 里面——》

jboss

database=localDB,service=Hypersonic——》

void startDatabaseManager()

MBean Operation.

点击invoke就可以启动这个tool, file ——》connect ——>URL 更改为jdbc:hsqldb:yourdb 就可以查看到delopoy后自动建的表,以及初始化数据!

运行http://localhost:8080/seam-booking/就可以跑这个example了

最后总结一下,如果把seam所有的example搞清楚,你就基本搞清楚seam 的几乎所有内容,因为example牵扯了几乎所有seam的feature:

这是seam example 里面的内容

blog/ The Seam blog example, showing how to write
RESTful applications using Seam

booking/ The Seam Booking demo application for EJB 3.0

contactlist/ The Seam Contact List demo demonstrating use
of the Seam application framework

drools/ A version of the number guessing example that
uses Drools with jBPM

dvdstore/ The Seam DVD Store demo demonstrating jBPM
support in Seam

groovybooking/ The Seam Booking demo ported to Groovy

hibernate/ The Seam Booking demo ported to Hibernate3

icefaces/ The Seam Booking demo with ICEfaces, instead of
Ajax4JSF

itext/ A demo of the Seam iText integration for generating pdfs

jee5/booking The Seam Booking demo ported to the Java EE 5
platforms

jee5/remoting The Seam remoting helloworld demo ported to the Java EE 5
platforms

jpa/ An example of the use of JPA (provided by Hibernate), runs
on many platforms, including non-EE 5 platforms (including
plain Tomcat)

mail/ The Seam mail example demonstrating use of
facelets-based email templating

messages/ The Seam message list example demonstrating use
of the @DataModel annotation

nestedbooking/ The booking example modified to show the use of nested
conversations

numberguess/ The Seam number guessing example, demonstrating
jBPM pageflow

quartz/ A port of the Seampay example to use the Quartz dispatcher

registration/ A trivial example for the tutorial

remoting/chatroom/ The Seam Chat Room example, demostrating Seam
Remoting

remoting/gwt/ An example of using GWT with Seam remoting

remoting/helloworld/ A trivial example using Ajax

remoting/progressbar/ An example of an Ajax progress bar

seambay/ An example of using Seam with Web Services

seamdiscs/ Demonstrates Seam, Trinidad, Ajax4jsf and Richfaces

seampay/ The Seam Payments demo demonstrating the use of
asynchronous methods

seamspace/ The Seam Spaces demo demonstrating Seam
Security

spring/ Demonstrates Spring framework integration

todo/ The Seam todo list example demonstrating
jBPM business process management

ui/ Demonstrates some Seam JSF controls

wiki/ A fully featured wiki system based on Seam, please
read wiki/README.txt for installation instruction


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值