在eclipse部署OpenBravo项目
生活随笔
收集整理的這篇文章主要介紹了
在eclipse部署OpenBravo项目
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
前提條件:已經安裝成功了Openbravo ERP。未安裝成功的,請參考[url="http://liwenshui322.iteye.com/blog/1054473"]Openbravo ERP 3.0安裝指南[/url]
Openbravo現在完全可以在eclipse環境下開發,測試,部署,包括4個項目openbravo,core, trl 和wad,在相應目錄下都有eclipse的項目文件,項目可以直接導入到eclipse中。
環境需求
· Java Development Kit (JDK) 6.
· Apache Tomcat 6.x.
· Apache Ant 1.7.
· PostgreSQL 8.3.x.
開發工具
· Eclipse IDE for Java EE Developers.
[color=red]注意[/color]:取消自動編譯功能
導入openbravo到eclipse中,選擇File > Import... > Existing Projects into Workspace
選擇目錄D:\openbravo\OpenbravoERP-3.0RC6.1(即為安裝openbravo文件),接下來依次導入[b]OpenbravoCore[/b],[b]OpenbravoTrl[/b],[b]OpenbravoWAD[/b],分別在目錄src-core, src-trl, src-wad.
設置所有項目的編碼為[b]UTF-8[/b], 以避免亂碼問題。
目前這些項目可能都有編譯錯誤,不用管它,繼續下面的操作。
d:\workspace\openbravo>ant create.database
Buildfile: build.xml
set.code.rev:
code.rev:
init:
core.lib:
init:
compile:
[javac] Compiling 122 source files to D:\workspace\openbravo\src-core\build\
classes
build.jar:
[jar] Building jar: D:\workspace\openbravo\src-core\lib\openbravo-core.jar
build:
copy.core.lib:
[copy] Copying 1 file to D:\workspace\openbravo\lib\runtime
database.lib:
init:
compile:
[javac] Compiling 4 source files to D:\workspace\openbravo\src-db\build\clas
ses
build.jar:
[jar] Building jar: D:\workspace\openbravo\src-db\build\lib\dbmanager.jar
jar:
[copy] Copying 1 file to D:\workspace\openbravo\src-db\database\lib
create.database:
create.database:
clean.database.POSTGRE:
[sql] Executing commands
[sql] Failed to execute: DROP DATABASE openbravo
[sql] org.postgresql.util.PSQLException: ERROR: database "openbravo" does
not exist
[sql] 0 of 1 SQL statements executed successfully
[sql] Executing commands
[sql] Failed to execute: DROP ROLE tad
[sql] org.postgresql.util.PSQLException: ERROR: role "tad" does not exist
[sql] 0 of 1 SQL statements executed successfully
prepare.database:
POSTGRE.structure:
[sql] Executing commands
[sql] 2 of 2 SQL statements executed successfully
[sql] Executing commands
[sql] 1 of 1 SQL statements executed successfully
create.database.all:
Database connection: jdbc:postgresql://localhost:5432/openbravo. User: tad
Executing default prescript
Executed 116 SQL command(s) successfully
Executing creation script
for the complete database
Executed 10739 SQL command(s) successfully
Executed 12 forced SQL command(s) successfully
Executing default postscript
Executed 22 SQL command(s) successfully
Writing checksum info
Inserting data into the database.
Executed 462 SQL command(s) successfully
Executed 2442 SQL command(s) successfully
Executed 74 SQL command(s) successfully
Executed 143 SQL command(s) successfully
Executed 5451 SQL command(s) successfully
Executed 462 SQL command(s) successfully
Executed 2442 SQL command(s) successfully
Executing default postscript
Executed 22 SQL command(s) successfully
database.poststructure.POSTGRE:
database.preimport.POSTGRE:
database.postimport.POSTGRE:
database.postcreate.POSTGRE:
[sql] Executing commands
[sql] 11 of 11 SQL statements executed successfully
update.dbupdate.timestamp:
[sql] Executing commands
[sql] 1 of 1 SQL statements executed successfully
db.apply.modules.sampledata:
BUILD SUCCESSFUL
Total time: 6 minutes 27 seconds
接下來依次進行如下操作:
需要修改class的輸出路徑:openbravo/WebContent/WEB-INF/classes,這樣才能在tomcat server中運行。
選擇項目 Openbravo然后點擊 Run > External Tools > eclipse.trl.lib
在 Console 窗口,確認有BUILD SUCCESSFUL 信息.
選擇項目 Openbravo然后點擊 Run > External Tools > eclipse.wad.lib
在 Console 窗口,確認有BUILD SUCCESSFUL 信息.
選擇項目 Openbravo然后點擊 Run > External Tools > eclipse.compile.complete
在 Console 窗口,確認有BUILD SUCCESSFUL 信息.
點擊 Project > Build Project 菜單進行編譯.
定義 Tomcat server
為了在eclipseIDE中運行OpenBravo,那么需要定義 Tomcat server.
點擊 window > Preferences > Server > Runtime Enviroments > Add > 選擇Apache tomcat 6.0 > 點next >選擇你安裝的tomcat目錄和jre > 選擇Openbravo項目 > 點擊finish。
雙擊打開添加的Tomcat Server > Server Locations一欄選擇“Use custom location”,Server path文本框輸入tomcat,Deploy path文本框輸入webapps > 選中Serve modules without publishing > 設置timeout下start(in seconds)為10000 > ctrl + s保存。
啟動Tomcat server(該操作會持續大幾分鐘,耐心等待。)
選中創建的server,然后點擊 start圖標,或者右鍵 start。
啟動完成后在瀏覽器中輸入:http://localhost:8080/openbravo
用戶名:Openbravo
密碼:openbravo
[size=large][color=red]需要注意的地方:[/color][/size]
1、eclipse報錯:java.lang.OutOfMemoryError: PermGen space
解決辦法:修改了安裝目錄eclipse.ini文件,在最后面增加了兩行
-XX:PermSize=128M
-XX:MaxPermSize=128M
2、eclipse下啟動tomcat報錯:java.lang.OutOfMemoryError: PermGen space
解決辦法:單擊run -> run configurations...,選擇配置的tomcat,在Arguments選項卡的 VM argument框最前面加上:-Xms256m -Xmx512m -XX:PermSize=128M -XX:MaxPermSize=1024m。如下圖:
[img]http://dl.iteye.com/upload/attachment/0074/0219/c7d95d8e-9784-3754-b0af-b5e6db45fcd2.jpg[/img]
如遇到其他問題,歡迎交流:493029699。
Openbravo現在完全可以在eclipse環境下開發,測試,部署,包括4個項目openbravo,core, trl 和wad,在相應目錄下都有eclipse的項目文件,項目可以直接導入到eclipse中。
環境需求
· Java Development Kit (JDK) 6.
· Apache Tomcat 6.x.
· Apache Ant 1.7.
· PostgreSQL 8.3.x.
開發工具
· Eclipse IDE for Java EE Developers.
[color=red]注意[/color]:取消自動編譯功能
導入openbravo到eclipse中,選擇File > Import... > Existing Projects into Workspace
選擇目錄D:\openbravo\OpenbravoERP-3.0RC6.1(即為安裝openbravo文件),接下來依次導入[b]OpenbravoCore[/b],[b]OpenbravoTrl[/b],[b]OpenbravoWAD[/b],分別在目錄src-core, src-trl, src-wad.
設置所有項目的編碼為[b]UTF-8[/b], 以避免亂碼問題。
目前這些項目可能都有編譯錯誤,不用管它,繼續下面的操作。
d:\workspace\openbravo>ant create.database
Buildfile: build.xml
set.code.rev:
code.rev:
init:
core.lib:
init:
compile:
[javac] Compiling 122 source files to D:\workspace\openbravo\src-core\build\
classes
build.jar:
[jar] Building jar: D:\workspace\openbravo\src-core\lib\openbravo-core.jar
build:
copy.core.lib:
[copy] Copying 1 file to D:\workspace\openbravo\lib\runtime
database.lib:
init:
compile:
[javac] Compiling 4 source files to D:\workspace\openbravo\src-db\build\clas
ses
build.jar:
[jar] Building jar: D:\workspace\openbravo\src-db\build\lib\dbmanager.jar
jar:
[copy] Copying 1 file to D:\workspace\openbravo\src-db\database\lib
create.database:
create.database:
clean.database.POSTGRE:
[sql] Executing commands
[sql] Failed to execute: DROP DATABASE openbravo
[sql] org.postgresql.util.PSQLException: ERROR: database "openbravo" does
not exist
[sql] 0 of 1 SQL statements executed successfully
[sql] Executing commands
[sql] Failed to execute: DROP ROLE tad
[sql] org.postgresql.util.PSQLException: ERROR: role "tad" does not exist
[sql] 0 of 1 SQL statements executed successfully
prepare.database:
POSTGRE.structure:
[sql] Executing commands
[sql] 2 of 2 SQL statements executed successfully
[sql] Executing commands
[sql] 1 of 1 SQL statements executed successfully
create.database.all:
Database connection: jdbc:postgresql://localhost:5432/openbravo. User: tad
Executing default prescript
Executed 116 SQL command(s) successfully
Executing creation script
for the complete database
Executed 10739 SQL command(s) successfully
Executed 12 forced SQL command(s) successfully
Executing default postscript
Executed 22 SQL command(s) successfully
Writing checksum info
Inserting data into the database.
Executed 462 SQL command(s) successfully
Executed 2442 SQL command(s) successfully
Executed 74 SQL command(s) successfully
Executed 143 SQL command(s) successfully
Executed 5451 SQL command(s) successfully
Executed 462 SQL command(s) successfully
Executed 2442 SQL command(s) successfully
Executing default postscript
Executed 22 SQL command(s) successfully
database.poststructure.POSTGRE:
database.preimport.POSTGRE:
database.postimport.POSTGRE:
database.postcreate.POSTGRE:
[sql] Executing commands
[sql] 11 of 11 SQL statements executed successfully
update.dbupdate.timestamp:
[sql] Executing commands
[sql] 1 of 1 SQL statements executed successfully
db.apply.modules.sampledata:
BUILD SUCCESSFUL
Total time: 6 minutes 27 seconds
接下來依次進行如下操作:
需要修改class的輸出路徑:openbravo/WebContent/WEB-INF/classes,這樣才能在tomcat server中運行。
選擇項目 Openbravo然后點擊 Run > External Tools > eclipse.trl.lib
在 Console 窗口,確認有BUILD SUCCESSFUL 信息.
選擇項目 Openbravo然后點擊 Run > External Tools > eclipse.wad.lib
在 Console 窗口,確認有BUILD SUCCESSFUL 信息.
選擇項目 Openbravo然后點擊 Run > External Tools > eclipse.compile.complete
在 Console 窗口,確認有BUILD SUCCESSFUL 信息.
點擊 Project > Build Project 菜單進行編譯.
定義 Tomcat server
為了在eclipseIDE中運行OpenBravo,那么需要定義 Tomcat server.
點擊 window > Preferences > Server > Runtime Enviroments > Add > 選擇Apache tomcat 6.0 > 點next >選擇你安裝的tomcat目錄和jre > 選擇Openbravo項目 > 點擊finish。
雙擊打開添加的Tomcat Server > Server Locations一欄選擇“Use custom location”,Server path文本框輸入tomcat,Deploy path文本框輸入webapps > 選中Serve modules without publishing > 設置timeout下start(in seconds)為10000 > ctrl + s保存。
啟動Tomcat server(該操作會持續大幾分鐘,耐心等待。)
選中創建的server,然后點擊 start圖標,或者右鍵 start。
啟動完成后在瀏覽器中輸入:http://localhost:8080/openbravo
用戶名:Openbravo
密碼:openbravo
[size=large][color=red]需要注意的地方:[/color][/size]
1、eclipse報錯:java.lang.OutOfMemoryError: PermGen space
解決辦法:修改了安裝目錄eclipse.ini文件,在最后面增加了兩行
-XX:PermSize=128M
-XX:MaxPermSize=128M
2、eclipse下啟動tomcat報錯:java.lang.OutOfMemoryError: PermGen space
解決辦法:單擊run -> run configurations...,選擇配置的tomcat,在Arguments選項卡的 VM argument框最前面加上:-Xms256m -Xmx512m -XX:PermSize=128M -XX:MaxPermSize=1024m。如下圖:
[img]http://dl.iteye.com/upload/attachment/0074/0219/c7d95d8e-9784-3754-b0af-b5e6db45fcd2.jpg[/img]
如遇到其他問題,歡迎交流:493029699。
總結
以上是生活随笔為你收集整理的在eclipse部署OpenBravo项目的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: docker build -t myip
- 下一篇: wget php mirror 地址,使