1、install jdk-1_5_0-windows-i586.exe to c:\jdk directory
  2、add c:\jdk\bin to path envirment parameter
  3、add c:\jdk as JAVA_HOME parameter
  4、download maven 2.0.9
  5、extract to d:\maven209 directory
  6、add d:\maven209\bin to path envirment parameter
  7、add d:\maven209 as MAVEN_HOME parameter
  8、edit D:\maven209\conf\settings.xml,  set localRepository path as follow:
     <localRepository>d:/Study/m2</localRepository>
  9、make directory d:/Study/m2
  12、download  postgresql-8.2.5-1.zip and exact it .
  
  13、run postgresql-8.2.msi, install postgresql,select language
"English/English"
  14、create database
     CREATE DATABASE appfuse WITH OWNER = postgres ENCODING='UTF-8';
  
  15、download appfuse-dependencies-2.0.2.zip ,exact to d:/Study/m2 path
  
the following steps are guided by the article
"http://appfuse.org/display/APF/AppFuse+QuickStart";
      
  16、run
       mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes
-DarchetypeArtifactId=appfuse-modular-tapestry
-DremoteRepositories=http://static.appfuse.org/releases
-DarchetypeVersion=2.0.2 -DgroupId=com.myappfuse -DartifactId=app
  
  17、make appfuse to use the database postgres, according to the article
"http://raibledesigns.com/rd/entry/database_profiles_in_appfuse_2";
      edit   D:\Study\m2\app\pom.xml, using database postgresql, 
      add the following code next to the line "<id>postgresql</id>"
        
            <activation>
                 <activeByDefault>true</activeByDefault>
            </activation>
       and set the jdbc.url,jdbc.username,jdbc.password
  18、configure the appfuse to use ibatis according to the article
"http://appfuse.org/display/APF/Using+iBATIS";
       
       Change the <dao.framework> property in your pom.xml to be ibatis
instead of hibernate.
       
       make directory  
       D:\Study\m2\app\core\src\main\resources\sqlmaps  
       downloading the files LookupSQL.xml, RoleSQL.xml and UserSQL.xml and
copy them to the directory
       
  19、Using SQL Maven Plugin to Generate Schema
      
      Delete src/main/resources/hibernate.cfg.xml     
      
      Download the schema creation DDL for PostgreSQL from the url in the
article ""http://appfuse.org/display/APF/Using+iBATIS"";
      
      I think it should be postgresql-schema.sql, but I get my-schema.sql,
the DDL is for the mysql. 
      so I rename the file, and replace the contents of the file as
following:
        
        
                        DROP TABLE user_role;
                        DROP TABLE app_user;
                        DROP TABLE "role";
                        
                        DROP SEQUENCE user_role_id;
                        DROP SEQUENCE app_user_seq;
                        DROP SEQUENCE role_seq;
                        
                        -- Note the start value of 3 so the 2 inserts performed 
by appfuse do not
conflict
                        CREATE SEQUENCE app_user_seq
                          INCREMENT 1
                          MINVALUE 1
                          MAXVALUE 9223372036854775807
                          START 3
                          CACHE 1;
                        
                        CREATE SEQUENCE role_seq
                          INCREMENT 1
                          MINVALUE 1
                          MAXVALUE 9223372036854775807
                          START 11
                          CACHE 1;
                        
                        CREATE SEQUENCE user_role_id
                          INCREMENT 1
                          MINVALUE 1
                          MAXVALUE 9223372036854775807
                          START 1
                          CACHE 1;
                        
                        CREATE TABLE app_user
                        (
                          id int4 NOT NULL DEFAULT 
nextval('app_user_seq'::regclass),
                          username varchar(20) NOT NULL,
                          version int4 NOT NULL,
                          "password" varchar(50),
                          first_name varchar(50),
                          last_name varchar(50),
                          address varchar(150),
                          city varchar(50),
                          province varchar(100),
                          country varchar(100),
                          postal_code varchar(15),
                          email varchar(50),
                          phone_number varchar(20),
                          website varchar(255),
                          password_hint varchar(100),
                          account_enabled bool,
                          account_expired bool,
                          account_locked bool,
                          credentials_expired bool,
                          CONSTRAINT app_user_pkey PRIMARY KEY (id),
                          CONSTRAINT app_user_email_key UNIQUE (email),
                          CONSTRAINT app_user_username_key UNIQUE (username)
                        )
                        WITHOUT OIDS;
                        
                        CREATE TABLE "role"
                        (
                          id int4 NOT NULL DEFAULT 
nextval('role_seq'::regclass),
                          name varchar(20) NOT NULL,
                          description varchar(64),
                          CONSTRAINT role_pkey PRIMARY KEY (id)
                        )
                        WITHOUT OIDS;
                        
                        
                        CREATE TABLE user_role
                        (
                          user_id int4 NOT NULL,
                          role_id int4 NOT NULL,
                          CONSTRAINT user_role_pkey PRIMARY KEY (user_id, 
role_id),
                          CONSTRAINT fk143bf46a14048cb4 FOREIGN KEY (role_id)
                              REFERENCES "role" (id) MATCH SIMPLE
                              ON UPDATE NO ACTION ON DELETE NO ACTION,
                          CONSTRAINT fk143bf46af02988d6 FOREIGN KEY (user_id)
                              REFERENCES app_user (id) MATCH SIMPLE
                              ON UPDATE NO ACTION ON DELETE NO ACTION
                        ) 
                        WITHOUT OIDS;
                        ;

      I put the file into the directory: 
