日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

roller在eclipse中的部署

發布時間:2024/9/5 53 豆豆
生活随笔 收集整理的這篇文章主要介紹了 roller在eclipse中的部署 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

  最近在myeclipse中部署了ROLLER4.0.1

  環境配置:JDK 1.5.0_15,Tomcat 6.0.26,eclipse 3.4.1+Myeclipse 7.0.1

  下載Roller的時候最好下載2個包,apache-roller-src-4.0.1.zip這個是源碼包,apache-roller-4.0.1.zip這個是Roller的發布包。用2個包的原因是源碼包中有些源碼在myeclipse中編譯的時候會有問題。

  新建一個Web項目,命名roller

  解壓apache-roller-src-4.0.1.zip(src)和apache-roller-4.0.1.zip(bin).

  把解壓的源碼包(src)apps/weblogger/src/java目錄整個復制到src里面;

  添加jar文件到lib,源碼包里面tools下面有全部的包,不過很分散,比較省力的方法是從bin下面的WEB-INF/lib下面所有的jar文件復制到項目的lib文件夾下;

  roller默認使用mysql數據庫,lib中缺少mysql的jdbc驅動,從網上下載mysql-connector-java-5.1.7-bin.jar(最新版本可以到官方網站下載),放入lib文件夾下。

  從bin中復制除了WEB-INF以外所有文件到項目的WebRoot下

  復制bin中WEB-INF下面的除了classes外的所有文件到我們項目的WEB-INF下

  復制bin中WEB-INF/classes下面復制除了org目錄外的所有文件到我們項目的src下面

  從網上下載activation.jarmail.jar放到tomcatcommon/lib目錄下

?

  新建一個roller-custom.properties,放到項目的src下面,內容為:

  database.configurationType=jndi
  installation.type=auto

  jdbc.driverClass=com.mysql.jdbc.Driver
  jdbc.connectionURL=jdbc:mysql://localhost:3306/rollerdb?autoReconnect=true&useUnicode=true&characterEncoding=

  utf-8&mysqlEncoding=utf8
  jdbc.username=root
  jdbc.password=root

  注意:jdbc.connectionURL后面帶上參數utf8不然亂碼可能會。還有installation.type=auto是在剛開始的時候數據庫沒有表格的情況下設定,如果數據庫中已經建立所有表格的話請修改installation.type=manual.

  

  在項目的WebRoot/META-INF下面新建context.xml,內容為:

<Context path="/roller"
??? docBase="D:/work/roller/WebRoot" debug="0">

? <Resource name="jdbc/rollerdb" auth="Container" type="javax.sql.DataSource"
??? driverClassName="com.mysql.jdbc.Driver"
??? url="jdbc:mysql://localhost:3306/rollerdb?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf-8&amp;mysqlEncoding=utf8"
??? username="root"
??? password="root"
??? maxActive="20" maxIdle="3" removeAbandoned="true" maxWait="3000" />

? <Resource name="mail/Session" auth="Container" type="javax.mail.Session"
???? mail.smtp.host="smtp-server.example.com" />

</Context>

這個用于程序需要使用的數據源,舊版本的tomcat需要在%tomcat%/conf/server.xml中修改

?

  創建數據庫:

  create database?rollerdb default charset utf8;

  

  接下來比較變態的修改,刪除lib下面的roller-web.jar,刪除src/org/apache/roller/weblogger/下面的pojos文件夾。

  roller-business.jarroller-web.jar這二個jar其實就是我們src中的所有java文 件的編譯打包,為了不重復,先把roller-web.jar刪除掉.

  刪除pojos包是因為這個包在eclipse編譯的時候有問題,詳細請看下面:

  http://old.nabble.com/Class-has-not-been-%28JPA%29-enhanced--%28was-Re%3A-Daily-report-of-Referrers-%29-td17131123s12275r0.html

?

  • As?I?remember?things,?the?POJOs?in?Roller?are?JPA?"enhanced"?at?build ??
  • time,?which?means?that?we?run?a?special?OpenJPA?Ant?task?against?the ??
  • POJO?classes?and?it?make?some?bytecode?changes?to?the?.class?files. ??
  • ??
  • If?you?are?running?against?the?jars?in?Roller's?WEB-INF/lib?direcory ??
  • then?the?POJO?classes?should?have?the?enhanced?bits?and?I'm?not?sure ??
  • what?would?cause?JPA?to?think?otherwise. ??
  • ??
  • What?version?of?Roller?are?you?using??Are?you?using?a?custom?build?
  •   如果不刪除這個pojos包,啟動報錯,The type "class org.apache.roller.weblogger.pojos.TaskLock" has not been enhanced.

      

    所有準備工作做好的話啟動應該沒問題,如果開始的時候沒有數據庫表格,啟動會提示創建表格,一路下去就能進入歡迎界面。

    轉載于:https://www.cnblogs.com/wattone/archive/2010/04/07/1706184.html

    總結

    以上是生活随笔為你收集整理的roller在eclipse中的部署的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。