JumpStart 5.2用例安装说明 tapestry5

Installation 说明

These steps will quickly get JumpStart 5.2.n running and editable.

1.     Unzip. Unzip the downloaded file, which will give you a directory called jumpstart-5.2.0 or similar.

§  Move it to your development area, eg. /devel/jumpstart-5.2.0/ .

§  DO NOT choose a directory whose path contains any spaces, eg. do not use a directory whose path includes C:/Documents and Settings/.

        解压:下载并解压jumpstart-5.2.0或者之前的版本,

2.     Open it in Eclipse 3.6 (Helios). Open Eclipse, choose File > Import..., then choose General > Existing Projects into Workspace, click Next >, set the root directory to your jumpstart directory eg. /devel/jumpstart-5.2.0/, click Finish. The project can't build just yet so it will show errors.

打开Eclipse  , 导入方法为choose File > Import..., then choose General > Existing Projects into Workspace, click Next >,设置根目录比如:/devel/jumpstart-5.2.0/click Finish这个project不会创建完成可能会显示错误(我本人用了eclipse-java-helios-SR2-win32最新版本发现程序根本不会报错,看来作者写这个文档很谨慎)

3.     Ensure the project is using Java 1.6.确保你用的的java 1.6的版本,如果不是请参考下文中斜体字的描述,按照这个描述进行操作。

 In Eclipse, right-click on the project and choose Properties then Java Compiler and ensure Compiler compliance level is 1.6. You may have to turn on Enable project specific settings.

§  Be wary of Sun-JDK version 1.6.0_18. It may upset OpenEJB (see OPENEJB-1131).

 

4.     Get dependent files The project has an Ant build file, build.xml, with a get-dependent-files target. To run it in Eclipse:

§  Open the Ant view and drag build.xml onto it.

§  If your internet connection is through a proxy then modify the setproxy tag in build.xml, eg. 如果是通过代理连接网络的那么则需要对build.xml做修改

<setproxy proxyhost="proxy.mycompany.com" proxyport="8080"></setproxy>

This may also be necessary in business/build.xml and web/build.xml.

同样在business/build.xml web/build.xml.都需要修改

§  Run the get-dependent-files target in the project's build.xml file (find the target in the Ant view and double-click on it). If Ant has problems due to the maven repository being slow or inaccessible, open the project's build.properties and choose a different maven.repo.root, then try running the target again.

§  运行build.xml文件(一般Eclipse 会自己运行一遍)并进行下载,如果访问的maven存储点 太慢或者无法访问,那么打开project's build.properties并选择不同的maven.repo.root,然后重新运行一遍

 

The result is that the following directories become populated with fresh JARs:

运行结果是下面的目录将都增加了新的JARS,这些目录在导航的时候原本是没有的

  business/src/main/lib-compile/

  business/src/main/lib-provided/

  business/src/main/lib-runtime/

  business/src/test/lib-test/

  business/src/test/lib-test-local-openejb/

  web/src/main/lib-compile/

  web/src/main/lib-provided/

  web/src/main/lib-runtime/

  web/src/test/lib-test/

 

5.     Refresh the project In Eclipse, right-click on the project and choose Refresh. This should build the project successfully and show no errors. It will also run collapser.xml, which will build the collapsed/ directory containing a WAR in "collapsed EAR" format. You can see how has this been configured by displaying the project's properties and choosing Builders.

刷新工程,

6.     Set collapsed directory to derived In Eclipse, right-click on the collapsed directory, choose Properties, and tick the derived checkbox. Then click OK.

右击collapsed选择Properties,选上derived checkbox,然后点击OK

7.     Get Jetty WebServer. 下载Jetty WebServer This will be your web server during development. 你的web server将部署在这个WebServer里面

§  Go to Codehaus Downloads and download jetty-6.1.26.zip (or, if you prefer, go to Jetty and navigate to the download). 点击“Codehaus Downloads”获取jetty

§  Once downloaded, unzip it. Move it to a suitable location (eg. /devel/jetty-6.1.26).

