把AppFuse配置启动起来的步骤
2005-04-28 18:25
246 查看
<script type="text/javascript">
&lt;!--
google_ad_client = "pub-2016433482135581";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "336699";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
//--&gt;
</script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
</script>
1。适用于Appfuse1.7/1.8.*(Struts+Spring+Hibernate) 需要用到的东西
JDK1.4.2_05,
ANT1.6.2,
Mysql4.1,
Tomcat5.0.28
拷贝appfuse lib/junit3.8.1/junit.jar 到 %ANT_HOME%/lib.
---------------------------------------------------------------------------
2.设置环境变量
ANT_HOME,
JAVA_HOME,
CATALINA_HOME,
MYSQL_HOME
Path中加入
%JAVA_HOME%bin;%ANT_HOME%bin;%CATALINA_HOME%bin;%MYSQL_HOME%bin;
---------------------------------------------------------------------------
3.运行Ant建立临时发布环境
先启动Mysql,建立数据库AppFuse
ant new -Dapp.name=YourAppName -Ddb.name=YourAppName
(我是用AppFuse 那么我的命令就是ant new -Dapp.name=AppFuse -Ddb.name=AppFuse)
YourAppName指你要建立的临时appfuse目录,与当前appfuse同级或可以设置路径
AppFuse也是我Mysql的数据库名,并且root用户的密码为空。
如果需要改变数据库可以修改build.properties文件中这部分的参数:
#database.jar=${postgresql.jar}
#database.type=postgresql
#database.name=myApp
#database.host=localhost
#database URL for creating other databases (doesn't work with pgsql)
#database.admin.url=jdbc:${database.type}://${database.host}/template1
#database.admin.username=postgres
#database.admin.password=postgres
#hibernate.dialect=net.sf.hibernate.dialect.PostgreSQLDialect
#database.driver_class=org.postgresql.Driver
#database.url=jdbc:${database.type}://${database.host}/${database.name}
运行
切换到这个新的工程目录并且运行
ant setup (或者运行 ant setup-db setup-tomcat deploy)
创建数据库,配置tomcat并发布你的新应用程序。创建数据库的任务只有在你的root用户密码为空的情况下才能工作。需要的话你可以修改 build.properties 文件.
Successfully~~~~~!
输入 http://localhost:8080/AppFuse。 Successfully!
输入用户名mraible 密码tomcat
OK~~~~~~ Go on
进入主界面,就可以看到清晰的界面,如果用户名和秘密错误,就会看到一幅美丽的风景画
测试报告
ant test-reports
==================================================================================================
导入到Eclipse中:
1、 打开Eclipse,选择文件(File)—导入(import),出现的页面里选择Exist Project into WorkSpace,选择app目录,单击确定,则项目导入。
2、 选择window—preference,在出现的页面里,选择ant---runtime—Ant Home Entries,单击右边的add external jar,选择junit的jar包,单击确定。
3、 属性设置页面,选择java--Buil Path—classpath valiables,单击右边的new按钮,加入J2EE_HOME的路径变量,并指定路径。
4、 打开项目目录下的build.xml文件,在ant的view窗口可以看到很多的任务,选择compile运行。
运行项目:
1、 运行ant任务列表中的start.tomcat,会在eclipse的console运行tomcat。
2、 打开浏览器,输入http://localhost:8080/AppFuse,会看到登录页面。Fuse,会看到登录页面。
但是如果你要在Eclipse上开发,你还需要安装一些插件,Lomboz XDoclet 是必须的,其他如
Proerties Editor , xml , color的那些就自己手动安装了。用MyEclipse最好,总的来说安装
AppFuse1.7还是比较简单的。如果不会Ant 可以到Apache,或者网上上查查他的命令,我开始是对ant命令不熟的,但是AppFuse用到了很多ant的命令,作者把ant运用的炉火纯青啊,建议看是如果不熟悉的ant,还是看看,对你有很大帮助。
appfuse目录下更改
1、把Oracle的JDBC驱动文件ojdbc14.jar,classes12.jar 复制到appfuse/lib/oracle目录下,oracle目录要新建
2、在Oracle中新增一个用户有两种
(1)直接打开Oracle新增一个用户,例如:ADMIN,权限最要少要有新增表的权限
(2)运行以下sql语句
CREATE USER ADMIN IDENTIFIED BY ADMIN;
GRANT CONNECT TO ADMIN;
GRANT RESOURCE TO ADMIN;
3、修改build.properties文件如下
database.jar=${lib.dir}/oracle/ojdbc14.jar
database.type=oracle
database.host=10.*.*.170
#use the database schema owner and password created in step #1 above here
database.username=edu
database.password=edu
database.schema=EDU
<iframe name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-2016433482135581&dt=1114791347352&format=728x90_as&output=html&color_bg=FFFFFF&color_text=000000&color_link=0000FF&color_url=008000&color_border=336699&ad_type=text_image&u_h=768&u_w=1024&u_ah=740&u_aw=1024&u_cd=32&u_tz=480&u_his=9&u_java=true" frameborder="0" width="728" scrolling="no" height="90" allowtransparency="allowtransparency"></iframe>
hibernate.dialect=org.hibernate.dialect.Oracle9Dialect
database.driver_class=oracle.jdbc.driver.OracleDriver
database.url=jdbc:oracle:thin:@10.*.*.170:1521:q1spc01
4、修改bulid.xml文件
<!=================================================================== -->
<!-- The "db-create" target creates a database based on properties -->
<!-- from the database.properties file -->
<!-- =================================================================== -->
<target name="db-create" depends="init"
description="create database for ${database.type}">
<echo level="debug">${database.jar}</echo>
<if>
<equals arg1="${database.type}" arg2="oracle"/>
<then>
<echo message="Detected Oracle, creating database..."/>
<echo>Creating '${database.name}' database with: ${database.type}-create.sql</echo>
<echo>URL: ${database.admin.url}</echo>
<copy tofile="${build.dir}/dao/gen/${database.type}-create.sql" overwrite="true" filtering="true">
<fileset file="metadata/sql/${database.type}-create.sql"/>
<filterset refid="db.variables"/>
</copy>
<sql onerror="continue"
<!--注意以下要与上面的bulid.properties文件的对应-->
driver="${database.driver_class}"
url="${database.url}"
userid="${database.username}"
password="${database.password}">
原来的有一句是url="${database.admin.url}"改成url="${database.url}"
看清楚了,这里花了我好长时间,要不能总是报Oracel用户名密码不对.
---------------------------------------------------------------------
注意还有一个地方要修改,也是在bulid.xml文件下
<!-- =================================================================== -->
<!-- Export the data -->
<!-- =================================================================== -->
<target name="db-export" depends="prepare"
description="Exports the current data in the database">
<dbunit driver="${database.driver_class}" url="${database.url}"
userid="${database.username}" password="${database.password}">
<export dest="db-export.xml" format="xml"/>
</dbunit>
</target>
<target name="db-load" depends="prepare" description="Loads the database with sample data">
<!-- Conditionally change operation based on whether database is mssql -->
<condition property="operation" value="MSSQL_CLEAN_INSERT" else="CLEAN_INSERT">
<equals arg1="${database.type}" arg2="sqlserver"/>
</condition>
<property name="file" value="metadata/sql/sample-data.xml"/>
<dbunit driver="${database.driver_class}"
supportBatchStatement="false" url="${database.url}"
-----------------------------------------------------------------------------
userid="${database.username}" password="${database.password}">
----------------------------------------------------------------------------
在这里要新增一个schema="${database.schema}变成以下语句
要不能会报"org.dbunit.database.AmbiguousTableNameException ."这个错
userid="${database.username}" password="${database.password}"
schema="${database.schema}">
4、在appfuse/metadata/sql目录新建一个文件
oracle-create.sql
文件里什么都不用写
------------------------------------------------
四、现在开始生成你的Oracle项目了
cd {appfuse path}
ant new -Dapp.name=myappname -Ddb.name=appftest
cd ../myappname
ant setup
五、检验
启动tomcat
在浏览器敲入url:http://localhost:port/myappname检验是否成功!
&lt;!--
google_ad_client = "pub-2016433482135581";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "336699";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
//--&gt;
</script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
</script>
1。适用于Appfuse1.7/1.8.*(Struts+Spring+Hibernate) 需要用到的东西
JDK1.4.2_05,
ANT1.6.2,
Mysql4.1,
Tomcat5.0.28
拷贝appfuse lib/junit3.8.1/junit.jar 到 %ANT_HOME%/lib.
---------------------------------------------------------------------------
2.设置环境变量
ANT_HOME,
JAVA_HOME,
CATALINA_HOME,
MYSQL_HOME
Path中加入
%JAVA_HOME%bin;%ANT_HOME%bin;%CATALINA_HOME%bin;%MYSQL_HOME%bin;
---------------------------------------------------------------------------
3.运行Ant建立临时发布环境
先启动Mysql,建立数据库AppFuse
ant new -Dapp.name=YourAppName -Ddb.name=YourAppName
(我是用AppFuse 那么我的命令就是ant new -Dapp.name=AppFuse -Ddb.name=AppFuse)
YourAppName指你要建立的临时appfuse目录,与当前appfuse同级或可以设置路径
AppFuse也是我Mysql的数据库名,并且root用户的密码为空。
如果需要改变数据库可以修改build.properties文件中这部分的参数:
#database.jar=${postgresql.jar}
#database.type=postgresql
#database.name=myApp
#database.host=localhost
#database URL for creating other databases (doesn't work with pgsql)
#database.admin.url=jdbc:${database.type}://${database.host}/template1
#database.admin.username=postgres
#database.admin.password=postgres
#hibernate.dialect=net.sf.hibernate.dialect.PostgreSQLDialect
#database.driver_class=org.postgresql.Driver
#database.url=jdbc:${database.type}://${database.host}/${database.name}
运行
切换到这个新的工程目录并且运行
ant setup (或者运行 ant setup-db setup-tomcat deploy)
创建数据库,配置tomcat并发布你的新应用程序。创建数据库的任务只有在你的root用户密码为空的情况下才能工作。需要的话你可以修改 build.properties 文件.
Successfully~~~~~!
输入 http://localhost:8080/AppFuse。 Successfully!
输入用户名mraible 密码tomcat
OK~~~~~~ Go on
进入主界面,就可以看到清晰的界面,如果用户名和秘密错误,就会看到一幅美丽的风景画
测试报告
ant test-reports
==================================================================================================
导入到Eclipse中:
1、 打开Eclipse,选择文件(File)—导入(import),出现的页面里选择Exist Project into WorkSpace,选择app目录,单击确定,则项目导入。
2、 选择window—preference,在出现的页面里,选择ant---runtime—Ant Home Entries,单击右边的add external jar,选择junit的jar包,单击确定。
3、 属性设置页面,选择java--Buil Path—classpath valiables,单击右边的new按钮,加入J2EE_HOME的路径变量,并指定路径。
4、 打开项目目录下的build.xml文件,在ant的view窗口可以看到很多的任务,选择compile运行。
运行项目:
1、 运行ant任务列表中的start.tomcat,会在eclipse的console运行tomcat。
2、 打开浏览器,输入http://localhost:8080/AppFuse,会看到登录页面。Fuse,会看到登录页面。
但是如果你要在Eclipse上开发,你还需要安装一些插件,Lomboz XDoclet 是必须的,其他如
Proerties Editor , xml , color的那些就自己手动安装了。用MyEclipse最好,总的来说安装
AppFuse1.7还是比较简单的。如果不会Ant 可以到Apache,或者网上上查查他的命令,我开始是对ant命令不熟的,但是AppFuse用到了很多ant的命令,作者把ant运用的炉火纯青啊,建议看是如果不熟悉的ant,还是看看,对你有很大帮助。
appfuse目录下更改
1、把Oracle的JDBC驱动文件ojdbc14.jar,classes12.jar 复制到appfuse/lib/oracle目录下,oracle目录要新建
2、在Oracle中新增一个用户有两种
(1)直接打开Oracle新增一个用户,例如:ADMIN,权限最要少要有新增表的权限
(2)运行以下sql语句
CREATE USER ADMIN IDENTIFIED BY ADMIN;
GRANT CONNECT TO ADMIN;
GRANT RESOURCE TO ADMIN;
3、修改build.properties文件如下
database.jar=${lib.dir}/oracle/ojdbc14.jar
database.type=oracle
database.host=10.*.*.170
#use the database schema owner and password created in step #1 above here
database.username=edu
database.password=edu
database.schema=EDU
<iframe name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-2016433482135581&dt=1114791347352&format=728x90_as&output=html&color_bg=FFFFFF&color_text=000000&color_link=0000FF&color_url=008000&color_border=336699&ad_type=text_image&u_h=768&u_w=1024&u_ah=740&u_aw=1024&u_cd=32&u_tz=480&u_his=9&u_java=true" frameborder="0" width="728" scrolling="no" height="90" allowtransparency="allowtransparency"></iframe>
hibernate.dialect=org.hibernate.dialect.Oracle9Dialect
database.driver_class=oracle.jdbc.driver.OracleDriver
database.url=jdbc:oracle:thin:@10.*.*.170:1521:q1spc01
4、修改bulid.xml文件
<!=================================================================== -->
<!-- The "db-create" target creates a database based on properties -->
<!-- from the database.properties file -->
<!-- =================================================================== -->
<target name="db-create" depends="init"
description="create database for ${database.type}">
<echo level="debug">${database.jar}</echo>
<if>
<equals arg1="${database.type}" arg2="oracle"/>
<then>
<echo message="Detected Oracle, creating database..."/>
<echo>Creating '${database.name}' database with: ${database.type}-create.sql</echo>
<echo>URL: ${database.admin.url}</echo>
<copy tofile="${build.dir}/dao/gen/${database.type}-create.sql" overwrite="true" filtering="true">
<fileset file="metadata/sql/${database.type}-create.sql"/>
<filterset refid="db.variables"/>
</copy>
<sql onerror="continue"
<!--注意以下要与上面的bulid.properties文件的对应-->
driver="${database.driver_class}"
url="${database.url}"
userid="${database.username}"
password="${database.password}">
原来的有一句是url="${database.admin.url}"改成url="${database.url}"
看清楚了,这里花了我好长时间,要不能总是报Oracel用户名密码不对.
---------------------------------------------------------------------
注意还有一个地方要修改,也是在bulid.xml文件下
<!-- =================================================================== -->
<!-- Export the data -->
<!-- =================================================================== -->
<target name="db-export" depends="prepare"
description="Exports the current data in the database">
<dbunit driver="${database.driver_class}" url="${database.url}"
userid="${database.username}" password="${database.password}">
<export dest="db-export.xml" format="xml"/>
</dbunit>
</target>
<target name="db-load" depends="prepare" description="Loads the database with sample data">
<!-- Conditionally change operation based on whether database is mssql -->
<condition property="operation" value="MSSQL_CLEAN_INSERT" else="CLEAN_INSERT">
<equals arg1="${database.type}" arg2="sqlserver"/>
</condition>
<property name="file" value="metadata/sql/sample-data.xml"/>
<dbunit driver="${database.driver_class}"
supportBatchStatement="false" url="${database.url}"
-----------------------------------------------------------------------------
userid="${database.username}" password="${database.password}">
----------------------------------------------------------------------------
在这里要新增一个schema="${database.schema}变成以下语句
要不能会报"org.dbunit.database.AmbiguousTableNameException ."这个错
userid="${database.username}" password="${database.password}"
schema="${database.schema}">
4、在appfuse/metadata/sql目录新建一个文件
oracle-create.sql
文件里什么都不用写
------------------------------------------------
四、现在开始生成你的Oracle项目了
cd {appfuse path}
ant new -Dapp.name=myappname -Ddb.name=appftest
cd ../myappname
ant setup
五、检验
启动tomcat
在浏览器敲入url:http://localhost:port/myappname检验是否成功!
相关文章推荐
- 修改Linux配置文件到导致Linux启动不起来(boot has failed sleeping forever)的解决步骤
- 官方配置solr步骤(一)---solr下载及单节点的启动、配置说明
- Mybatis分页配置,jar配比 myeclipse 配置mybatis分页插件启动不起来且不报错 和 超时之后会报java heap space
- CentOS7 最小化安装后,安装配置并启动httpd的步骤
- 解决配置appfuse后,tomcat5.0无法启动appfuse的服务,报错,无法连接mysql
- CentOS6.5下redis3.0.7安装、启动、关闭、配置密码、开机启动详细步骤
- tomcat启动不起来的配置
- linux下oracle自动启动配置步骤
- Linux下root用户ftp或telnet 登陆配置步骤与启动telnet服务
- samba服务器启动前配置步骤
- eclipse启动不起来,eclipse.ini配置问题(支持大内存64bit问题)
- Wildfly在Linux下以Service的方式启动 配置步骤
- MySql绿色版安装步骤和方法,以及配置文件修改,Mysql服务器启动
- 配置mysql start service步骤无法启动
- eclipse启动不起来,eclipse.ini配置问题(支持大内存64bit问题)
- Xilinx_Zynq_QSPI启动的编译、烧写、及配置过程步骤基于zedboard
- Xilinx_Zynq_QSPI启动的编译、烧写、及配置过程步骤
- spring容器配置及启动步骤
- 配置hbase主节点HMaster启动不起来
- Zookeeper-HA-配置文件(详解)及启动步骤