源碼編譯Roller4.0.1
所用的eclipse3.4,需要安裝tomcat插件:
http://www.eclipsetotale.com/tomcatPlugin.html#A3
下載了tomcatPluginV321.zip
使用 -clean方式啟動, tomcat用5.5.23版本
安裝了插件,看到有tomcat的選項(xiàng)。但是如何部署Roller?見:
http://blog.csdn.net/luweifeng1983/archive/2008/12/23/3590726.aspx
源碼編譯:除了
apps中的 planet、webblogger中的src,components中core的src,
還需要webblogger中的web中的頁面(在其他幾個中間也有Web目錄,暫時沒有用到,就不復(fù)制過來了)
將installation.type設(shè)置成auto,創(chuàng)建數(shù)據(jù)庫表的時候說找不到創(chuàng)建數(shù)據(jù)庫腳本:
創(chuàng)建數(shù)據(jù)庫的腳本,在WEB-INF中,classes目錄下,分別有幾個目錄各自不同作用:
數(shù)據(jù)庫腳本
模板等
數(shù)據(jù)庫:使用MySQL數(shù)據(jù)庫
腳本是在:WEB-INF/classes/dbscripts/mysql 中,系統(tǒng)調(diào)用 cretaedb.sql, 源碼中沒有這個文件,需要從執(zhí)行包中復(fù)制過來
(2009-11-26 : Roller使用的是openjpa進(jìn)行的orm,數(shù)據(jù)庫創(chuàng)建的腳本,可以采用 openjpa提供的MappingTool,從源碼中生成出來 --- org.apache.openjpa.jdbc.meta.MappingTool -sql createdb.sql )
用Elipse發(fā)布到tomcat,運(yùn)行時發(fā)生以下問題:
問題:
java.lang.RuntimeException: <0.9.7-incubating fatal user error> org.apache.openjpa.persistence.ArgumentException: The type "class org.apache.roller.weblogger.pojos.TaskLock" has not been enhanced.
at org.apache.roller.weblogger.business.jpa.JPAPropertiesManagerImpl.initialize(JPAPropertiesManagerImpl.java:92)
at org.apache.roller.weblogger.business.WebloggerImpl.initialize(WebloggerImpl.java:301)
at org.apache.roller.weblogger.ui.core.RollerContext.contextInitialized(RollerContext.java:159)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
找了些資料,沒有搞清楚怎么回事,但是可以解決:
見: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?
把自己編譯出來的Roller classes文件(在WEB-INF/classes/中)都打包在一起(其實(shí)就是把Roller自己發(fā)布的4個Jar文件合并在一起了),放在lib中,運(yùn)行正常,可以看到創(chuàng)建用戶的界面了