免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1411 | 回复: 0
打印 上一主题 下一主题

我的APPFUSE开发问题记录 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-21 19:05 |只看该作者 |倒序浏览
1。怎样使每次测试时不删除数据库中表结构?
解答:将pom.xml配置中的如下代码屏蔽掉。
                                org.codehaus.mojo
                                hibernate3-maven-plugin
                                2.0-alpha-2
                                
                                       
                                                
                                                        hbm2ddl
                                                        
                                                                annotationconfiguration
                                                        
                                                
                                       
                                       
                                                true
                                                true
                                                
                                                        target/classes/jdbc.properties
                                                
                                                ${maven.test.skip}
                                       
                                
                                
                                       
                                                process-test-resources
                                                
                                                        hbm2ddl
                                                
                                       
                                
                                
                                       
                                                ${jdbc.groupId}
                                                ${jdbc.artifactId}
                                                ${jdbc.version}
                                       
                                
                        
2。怎样使用外部配置变量?
解答:a。在pom.xml配置文件中加入占位符
如:            
                135.224.82.4
                ls
                FdbEgT+7
                /data/jyf/0000/SRC/
      b。在resources目录下新建文本文件ftp.properties
ftp.url=${ftp.url}
ftp.username=${ftp.username}
ftp.password=${ftp.password}
ftp.path=${ftp.path}
      c。在引用的applicationContext文件节点propertyConfigurer中添加classpath:ftp.properties
      d。这时就可以直接使用占位符了
如:   
        
               
               
               
               
        
        
3。测试Dao时报如下错误该怎么解决?
Unsatisfied dependency expressed through bean property 'interfaceDataDefineDao': Set this property value or disable dependency checking for this bean
解答:解决方法1:测试初始化没有自动加载webapp/WEB-INF/applicationContext.xml文件,把该文件复制到target\classes\目录下即可。
      解决方法2:修改build path将src/main/webapp的out put folder修改成default output folder(实际是target/classes),此方法实际是将webapp里的文件都复制到target/classes里,使得测试过程可以访问到applicationContext.xml文件。
4。怎样解决测试报“Embedded error: java.sql.SQLException: ORA-01401: 插入的值对于列过大”错误?
解答:检查hmb2ddl生成的数据表字段的实际类型及大小,再跟test/resources/samples-data.xml里对应的表的测试数据比较,检查是否跟实际数据库表中数据类型不匹配。有时appfuse自动产生的测试数据过大造成的,修改测试数据即可。
5。怎样使用本地mvean_proxy?
解答:本地运行java -jar maven-proxy-standalone-0.2-app maven-proxy.properties,然后在pom.xml库中修改配置
               
                        central
                        xjgzinfo Central Repository
                        http://135.224.80.12:9999/repository
                        
                                true
                        
                        
                                true
                        
               
               
                        appfuse
                        http://static.appfuse.org/repository
               
               
                        Maven2
                        http://repo1.maven.org/maven2
               
               
               
                        java.net
                        http://download.java.net/maven/1/
                        legacy
               
        
        
               
                        central
                        xjgzinfo Central Repository
                        http://135.224.80.12:9999/repository
               
               
                        appfuse
                        http://static.appfuse.org/repository
               
        
6。怎样向菜单上添加子菜单,及关联事件处理代码?
解答:a.首先在ApplicationResources.properties资源配置文件中添加变量
例如:# -- auditReport day tast page --
auditReportDayTask.execute=AuditReport Task Run
auditReportDayTask.executed=AuditReport has been runned successfully.
# -- AuditReport-END
      b.向AuditReportForm.java文件中添加事件响应代码
例如:    public String auditDay() {
            auditReportManager.autoAuditDay();
            addMessage("auditReportDayTask.executed");
            
            return "mainMenu";
    }
      c.在mainMenu.xhtml文件中添加commandLink
例如:
7。怎样向Mvean中installing 3rd party JARs?
解答:To install a JAR in the local repository use the following command:
mvn install:install-file -Dfile= -DgroupId= \
    -DartifactId= -Dversion= -Dpackaging=
例如:mvn install:install-file -Dfile=quartz-1.6.0.jar -DgroupId=quartz -DartifactId=quartz -Dversion=1.6.0 -Dpackaging=jar
8。怎样在pom.xml中配置3rd party JARs,使得mvn integration-test集成测试后打包成war文件?
解答:向dependency中添加依赖,通过第7步的安装就可以从本地库中引用第三方jar文件了。
例如:        
                      quartz   
                      quartz
                      ${quartz.version}  
                      compile
              
                ...
               1.6.0


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/11409/showart_571743.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP