`
abelzcg
  • 浏览: 88306 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

JBoss Seam从头学到脚之2---创建工程

阅读更多

1:创建一个seam工程,工程类型选择如下图


 

 

2:点击“Next”按钮,进入下一步

 

 

3:在“Project Name”里输入,“helloworld

设置“Target Runtime”,点击“New”按钮

 

 

4:点击“Next”按钮

 

 

5:点击“Finish”按钮。

然后开始设置“Target Server”,同样点击“New”按钮

 

 

6:点击“Finish”按钮,结束设定。

最后“Configuration”中选择“Dynamic Web Project with Seam 2.1(technology preview)”。

最终的画面如下图所示

  

7:点击“Next

  

8:点击“Next

  

9:点击“Next

 
 

 

10:这里要配置“Seam Runtime”,点击“Add”按钮,并作如下选择

 

11:设置好后,点击“Finish”按钮。

Deploy as”,我们选择“EAR”。

接下来设置数据库,这里我是用的是mySQL

首先,在“Database Type”里选择“MySQL 5 (InnoDB)

然后,在“Connection profile”中,点击“New”按钮,来设置数据库的连接配置。

第一个画面如下选择:

 

12:点击“Next”按钮

 

 

 

13:点击新建的按钮后,出现下图,这里选择“5.1”。

 

14:然后点击“Jar List”,并正确选择mySQL的类库

 

15:然后点击“OK”按钮

 

16:把数据库名字,改成自己设置好的名字,这里我设置的是“studyseamdb”,如下图所示

 

 

17:如果没问题,点击“Test Connection”按钮,我们会得到下面的成功画面

  

18:没问题的话,点击“Finish”按钮,完成配置。

在下面的画面,继续点击“Finish”按钮来完成配置

 

 

19:大致的界面如下图所示

 

 

20:如果有java错误的话,把所有工程都重新编译一遍。

我这里最后还有一个错误没有清除掉,如下图 

 

21:启动jboss服务,如下图

 

 22:启动好后,如果一切正常,在浏览器地址栏中输入http://localhost:8080/helloworld,可以得到以下画面

 

 

END

 

  • 大小: 43.2 KB
  • 大小: 58 KB
  • 大小: 49.1 KB
  • 大小: 49.1 KB
  • 大小: 53.7 KB
  • 大小: 61.6 KB
  • 大小: 39.1 KB
  • 大小: 54.8 KB
  • 大小: 60.7 KB
  • 大小: 26.1 KB
  • 大小: 52.1 KB
  • 大小: 38.2 KB
  • 大小: 58.1 KB
  • 大小: 47.4 KB
  • 大小: 53.9 KB
  • 大小: 54.3 KB
  • 大小: 9.8 KB
  • 大小: 62.8 KB
  • 大小: 100.3 KB
  • 大小: 49.6 KB
  • 大小: 153.5 KB
  • 大小: 132 KB
10
0
分享到:
评论
4 楼 codor 2011-11-27  
部署时出现错误,SEAM版本为2.2,JBOSS为AS7
13:24:34,000 INFO  [org.jboss.as.deployment] (DeploymentScanner-threads - 2) Found helloworld-ear.ear in deployment directory. To trigger deployment create a file called helloworld-ear.ear.dodeploy
13:24:34,015 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Starting deployment of "helloworld-ds.xml"
13:24:34,015 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) Starting deployment of "helloworld-ear.ear"
13:24:34,125 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.unit."helloworld-ds.xml".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."helloworld-ds.xml".STRUCTURE: Failed to process phase STRUCTURE of deployment "helloworld-ds.xml"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_10-rc2]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_10-rc2]
at java.lang.Thread.run(Thread.java:619) [:1.6.0_10-rc2]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to mount deployment content
at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:82)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
... 5 more
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method) [:1.6.0_10-rc2]
at java.util.zip.ZipFile.<init>(ZipFile.java:114) [:1.6.0_10-rc2]
at java.util.jar.JarFile.<init>(JarFile.java:133) [:1.6.0_10-rc2]
at java.util.jar.JarFile.<init>(JarFile.java:97) [:1.6.0_10-rc2]
at org.jboss.vfs.spi.JavaZipFileSystem.<init>(JavaZipFileSystem.java:95)
at org.jboss.vfs.spi.JavaZipFileSystem.<init>(JavaZipFileSystem.java:81)
at org.jboss.vfs.VFS.mountZip(VFS.java:408)
at org.jboss.vfs.VFS.mountZip(VFS.java:434)
at org.jboss.as.server.deployment.repository.impl.ServerDeploymentRepositoryImpl.mountDeploymentContent(ServerDeploymentRepositoryImpl.java:75)
at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:78)
... 6 more

13:24:34,750 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "jboss-seam.jar"
13:24:34,750 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Starting deployment of "helloworld.war"
13:24:34,750 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) Starting deployment of "helloworld-ejb.jar"
13:24:35,453 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry iText-toolbox.jar in "/C:/Tools/jboss/standalone/deployments/helloworld-ear.ear/helloworld.war/WEB-INF/lib/itext.jar"  does not point to a valid jar for a Class-Path reference.
13:24:35,453 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry iText-toolbox-2.1.2.jar in "/C:/Tools/jboss/standalone/deployments/helloworld-ear.ear/helloworld.war/WEB-INF/lib/itext.jar"  does not point to a valid jar for a Class-Path reference.
13:24:35,453 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry bcmail-jdk14-138.jar in "/C:/Tools/jboss/standalone/deployments/helloworld-ear.ear/helloworld.war/WEB-INF/lib/itext.jar"  does not point to a valid jar for a Class-Path reference.
13:24:35,453 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry bcprov-jdk14-138.jar in "/C:/Tools/jboss/standalone/deployments/helloworld-ear.ear/helloworld.war/WEB-INF/lib/itext.jar"  does not point to a valid jar for a Class-Path reference.
13:24:35,453 INFO  [org.jboss.jpa] (MSC service thread 1-1) read persistence.xml for helloworld
13:24:35,453 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.subunit."helloworld-ear.ear"."helloworld.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."helloworld-ear.ear"."helloworld.war".PARSE: Failed to process phase PARSE of subdeployment "helloworld.war" of deployment "helloworld-ear.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_10-rc2]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_10-rc2]
at java.lang.Thread.run(Thread.java:619) [:1.6.0_10-rc2]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to parse "/C:/Tools/jboss/standalone/deployments/helloworld-ear.ear/helloworld.war/WEB-INF/jboss-web.xml" at [5,5]
at org.jboss.as.web.deployment.JBossWebParsingDeploymentProcessor.deploy(JBossWebParsingDeploymentProcessor.java:68)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
... 5 more

13:24:35,453 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 1) Deployment of "helloworld-ear.ear" was rolled back with no failure message
13:24:35,468 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 1) Deployment of "helloworld-ds.xml" was rolled back with failure message {"Failed services" => {"jboss.deployment.unit.\"helloworld-ds.xml\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"helloworld-ds.xml\".STRUCTURE: Failed to process phase STRUCTURE of deployment \"helloworld-ds.xml\""}}
13:24:35,468 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) Stopped deployment helloworld-ds.xml in 1ms
13:24:35,468 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) Stopped deployment helloworld-ejb.jar in 5ms
13:24:35,859 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) Stopped deployment jboss-seam.jar in 391ms
13:24:37,953 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Stopped deployment helloworld.war in 2493ms
13:24:38,703 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Stopped deployment helloworld-ear.ear in 3244ms
13:24:38,703 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 2) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Failed services" => {"jboss.deployment.unit.\"helloworld-ds.xml\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"helloworld-ds.xml\".STRUCTURE: Failed to process phase STRUCTURE of deployment \"helloworld-ds.xml\""}}}}
13:24:38,718 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 2) Composite operation was rolled back
3 楼 abelzcg 2009-08-24  
这段时间,有点忙,过段时间跟上,抱歉啦
2 楼 mosesgi 2009-08-24  
没遇到楼上的情况哎...
有时JDK版本不一致会导致ClassNotFoundException.
你的JBoss是什么版本的?JDK呢?

PS:累坏我了,还做了个测验先.
1 楼 uncletwo 2009-08-22  
为什么到了21步骤,右键jboss点击start老是弹出
could not find the main class. Program will  exit.
控制台报以下错误:
ClassNotFoundException:jboss\lib\endorsed 之类的错误

然后把jboss\lib\endorsed下面的所有jar设置进classpath,还是报同样的错误,为什么?
搞了好几个晚上,真的郁闷死
楼主可遇到这种情况,或知道如何解决吗?

相关推荐

    JBoss_Enterprise_Application_Platform-5.0.1-Seam_Reference_Guide-en-US.pdf

    JBoss_Enterprise_Application_Platform-5.0.1-Seam_Reference_Guide-en-US.pdf

    Jboss seam3 实战

    标题中的“Jboss seam3 实战”表明,本文将重点介绍JBoss Seam框架的第三个版本的实际应用。JBoss Seam是一个开源的Java EE框架,它通过依赖注入和会话模型,简化了基于Java EE的企业级应用开发。Seam框架为开发者...

    jbossseam eclipse安装 例子学习.doc

    - **下载文件**:jboss-seam-2.1.1.GA.zip 4. **JBoss Tools** - **下载地址**:[www.jboss.org/tools/download/index.html](http://www.jboss.org/tools/download/index.html) - **推荐版本**:3.0.0 CR1 - *...

    JBoss Seam工程的创建

    5. **配置文件**:Seam工程包含多个XML配置文件,如jboss-beans.xml、persistence-test.xml等,它们分别用于不同的测试和部署环境。其中,测试相关的配置(如import-test.sql)会在单元测试时导入HSQLDB数据库。开发...

    jboss-seam-selectitems

    java jboss seam jboss-seam-selectitems

    JBoss Seam

    总之,本书是JBoss Seam框架领域的一部经典之作,不仅提供了深入的技术解析,还包含了丰富的实战案例和最佳实践。对于希望深入了解并掌握JBoss Seam框架的开发者来说,这无疑是一本不可或缺的宝典。

    Beginning JSF2 APIs and JBoss Seam

    ### 关于《Beginning JSF2 APIs and JBoss Seam》的知识点总结 #### 一、书籍简介与背景 《Beginning JSF2 APIs and JBoss Seam》是一本深入介绍JavaServer Faces 2(简称JSF2)及其相关API以及JBoss Seam框架的...

    jboss seam 2.01GA REF DOC

    ### JBoss Seam 2.01GA REF DOC #### 引言:JBoss Seam概览与功能介绍 JBoss Seam 是一个为简化企业级 Java 应用开发而设计的框架。它结合了 JavaServer Faces (JSF)、Java Persistence API (JPA) 和 Java ...

    深入浅出JBoss Seam.pdf

    由于Seam的主要贡献者之一Gavin King同时也是Hibernate的创造者,因此Seam在设计之初就考虑到了如何更好地支持ORM,使得开发者可以轻松地处理延迟加载等场景。 **2. 改善JSF** Seam还提供了一套增强JSF的工具,...

    JBOSS SEAM组件中文手册

    3. **注入(Injection)**: Seam支持依赖注入,可以将一个组件的实例自动注入到其他组件中,无需手动创建对象或管理依赖关系。 4. **导航和流程控制(Navigation and Flow Control)**: Seam提供了强大的导航机制,...

    Jboss Seam中文版

    1. **在JBoss AS上运行示例**:首先需要安装配置JBoss AS服务器,然后导入Seam项目到服务器中进行部署。 2. **在Tomcat服务器上运行示例**:Tomcat作为轻量级的应用服务器,可以快速部署简单的Seam应用,便于学习和...

    jboss seam 教程

    ### JBoss Seam 教程知识点概述 #### 一、Seam简介与教程概览 - **Seam**:一个基于Java EE平台的应用框架,旨在简化企业级应用开发。 - **JBoss Seam**:由JBoss提供的Seam实现,提供了一系列功能强大的工具和...

    JBoss Seam入门介绍

    从创建组件、定义业务逻辑到整合前端界面,Seam提供了一套完整的工具链和API,帮助开发者快速搭建企业级应用。例如,通过声明式状态管理,可以轻松管理用户的会话状态;通过Bijection,可以自动处理组件间的依赖注入...

    jboss seam 中文文档集合

    **JBoss Seam 中文文档集合概述** JBoss Seam 是一个开源的应用框架,它结合了JavaServer Faces (JSF)、Java Persistence API (JPA)、Enterprise JavaBeans (EJB) 3.0 和其他Java EE组件,旨在简化企业级开发。这个...

    jboss-seam2.0文档

    【JBoss Seam 2.0文档详解】 JBoss Seam 是一个开源的企业级开发框架,它旨在简化Java EE应用的开发过程,特别是在Web和富互联网应用程序(Rich Internet Applications, RIA)领域。Seam 2.0是其重要的版本,提供了...

    jboss seam 2.0 中文手册

    整理自jboss seam 中文站,压缩为chm格式,便于广大jboss seam爱好者阅读,所有版权归jboss seam中文站所有。

    Jboss Seam 三本最受欢迎的教材

    2. **JSF集成**:学习如何利用Seam与JSF的集成,创建动态、数据驱动的用户界面。 3. **EJB和JPA集成**:掌握Seam如何与EJB和JPA协作,实现业务逻辑和数据持久化。 4. **安全和事务管理**:学习Seam的安全框架和事务...

Global site tag (gtag.js) - Google Analytics