Liferay 移动设备检测

问题描述

我是 Liferay 的新手,我已经从 Liferay 市场下载了 Mobile Device Detection Lite 并将其放在部署文件夹中,然后在重新启动服务器后出现以下错误

ERROR [Framework Event Dispatcher: Equinox Container: 58db3900-d87a-41e5-b86f-6542cbc57b6c][Framework:93] FrameworkEvent ERROR
org.osgi.framework.BundleException: Could not resolve module: com.liferay.portal.mobile.device.detection.fiftyonedegrees [2720]_  Unresolved requirement: Import-Package: com.liferay.portal.kernel.mobile.device; version="[8.0.0,8.1.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)

有人可以帮我解决上述问题吗。

PS:我使用的是 Liferay 版本:liferay-ce-portal-7.3.5-ga6

解决方法

找到了解决方案!
一开始我尝试了一种不推荐的hacky方式:
我在 com.liferay.portal.mobile.device.detection.fiftyonedegrees-4.0.8.jar - MANIFEST.MF 中修改了这些值:
com.liferay.portal.kernel.mobile.device;version=" [6.0,9.1)",com.liferay.portal.kernel.util;version="[6.12,11)"
使 jar 文件可部署,但不应使用此方法。

推荐的解决方案是从
https://mvnrepository.com/artifact/com.liferay/com 下载:
com.liferay.portal.mobile.device.detection.fiftyonedegrees-5.0.8.jar .liferay.portal.mobile.device.detection.fiftyonedegrees/5.0.8 并部署它。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...