Unresolved requi rement: Import-Package:com.liferay.portal.kernel.model 問題解決

開發環境
系統:windows10
開發工具IDE: idea
數據庫:MySql 8.0.20
Liferay SDK: 7.3.0
Liferay運行環境:7.3.2
Liferay Tomcat: 9.0.33

 

創建完module 構建部署沒有出錯,就是把它放在Liferay 運行環境中運行時報如下錯誤

ERROR [Framework Event Dispatcher: Equinox Container: a223806f-5035-48e4-be05-175ec6ed9b0d][Framework:93] FrameworkEvent ERROR 
org.osgi.framework.BundleException: Could not resolve module: student.api [2293]_  Unresolved requirement: Import-Package: com.liferay.portal.kernel.model; version="[4.1.0,5.0.0)"_ [Sanitized]
    at org.eclipse.osgi.container.Module.start(Module.java:444)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1682)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1662)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1624)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1555)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

查了各種資料查不出來,包括有個叫“蝦老三”的二貨,只說版本問題,也沒具體說怎麼配置,然後哥就各種試,最終確定把Liferay SDK版本號和Liferay運行環境版本號一致即可。

Liferay 創建項目時選擇 7.3.0
Liferay 運行時環境改爲這個:liferay-ce-portal-7.3.0-ga1

就OK 了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章