今天刚接触Appfuse,通过在网上搜集一些资料和看官方网站,然后打开myeclipse开始体验Appfuse。但是没多久就出现了点问题,我的操作主要是参考http://dxjsunday.blog.hexun.com/7616716_d.html,首先下载了Appfuse。(tomcat,ant,等我的电脑本身就安装好了)。在命令提示行下进入D:\appfuse\appfuse,运行 “ant new”,为了不出现意想不到的错误我用的都是默认的参数,脚本运行成功后,在D:\appfuse下出现创建了新项目myapp,然后修改了D:\appfuse\myapp\properties.xml中数据库用户名和密码。然后又修改了D:\appfuse\myapp\metadata\sql\mysql-create.sql 的第一行为create database if not exists @DB-NAME@ CHARACTER SET utf8 COLLATE utf8_general_ci;以便支持多语言。
然后 打开myeclipse,选择 file--import --existingprojects into workspace把myappfuse导入 myeclipse,导入后项目名称上就出现了个错误的红叉,但是项目下的文件夹及文件上我并没看到有任何红叉,按照官方上说的出现的错误是正常的,这是引用官方上的原话(Most of them involve the fact that the UserForm class can not be found. This is because all of the ActionForms in AppFuse (if you're using the Struts version) are generated from POJOs with XDoclet. )我的myeclipse上的错误描述是:
project myapp is missing required source folder:"builder/dao/gen
project myapp is missing required source folder:"builder/myapp
project myapp is missing required source folder:"builder/service/classes
project myapp is missing required source folder:"builder/web/classes
the project can't be build until buildpath errror are resolved
unbound classpath variable:'ECLIPSE_HOME/plugings/org.apache.ant_1.6.5/lib/ant.jar in project myapp
然后我在myeclipse的Window → Preferences → Ant → Runtime点击"Ant Home"然后把我电脑上Ant路径加进去,add the catalina-ant.jar (from $CATALINA_HOME/server/lib) to the ant classpath,Then in the property tab, add tomcatTasks.properties (in lib/ant-contrib) file as a global properties file. still in Ant - Runtime - Properties tab, add the global property "tomcat.home" with a value of your CATALINA_HOME environment variable.
打开ant 控制台,运行ant后显示build success.项目中原来的错误描述也剩下最后面的两个了。
忽略这两个错误,继续ant setup 显示build success,ant test-all 显示BUILD FAILED
D:\MyEclipseWorkspace\newworkspace\myapp\build.xml:634: The following error occurred while executing this line:
D:\MyEclipseWorkspace\newworkspace\myapp\build.xml:599: The following error occurred while executing this line:
D:\MyEclipseWorkspace\newworkspace\myapp\test\web\web-tests.xml:28: Canoo Webtest: R_1393.
Test failed.
Test step verifytitle (D:\MyEclipseWorkspace\newworkspace\myapp\test\web\login.xml:2: ) named "we should see the login title" failed with message "Wrong document title found! Expected ".*??????.*" but got "登录 | AppFuse""
大约是因为存在错误的缘故,打开tomcat后输入用户名和密码总是提示用户名和密码错误。
这个appfuse是spring mvc的,我之前用appfuse-tapestry-1.9.3,是能登陆进去的,但是添加菜单后无法编辑。
小弟刚接触这些,希望各位大侠指点下。