未解决的要求:导入包:com.liferay.portal.kernel.portlet.bridges.mvc;版本="[[2.0.0,3.0.0)" [英] Unresolved requirement: Import-Package: com.liferay.portal.kernel.portlet.bridges.mvc; version="[2.0.0,3.0.0)"

查看:113
本文介绍了未解决的要求:导入包:com.liferay.portal.kernel.portlet.bridges.mvc;版本="[[2.0.0,3.0.0)"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从此处下载

我去为此目的而创建的小部件页面中添加了portlet/widget,但是我找不到该portlet:

然后,以管理员用户身份登录,我进入了控制面板"->应用管理器并搜索我的Portlet.它显示为已安装".我可以激活它.我点击激活"后,Eclipse日志开始写: ERROR [http-nio-8080-exec-8] [PortletServlet:119] javax.portlet.PortletException:org.osgi.framework.BundleException:无法解决模块:VictorTestPortlet [2716] _未解决的要求:导入包:com.liferay.portal.kernel.portlet.bridges.mvc;版本="[[2.0.0,3.0.0)" __ [已消毒]

问题:是什么原因导致此错误?

解决方案

您自己找到了复杂的解决方案,有两种更简单的方法:

  1. 使用目标平台.假设您正在使用Liferay工作区,则工作区根目录中的gradle.properties条目为 liferay.workspace.target.platform.version .将其设置为 7.3.5 ,版本将自动获取

  2. 通过设置目标平台,甚至可以自动检测所需的模块,并将您的依赖项声明为

    依赖项{compileOnly组:"com.liferay.portal",名称:"release.portal.api"}

这甚至可以找出您需要依赖的确切模块(超过1000个).诚然,它与整个模块化概念(要注意您的依赖关系)有点冲突,但是非常方便.

I have downloaded Liferay 7.3.5 Community Edition from here and trying to deploy a HelloWorld portlet for testing purposes. It is bundled with Tomcat. I am using Liferay Developer Studio (the same old Eclipse on steroids) for developing and deploying the portlet. Version 3.8.1.202004240132-ga2 I have also created a Server like in this link - the server is using the tomcat 9.0.37 from the already downloaded bundle.

After steps above, I have followed steps from here to create a Module Project and to deploy it on the already started tomcat server. The portlet appears in the deployed section, but with a red "x" near it:

I went to add the portlet/widget in a widget page that I have created for this purpose, but I could not find the portlet:

Then, logged in with an admin user, I went to Control Panel -> App Manager and searched for my Portlet. It appears as "Installed" and I can activate it. After I hit "Activate", Eclipse logs start writing: ERROR [http-nio-8080-exec-8][PortletServlet:119] javax.portlet.PortletException: org.osgi.framework.BundleException: Could not resolve module: VictorTestPortlet [2716]_ Unresolved requirement: Import-Package: com.liferay.portal.kernel.portlet.bridges.mvc; version="[2.0.0,3.0.0)"_ [Sanitized]

The Question: what is causing this error ?

解决方案

You found the complex solution yourself, there are two simpler ways:

  1. Use the target platform. Assuming you're using Liferay Workspace, your gradle.properties in the root of your workspace has an entry liferay.workspace.target.platform.version. Set it to 7.3.5 and the versions will be taken automagically

  2. Have even the required modules be detected automagically by setting the target platform, and declare your dependency as

    dependencies { compileOnly group: "com.liferay.portal", name: "release.portal.api" }

This will even figure out the exact module (of more than 1000) that you need to depend on. Granted, it kind of works against the whole concept of modularization (to be aware of your dependencies), but it's soooo convenient.

这篇关于未解决的要求:导入包:com.liferay.portal.kernel.portlet.bridges.mvc;版本="[[2.0.0,3.0.0)"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