<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    openfans快速配置指南

    應(yīng)牛牛和 lucky 的要求,寫一份 openfans 的快速配置指南,也就是介紹如何在你的機器上把下載下來的 openfans 跑起來。首先使用 maven ,需要下載 maven www.openfans.net 里可以輸入 maven 進行搜索,有它的介紹和主頁,還有我寫的一篇簡單的 maven 上手文章。

    如果使用 eclipse ,在項目根目錄,也就是 pom.xml 所在目錄,運行 mvn eclipse:eclipse( 如初次使用,會花較長時間到網(wǎng)上下載 plugin jar ,建議去喝杯咖啡 ) mvn eclipse:eclipse 會生成 .class .project 文件,可以進入項目的 build path 查看,會自動將 output 路徑設(shè)為 target/classes 。默認(rèn)數(shù)據(jù)庫使用 mysql ,如果希望馬上運行,則創(chuàng)建一個新數(shù)據(jù)庫,可以命名為 openfans ,如果 mysql 采用默認(rèn)安裝,則用戶名 root ,密碼為空,可以無需更改 jdbc 配置文件。要更改也很簡單,在 main/src 下面有一個 jdbc.properties 文件,可以在這里更改數(shù)據(jù)庫類型和用戶名密碼。這里有一句 hibernate.hbm2ddl.auto=update ,表示 hibernate 會自動更新建表語句,也就是新運行或更新了 hbm 文件再運行, hibernate 都會自動幫你完成數(shù)據(jù)表的重建工作,這樣你可以不用再考慮數(shù)據(jù)庫建表腳本了。

    如果想在 tomcat 里直接運行,則可以執(zhí)行 mvn package ,會運行所有 test case 。目前的 test case 通過繼承 AbstractTransactionalDataSourceSpringContextTests ,能夠方便的實現(xiàn)數(shù)據(jù)庫回滾,在 BaseTest 類下有一句 this.setDefaultRollback(false) ,如果希望通過程序填充數(shù)據(jù),就 uncomment 它。這里有一個地方要注意一下,就是 web/WEB-INF/urlrewrite.xml ,這是 urlrewrite 的配置文件, urlrewrite 的描述在 openfans 網(wǎng)站里有,可以通過搜索 urlrewrite 快速的找到。因為我把文檔根設(shè)為“ / ”,所以有 <to type="redirect">/view$1.html\?id=$2</to> ,如果文檔根是 openfans 則需在 /view 前加上 /openfans ,然后再運行 mvn package 。測試全部通過,就會在 target 目錄下生成 openfans-o.1.war ,將這個 war 放到 tomcat webapps 下,啟動 tomcat ,應(yīng)該就能通過 http://localhost:8080/openfans 訪問了(假定你采用默認(rèn)端口 8080 )。

    如果進行開發(fā),可以安裝 eclipse-tomcat 插件,插件也可以在 openfans 網(wǎng)站輸入 tomcat 進行搜索。可以在 tomcat conf/Catalina/localhost 下創(chuàng)建一個 openfans.xml ,內(nèi)容如下:

    <?xml version="1.0" encoding="UTF-8"?>

    <Context path="/openfans" reloadable="true" docBase="D:/javaproject/openfans/web">

    </Context>

    docBase 改成你的 openfans 所在的路徑。
    ???這里因為pom文件定義的默認(rèn)輸出位置為target,需改為web-inf/classes,這時會有一個src沖突,需把src/web/里的web-inf/classes exclude掉就可以了。
    然后在
    eclipse 啟動 tomcat ,同樣可以通過 http://localhost:8080/openfans 訪問了。用這種方式啟動 tomcat 可以進行調(diào)試。

    ?

    posted on 2006-04-01 21:05 pesome 閱讀(3542) 評論(11)  編輯  收藏 所屬分類: 開源軟件

    評論

    # re: openfans快速配置指南 2006-04-11 17:49 莫多

    mvn eclipse:eclipse就不能通過。
    D:\Project\openfans>mvn eclipse:eclipse
    [INFO] Scanning for projects...
    [INFO] Searching repository for plugin with prefix: 'eclipse'.
    [INFO] -------------------------------------------------------------------------
    ---
    [INFO] Building openfans
    [INFO] task-segment: [eclipse:eclipse]
    [INFO] -------------------------------------------------------------------------
    ---
    [INFO] Preparing eclipse:eclipse
    [INFO] [resources:resources]
    [INFO] Using default encoding to copy filtered resources.
    [WARNING]
    Artifact javax.servlet:jstl:jar:1.1.2:runtime retains local scope 'runti
    me' overriding broader scope 'compile'
    given by a dependency. If this is not intended, modify or remove the loc
    al scope.

    [WARNING]
    Artifact jdom:jdom:jar:1.0:runtime retains local scope 'runtime' overrid
    ing broader scope 'compile'
    given by a dependency. If this is not intended, modify or remove the loc
    al scope.

    [WARNING]
    Artifact taglibs:standard:jar:1.1.2:runtime retains local scope 'runtime
    ' overriding broader scope 'compile'
    given by a dependency. If this is not intended, modify or remove the loc
    al scope.

    [INFO] [compiler:compile]
    [INFO] Nothing to compile - all classes are up to date
    [INFO] [eclipse:eclipse]
    [WARNING] This plugin currently doesn't support include patterns for resources.
    Adding the entire directory.
    [WARNING] This plugin currently doesn't support include patterns for resources.
    Adding the entire directory.
    [INFO] Not writing settings - defaults suffice
    [INFO]
    Sources for some artifacts are not available.
    Please run "mvn -Declipse.downloadSources=true eclipse:eclipse" in order
    to check remote repositories for sources.
    List of artifacts without a source archive:
    o org.springframework:spring-mock:jar:1.2.6
    o junit:junit:jar:3.8.1
    o commons-logging:commons-logging:jar:1.0.4
    o javax.servlet:servlet-api:jar:2.4
    o commons-digester:commons-digester:jar:1.5
    o geronimo-spec:geronimo-spec-jta:jar:1.0.1B-rc4
    o uk.ltd.getahead:dwr:jar:1.0
    o org.springframework:spring:jar:1.2.6
    o opensymphony:sitemesh:jar:2.2.1
    o com.lowagie:itext:jar:0.99
    o commons-validator:commons-validator:jar:1.1.3
    o javax.servlet:jstl:jar:1.1.2
    o asm:asm:jar:1.5.3
    o commons-dbcp:commons-dbcp:jar:1.2.1
    o jdom:jdom:jar:1.0
    o taglibs:standard:jar:1.1.2
    o oro:oro:jar:2.0.8
    o antlr:antlr:jar:2.7.6rc1
    o commons-beanutils:commons-beanutils:jar:1.6.1
    o commons-io:commons-io:jar:1.1
    o org.tuckey:urlrewrite:jar:2.5.2
    o xerces:xercesImpl:jar:2.0.2
    o p6spy:p6spy:jar:1.3
    o rome:rome:jar:0.8
    o commons-fileupload:commons-fileupload:jar:1.1
    o mysql:mysql-connector-java:jar:3.1.11
    o org.hibernate:hibernate:jar:3.1
    o displaytag:displaytag:jar:1.0
    o dom4j:dom4j:jar:1.6
    o cglib:cglib:jar:2.1_3
    o ehcache:ehcache:jar:1.1
    o commons-lang:commons-lang:jar:2.0
    o commons-collections:commons-collections:jar:2.1.1
    o springmodules:springmodules-validator:jar:0.1
    o log4j:log4j:jar:1.2.11
    o xml-apis:xml-apis:jar:1.0.b2
    o commons-pool:commons-pool:jar:1.2

    [INFO] Wrote Eclipse project for "openfans" to D:\Project\openfans.
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESSFUL
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 8 seconds
    [INFO] Finished at: Tue Apr 11 17:43:11 GMT+08:00 2006
    [INFO] Final Memory: 4M/8M
    [INFO] ------------------------------------------------------------------------
      回復(fù)  更多評論   

    # re: openfans快速配置指南 2006-04-11 17:50 莫多

    然后按照上面說的。運行mvn -Declipse.downloadSources=true eclipse:eclipse
    又抱錯誤找不到。
    [INFO] [compiler:compile]
    [INFO] Nothing to compile - all classes are up to date
    [INFO] [eclipse:eclipse]
    [WARNING] This plugin currently doesn't support include patterns for resources.
    Adding the entire directory.
    [WARNING] This plugin currently doesn't support include patterns for resources.
    Adding the entire directory.
    Downloading: http://www.ibiblio.org/maven2/org/springframework/spring-mock/1.2.6
    /spring-mock-1.2.6-sources.jar
    [WARNING] Unable to get resource from repository central (http://www.ibiblio.org
    /maven2)
    Downloading: http://www.openfans.org:81/maven2/org/springframework/spring-mock/1
    .2.6/spring-mock-1.2.6-sources.jar
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Failed to resolve artifact.

    Error transferring file
    org.springframework:spring-mock:java-source:1.2.6

    from the specified remote repositories:
    central (http://www.ibiblio.org/maven2),
    openfans (http://www.openfans.org:81/maven2)


    Caused by I/O exception: Connection refused: connect

    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 10 seconds
    [INFO] Finished at: Tue Apr 11 17:45:56 GMT+08:00 2006
    [INFO] Final Memory: 4M/8M
    [INFO] ------------------------------------------------------------------------  回復(fù)  更多評論   

    # re: openfans快速配置指南 2006-04-11 19:09 pesom

    warning沒有太多關(guān)系,都報BUILD SUCCESSFUL 了,呵呵!
    mvn -Declipse.downloadSources=true eclipse:eclipse作用是將遠(yuǎn)程的src下載到本地的repo中,同時自動幫你在項目中加載這些src,讓你可以直接在eclipse中查看源文件,而不用去自己綁定src。
    Caused by I/O exception: Connection refused: connect 這種情況經(jīng)常會碰到,可能是jar較大,導(dǎo)致的網(wǎng)絡(luò)問題,可以重試。  回復(fù)  更多評論   

    # re: openfans快速配置指南 2006-12-18 19:18 wujianrong

    我使用mvn package的時候出錯;煩請給我發(fā)一份openfans的源碼到citycn@gmail.com,謝謝!  回復(fù)  更多評論   

    # re: openfans快速配置指南 2006-12-18 19:23 pesome

    源碼就在sf上的啊,我現(xiàn)在也沒有最新的了  回復(fù)  更多評論   

    # re: openfans快速配置指南[未登錄] 2007-02-09 10:51 rose

    I:\openfans>mvn package
    [INFO] Scanning for projects...
    [INFO] ----------------------------------------------------------------------------
    [INFO] Building openfans
    [INFO] task-segment: [package]
    [INFO] ----------------------------------------------------------------------------
    [INFO] [resources:resources]
    [INFO] Using default encoding to copy filtered resources.
    [WARNING]
    Artifact javax.servlet:jstl:jar:1.1.2:runtime retains local scope 'runtime' overriding broa
    er scope 'compile'
    given by a dependency. If this is not intended, modify or remove the local scope.

    [WARNING]
    Artifact taglibs:standard:jar:1.1.2:runtime retains local scope 'runtime' overriding broade
    scope 'compile'
    given by a dependency. If this is not intended, modify or remove the local scope.

    [INFO] [compiler:compile]
    Compiling 68 source files to I:\openfans\target\classes
    [INFO] [resources:testResources]
    [INFO] Using default encoding to copy filtered resources.
    [INFO] [compiler:testCompile]
    Compiling 7 source files to I:\openfans\target\test-classes
    [INFO] [surefire:test]
    [INFO] Surefire report directory: I:\openfans\target\surefire-reports

    -------------------------------------------------------
    T E S T S
    -------------------------------------------------------
    Running org.openfans.feed.FeedManagerTest
    2007-02-09 10:48:06234 INFO - AbstractSpringContextTests.loadContextLocations(119) | Loading config
    for: /WEB-INF/applicationContext*.xml
    Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.375 sec <<< FAILURE!
    Running org.openfans.domain.TagRelTest
    Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.141 sec <<< FAILURE!
    Running org.openfans.domain.GroupTest
    Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.141 sec <<< FAILURE!
    Running org.openfans.domain.TagTest
    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
    Running org.openfans.domain.FacadeTest
    Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.281 sec <<< FAILURE!

    Results :
    Tests run: 10, Failures: 0, Errors: 9, Skipped: 0

    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] There are test failures.
    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 5 seconds
    [INFO] Finished at: Fri Feb 09 10:48:07 CST 2007
    [INFO] Final Memory: 5M/17M
    [INFO] ------------------------------------------------------------------------


    無法成功打包哦。。

    搞了N 次了。。  回復(fù)  更多評論   

    # re: openfans快速配置指南 2007-02-09 11:20 pesome

    現(xiàn)在新的源碼已經(jīng)放到googlecode上了,wiki里有新的介紹。這里需使用mvn package -Dtest,不做test。主要是測試沒寫好,呵呵,抱歉!  回復(fù)  更多評論   

    # re: openfans快速配置指南 2007-02-09 11:20 pesome

    忘了,http://code.google.com/p/openfans2  回復(fù)  更多評論   

    # re: openfans快速配置指南 2007-06-15 14:29 飛影

    我的報下面這個錯誤:

    [INFO] Scanning for projects...
    [INFO] ----------------------------------------------------------------------------
    [INFO] Building openfans
    [INFO] task-segment: [package]
    [INFO] ----------------------------------------------------------------------------
    Downloading: http://repo1.maven.org/maven2/org/mortbay/jetty/org.mortbay.jetty/5.1.10/org.mortbay.jetty-5.1.10.pom
    [INFO] [aspectj:compile {execution: default}]
    [INFO] [resources:resources]
    [INFO] Using default encoding to copy filtered resources.
    [INFO] [compiler:compile]
    [INFO] Compiling 4 source files to D:\IDE\Workspace\openfans2\target\classes
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Compilation failure

    D:\IDE\Workspace\openfans2\main\src\org\openfans\web\ArticleFormController.java:[53,36] 未結(jié)束的字符串字面值

    D:\IDE\Workspace\openfans2\main\src\org\openfans\feed\FeedRetriever.java:[129,35] 未結(jié)束的字符串字面值

    D:\IDE\Workspace\openfans2\main\src\org\openfans\feed\FeedRetriever.java:[131,35] 未結(jié)束的字符串字面值

    D:\IDE\Workspace\openfans2\main\src\org\openfans\web\FeedBackFormController.java:[37,19] 未結(jié)束的字符串字面值

    D:\IDE\Workspace\openfans2\main\src\org\openfans\feed\FeedManager.java:[84,50] 未結(jié)束的字符串字面值


    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 4 seconds
    [INFO] Finished at: Fri Jun 15 14:22:35 CST 2007
    [INFO] Final Memory: 6M/11M
    [INFO] ------------------------------------------------------------------------
      回復(fù)  更多評論   

    # re: openfans快速配置指南 2008-12-12 17:26 為啥真么不規(guī)范呢

    我和飛影報的錯誤一樣,我使用的是netbeans6.1,用的JDK是6.2  回復(fù)  更多評論   

    # re: openfans快速配置指南 2008-12-12 18:00 為啥真么不規(guī)范呢

    編碼格式很混亂啊,一會UTF-8,一會GBK。  回復(fù)  更多評論   

    <2006年4月>
    2627282930311
    2345678
    9101112131415
    16171819202122
    23242526272829
    30123456

    導(dǎo)航

    統(tǒng)計

    公告

    主要記錄作者在學(xué)習(xí)java中的每一步足跡。除非特別說明,所有文章均為本blog作者原創(chuàng),如需轉(zhuǎn)載請注明出處和原作者,如用于商業(yè)目的,需跟作者本人聯(lián)系。
    歡迎大家訪問:

    常用鏈接

    留言簿(16)

    隨筆分類

    隨筆檔案

    文章分類

    文章檔案

    相冊

    收藏夾

    java技術(shù)

    人間百態(tài)

    朋友們的blog

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 国产精品1024永久免费视频| 亚洲成熟丰满熟妇高潮XXXXX| 丝袜捆绑调教视频免费区| 四虎永久成人免费| 人人狠狠综合久久亚洲| 国产青草视频免费观看97| 亚洲精品无码av中文字幕| 免费无码又爽又高潮视频| 亚洲AV无码国产剧情| 国产成人免费高清在线观看| 亚洲а∨精品天堂在线| 国产公开免费人成视频| 四虎国产精品成人免费久久| JLZZJLZZ亚洲乱熟无码| aaa毛片免费观看| 无码乱人伦一区二区亚洲一 | 白白色免费在线视频| 国产大片91精品免费观看男同| 男男gvh肉在线观看免费| 亚洲精品视频久久久| 光棍天堂免费手机观看在线观看| 亚洲av不卡一区二区三区| 67194熟妇在线永久免费观看 | 免费观看的毛片手机视频| 羞羞视频免费网站含羞草| 亚洲中文字幕不卡无码| 99在线观看精品免费99| 亚洲色无码专区一区| 国产亚洲精品无码专区 | 国产乱码免费卡1卡二卡3卡| 亚洲国产AV无码一区二区三区| www亚洲一级视频com| 在线成人精品国产区免费| 亚洲国产美女精品久久久久| 青青草国产免费久久久91| 精品国产污污免费网站入口在线| 亚洲国产精品久久久久婷婷软件| 无码视频免费一区二三区| jizz免费观看| 亚洲天堂男人影院| 亚洲人成无码网WWW|