D:\Study\m2\app\core\src\test\resources
      
   20、Remove the hibernate3-maven-plugin from D:\Study\m2\app\core\pom.xml
and replace it with the sql-maven-plugin: 
      
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>sql-maven-plugin</artifactId>
            <version>1.0</version>
            <configuration>
                <driver>${jdbc.driverClassName}</driver>
                <username>${jdbc.username}</username>
                <password>${jdbc.password}</password>
                <url>${jdbc.url}</url>
                <autocommit>true</autocommit>
                <skip>${maven.test.skip}</skip>
            </configuration>
            <executions>                    
                <execution>
                    <id>create-schema</id>
                    <phase>process-test-resources</phase>
                    <goals>
                        <goal>execute</goal>
                    </goals>
                    <configuration>
                        <autocommit>true</autocommit>
                        <srcFiles>
                           
<srcFile>src/test/resources/${jdbc.groupId}-schema.sql</srcFile>
                        </srcFiles>
                    </configuration>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>${jdbc.groupId}</groupId>
                    <artifactId>${jdbc.artifactId}</artifactId>
                    <version>${jdbc.version}</version>
                </dependency>
            </dependencies>
        </plugin>
    
    21、run the test
         mvn integration-test -Ppostgresql -Duser.language=en
         
         and get error messages
         
the logs is bellow:


D:\Study\m2\app>mvn integration-test -Ppostgresql -Duser.language=en
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   AppFuse Modular Application
[INFO]   AppFuse Modular Application - Core
[INFO]   AppFuse Modular Application - Web (Tapestry)
[INFO]
------------------------------------------------------------------------
[INFO] Building AppFuse Modular Application
[INFO]    task-segment: [integration-test]
[INFO]
------------------------------------------------------------------------
[INFO] [site:attach-descriptor]
[INFO]
------------------------------------------------------------------------
[INFO] Building AppFuse Modular Application - Core
[INFO]    task-segment: [integration-test]
[INFO]
------------------------------------------------------------------------
[INFO] [aspectj:compile {execution: default}]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [sql:execute {execution: create-schema}]
[INFO] Executing file:
D:\Study\m2\app\core\src\test\resources\postgresql-schema
.sql
[INFO] 12 of 12 SQL statements executed successfully
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [dbunit:operation {execution: default}]
[INFO] [surefire:test]
[INFO] Surefire report directory:
D:\Study\m2\app\core\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running CoreTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.078 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] [jar:jar]
[INFO]
------------------------------------------------------------------------
[INFO] Building AppFuse Modular Application - Web (Tapestry)
[INFO]    task-segment: [integration-test]
[INFO]
------------------------------------------------------------------------
[INFO] [warpath:add-classes {execution: default}]
[INFO] [native2ascii:native2ascii {execution: native2ascii-utf8}]
[INFO] [native2ascii:native2ascii {execution: native2ascii-8859_1}]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 1 source file to D:\Study\m2\app\web\target\classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Compiling 1 source file to D:\Study\m2\app\web\target\test-classes
[INFO] [dbunit:operation {execution: test-compile}]
[INFO] [surefire:test]
[INFO] Surefire report directory:
D:\Study\m2\app\web\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.myappfuse.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.078 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] [dbunit:operation {execution: test}]
[INFO] [war:war]
[INFO] Exploding webapp...
[INFO] Assembling webapp app-webapp in
D:\Study\m2\app\web\target\app-webapp-1.0
-SNAPSHOT
[INFO] Copy webapp webResources to
D:\Study\m2\app\web\target\app-webapp-1.0-SNA
PSHOT
[INFO] Overlaying 2 war(s).
[INFO] Generating war D:\Study\m2\app\web\target\app-webapp-1.0-SNAPSHOT.war
[INFO] Building war: D:\Study\m2\app\web\target\app-webapp-1.0-SNAPSHOT.war
[INFO] [cargo:start {execution: start-container}]
[INFO] [stalledLocalDeployer] Deploying
[D:\Study\m2\app\web\target\app-webapp-1
.0-SNAPSHOT.war] to
[D:\Study\m2\app\web\target/tomcat5x/container/webapps]...
[INFO] [talledLocalContainer] Tomcat 5.x starting...
[INFO] [talledLocalContainer] 2008-6-12 15:20:37
org.apache.coyote.http11.Http11
Protocol init
[INFO] [talledLocalContainer] 信息: Initializing Coyote HTTP/1.1 on http-8081
[INFO] [talledLocalContainer] 2008-6-12 15:20:37
org.apache.catalina.startup.Cat
alina load
[INFO] [talledLocalContainer] 信息: Initialization processed in 1090 ms
[INFO] [talledLocalContainer] 2008-6-12 15:20:37
org.apache.catalina.core.Standa
rdService start
[INFO] [talledLocalContainer] 信息: Starting service Catalina
[INFO] [talledLocalContainer] 2008-6-12 15:20:37
org.apache.catalina.core.Standa
rdEngine start
[INFO] [talledLocalContainer] 信息: Starting Servlet Engine: Apache
Tomcat/6.0.1
4
[INFO] [talledLocalContainer] 2008-6-12 15:20:42
org.apache.catalina.core.Applic
ationContext log
[INFO] [talledLocalContainer] 信息: Initializing Spring root
WebApplicationConte
xt
[INFO] [talledLocalContainer] 2008-6-12 15:20:53
org.apache.catalina.startup.Hos
tConfig deployWAR
[INFO] [talledLocalContainer] 信息: Deploying web application archive
cargocpc.w
ar
[INFO] [talledLocalContainer] 2008-6-12 15:20:53
org.apache.coyote.http11.Http11
Protocol start
[INFO] [talledLocalContainer] 信息: Starting Coyote HTTP/1.1 on http-8081
[INFO] [talledLocalContainer] 2008-6-12 15:20:53
org.apache.catalina.startup.Cat
alina start
[INFO] [talledLocalContainer] 信息: Server startup in 15590 ms
[INFO] [talledLocalContainer] Tomcat 5.x started on port [8081]
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
    [mkdir] Created dir: D:\Study\m2\app\web\target\webtest-data
     [echo] Testing 'app-webapp-1.0-SNAPSHOT' with locale 'en'

Login:

Logout:

PasswordHint:
[INFO] [talledLocalContainer] [app] ERROR [http-8081-3] MailEngine.send(76)
| Ma
il server connection failed; nested exception is
javax.mail.MessagingException:
Could not connect to SMTP host: localhost, port: 25;
[INFO] [talledLocalContainer]   nested exception is:
[INFO] [talledLocalContainer]   java.net.ConnectException: Connection
refused: c
onnect

Signup:
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error executing ant tasks

Embedded error: The following error occurred while executing this line:
D:\Study\m2\app\web\src\test\resources\web-tests.xml:175: Wrong document
title f
ound!. Expected value ".*Main Menu.*" but got "Doh! | AppFuse"
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1 minute 15 seconds
[INFO] Finished at: Thu Jun 12 15:21:21 CST 2008
[INFO] Final Memory: 45M/63M
[INFO]
------------------------------------------------------------------------
         
-- 
View this message in context: 
http://www.nabble.com/Appfuse2.0M3-locale-%27zh%27-unsupported-tp8840662s2369p17794161.html
Sent from the AppFuse - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to