§  载完,解压,然后放到一个合适的路径(比如. /devel/jetty-6.1.26

§  In Eclipse, choose Window > Preferences > Java > Build Path > User Libraries (or in OS X, choose Eclipse > Preferences > Java > Build Path > User Libraries), and

§  Click New... and create a new user library called jetty-6.1.26-lib, then

Click Add Jars... and add the following jars from Jetty's lib/ directory to the new user library: Eclipse创建一个User Libraries,命名为jetty-6.1.26-lib,并加入如下四个包

§   

§     jetty-6.1.26.jar

§     jetty-util-6.1.26.jar

§     plus/jetty-plus-6.1.26.jar

§     naming/jetty-naming-6.1.26.jar

   Eclipse创建一个User Libraries,命名为jetty-6.1.26-lib,并加入如下四个包

8.     Get OpenEJB. This will be your embedded EJB container during development. 下载openejb-3.1.4.zip,创建user library 我们命名为openejb-3.1.4-lib,同时把openejb-3.1.4.zip里面的jar包都放进去

§  Go to Apache Download Mirrors and download openejb-3.1.4.zip .

§  Once downloaded, unzip it. Move it to a suitable location (eg. /devel/openejb-3.1.4).

§  In Eclipse, choose Window > Preferences > Java > Build Path > User Libraries (or in OS X, choose Eclipse > Preferences > Java > Build Path > User Libraries), and

§  Click New... and create a new user library called openejb-3.1.4-lib, then

§  Click Add Jars... and add every JAR in OpenEJB's lib/ directory to the new user library.

You now have the following environment available to Eclipse:

Web Server

Business Server

Persistence

Database Server

Logger

Jetty

OpenEJB

Hibernate

HSQLDB

Log4j

(As a user library)

(As a user library)

(As jars in project)

(Within OpenEJB)

(As jars in project)


Here's how to use it:

§  Populate the database. Populate the Hypersonic database (HSQLDB) within OpenEJB:

·         In Eclipse, open the data_util.properties file and modify the properties hsqldb.data.dir and hsqldb.jar.dir. Use relative paths eg. ../openejb-3.1.4/data/hsqldb and ../openejb-3.1.4/lib .

·         Drag the data_util.xml file to the Ant view and run its target reset-database-hsqldb-prompted. It will prompt you to confirm.
If you get the error "
Cannot load 32-bit SWT libraries on 64-bit JVM" in OS X, then right-click on the target reset-database-hsqldb and choose Run As > Ant Build... > JRE and add VM argument -d32, and click Run. The cause is explained here.

§  Start Jetty. In Eclipse... 设置Jetty

§ 

 
 
 

·                参考图基本上就能看清楚了 ,这里就不做讲解了

·        

·         Choose Run > Run Configurations.... The Run Configurations window will appear.

·           Right-click on Java Application and choose New.

·           Set the variables to values similar to those shown in the screen shot.     

·                Click on the Arguments tab.

·           Set the VM arguments to the following, replacing the value of openejb.home with yours, eg.:

·         -Dtapestry.production-mode=false

·         -Dtapestry.compress-whitespace=false

·         -Djetty.home=../jetty-6.1.26

·         -Dorg.mortbay.jetty.webapp.parentLoaderPriority=true

·         -Dopenejb.home=../openejb-3.1.4

·         -Dhibernate.hbm2ddl.auto=update

·         -Xms192m

·         -Xmx192m

·         -XX:MaxNewSize=96m

·         -XX:MaxPermSize=96m

·           These properties are explained here: tapestry, jetty, openejb, hibernate, JVM.

·

·                We have to "spell out" the classpath to jetty to avoid classloader issues.

·           Click on the Classpath tab.

·           Remove the (default classpath) entry.

·           Click on User Entries.

·           Add folder web/src/test/conf .

·           Add folder collapsed/jumpstart.war/WEB-INF/classes/ .

·           Add all JARs from these folders:

·           collapsed/jumpstart.war/WEB-INF/lib/

·         business/src/main/lib-provided/

·         web/src/main/lib-provided/

·         web/src/test/lib-test/

·           Add user library jetty-6.1.26-lib .

·           Add user library openejb-3.1.4-lib .

·           Remove these JARs because they are also in the user library:

·           jetty-6.1.26.jar - /jumpstart-n/web/src/main/lib-test/jetty-util-6.1.26.jar - /jumpstart-n/web/src/main/lib-test

·           Remove these JARS because they are duplicates:

·           javaee-api-n.n-n.jar - /jumpstart-n/web/src/main/lib-provided/joda-time-n.n.jar - /jumpstart-n/web/src/main/lib-provided/

·         slf4j-api-n.n-n.jar - /jumpstart-n/web/src/main/lib-provided/

·           Move the two folders to the top. It avoids conflicts.

·         Click Run.

§  If error, especially ClassNotFoundException for org.slf4j.Logger or org.slf4j.impl.StaticLoggerBinder, check the Arguments and classpath match those shown above.

§  Check JumpStart is running by pointing your web browser at http://localhost:8080/jumpstart.

§  Confirm you can log in by going to http://localhost:8080/jumpstart/theapp/login and logging in as secofr with password secofr.
There are another 2 users:
admin and john, with passwords admin and john, respectively.

§  Try making a mod! As another quick test...

·         In Eclipse, locate the template of the front page - web/src/main/java/pages/Index.tml - and modify it a little.
If you change the template or java of a page you'll see the change just a moment later in your running application.

·         Remember - if the application isn't running then you can still immediately preview the mod by opening the .tml file with a web browser, or in Eclipse try Open With > Web Browser if that option is available. This is one of Tapestry's many strengths.

Next steps.
Visit Orientation, Tips, and Troubleshooting for more info.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值