日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

roller在eclipse中的部署

發(fā)布時(shí)間:2024/9/5 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 roller在eclipse中的部署 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

  最近在myeclipse中部署了ROLLER4.0.1

  環(huán)境配置:JDK 1.5.0_15,Tomcat 6.0.26,eclipse 3.4.1+Myeclipse 7.0.1

  下載Roller的時(shí)候最好下載2個(gè)包,apache-roller-src-4.0.1.zip這個(gè)是源碼包,apache-roller-4.0.1.zip這個(gè)是Roller的發(fā)布包。用2個(gè)包的原因是源碼包中有些源碼在myeclipse中編譯的時(shí)候會(huì)有問(wèn)題。

  新建一個(gè)Web項(xiàng)目,命名roller

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

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

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

  roller默認(rèn)使用mysql數(shù)據(jù)庫(kù),lib中缺少mysql的jdbc驅(qū)動(dòng),從網(wǎng)上下載mysql-connector-java-5.1.7-bin.jar(最新版本可以到官方網(wǎng)站下載),放入lib文件夾下。

  從bin中復(fù)制除了WEB-INF以外所有文件到項(xiàng)目的WebRoot下

  復(fù)制bin中WEB-INF下面的除了classes外的所有文件到我們項(xiàng)目的WEB-INF下

  復(fù)制bin中WEB-INF/classes下面復(fù)制除了org目錄外的所有文件到我們項(xiàng)目的src下面

  從網(wǎng)上下載activation.jarmail.jar放到tomcatcommon/lib目錄下

?

  新建一個(gè)roller-custom.properties,放到項(xiàng)目的src下面,內(nèi)容為:

  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后面帶上參數(shù)utf8不然亂碼可能會(huì)。還有installation.type=auto是在剛開(kāi)始的時(shí)候數(shù)據(jù)庫(kù)沒(méi)有表格的情況下設(shè)定,如果數(shù)據(jù)庫(kù)中已經(jīng)建立所有表格的話請(qǐng)修改installation.type=manual.

  

  在項(xiàng)目的WebRoot/META-INF下面新建context.xml,內(nèi)容為:

<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>

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

?

  創(chuàng)建數(shù)據(jù)庫(kù):

  create database?rollerdb default charset utf8;

  

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

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

  刪除pojos包是因?yàn)檫@個(gè)包在eclipse編譯的時(shí)候有問(wèn)題,詳細(xì)請(qǐng)看下面:

  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?
  •   如果不刪除這個(gè)pojos包,啟動(dòng)報(bào)錯(cuò),The type "class org.apache.roller.weblogger.pojos.TaskLock" has not been enhanced.

      

    所有準(zhǔn)備工作做好的話啟動(dòng)應(yīng)該沒(méi)問(wèn)題,如果開(kāi)始的時(shí)候沒(méi)有數(shù)據(jù)庫(kù)表格,啟動(dòng)會(huì)提示創(chuàng)建表格,一路下去就能進(jìn)入歡迎界面。

    轉(zhuǎn)載于:https://www.cnblogs.com/wattone/archive/2010/04/07/1706184.html

    總結(jié)

    以上是生活随笔為你收集整理的roller在eclipse中的部署的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

    如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。