用友財務共享系統開發環境配置
一、問題出現
這裏在集成開發工具Eclipse中配置好NCHome、數據源、IP及端口。新建業務組件項目後,右鍵項目選中Debug As下UAP中間件,單擊啓動中間件成功,控制檯輸出信息如下:
一月 26, 2018 12:04:30 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-127.0.0.1-8035"]
一月 26, 2018 12:04:31 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service bright
一月 26, 2018 12:04:31 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: UAP Server
一月 26, 2018 12:04:34 下午 org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
信息: No global web.xml found
ESA Server starting
- Loading XML bean definitions from class path resource [nc/md/persist/manager/cache//nc/md/persist/manager/cacheconfig_md.xml]
- Loading XML bean definitions from class path resource [nc/mddb/manager/cache/cacheconfig_md.xml]
- Loading XML bean definitions from class path resource [nc/md/persist/manager/cache//nc/md/persist/manager/cacheconfig_md.xml]
NTBService6.3 started.~~~~~~
ESA Server started: 124605
一月 26, 2018 12:07:10 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-127.0.0.1-8035"]
一月 26, 2018 12:07:10 下午 org.apache.tomcat.granite.BrightTomcat start
信息: Server startup in 161695 ms
打開瀏覽器輸入"ip:port/portal"登入系統,報錯信息如下:
圖 1-1、訪問系統報錯頁面圖
二、問題解決
1、Debug Configuration 設置
右鍵項目選中Debug As下單擊打開Debug Configuration
圖 2-1、選中 Debug Configuration 圖
配置環境啓動參數
圖 2-2、Debug Configuration 配置參數 VM arguments 圖
如上圖所示修改項目的環境啓動參數,選中UAP應用下當前項目,在右側頁面中選中頁籤Arguments,配置詳細的VM arguments參數
環境啓動參數(VM arguments):
- -Dnc.exclude.modules=${FIELD_EX_MODULES}
- -Dnc.runMode=develop
- -Dnc.server.location=${FIELD_NC_HOME}
- -DEJBConfigDir=${FIELD_NC_HOME}/ejbXMLs
- -DExtServiceConfigDir=${FIELD_NC_HOME}/ejbXMLs
- -Duap.hotwebs=lfw,portal,fs,iwebap,uui1,uui2,mp
- -Duap.disable.codescan=false
- -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
- -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
- -Xms128M -Xmx512M -XX:NewSize=96M -XX:MaxPermSize=256M
2、啓動 UAP 中間件
如果項目之已啓動中間件,先終止項目的運行重啓中間件。選中項目右鍵啓動 UAP 中間件服務
圖 2-3、啓動 UAP 中間件圖
看到下面的信息後說明項目啓動成功。
圖 2-4、中間件成功啓動信息圖
3、成功訪問系統
再次登入財務共享系統,報錯問題解決。使用普通用戶登入即可。
圖 2-5、訪問系統成功歡迎頁面圖
圖 2-6、登入財務共享系統圖
OK,到這裏我的問題解決了,我這裏報錯問題原因就是環境啓動參數配置有誤。
三、其他開發環境配置
開發環境需要配置的其他地方也需要注意。下面說下其他配置點。包括 FIELD_NC_HOME 參數配置,JRE 環境配置配置,指定的 JAR 包刪除,還有上面處理的 VM 環境啓動參數配置。
1、FIELD_NC_HOME 參數配置
進入 Window - Perferences - Run/Debug - String Substitution,單擊按鈕 New 新建參數 FIELD_NC_HOME,如果參數已存在,Edit 編輯 NCHome 的路徑即可。
圖 3-1、參數 FIELD_NC_HOME 新增編輯圖
2、JRE 參數配置
Java 環境及 VM 環境參數配置
圖 3-2、JRE 及 VM 參數配置圖
3、IP及端口設置
圖 3-3、端口配置圖一
圖 3-4、端口配置圖二
4、刪除 JAR 包
如果NCHome 中存在下面的jar 包,備份後刪除即可。
操作 | JAR 包路徑 |
刪除 | nchome\lib\slf4j-api-1.7.5.jar |
刪除 | nchome\modules\uapss\META-NF\lib\tika-app-1.1.jar |