留言板

PortalUtil class not found when moving to Liferay 7

Erik Bruchez,修改在7 年前。

PortalUtil class not found when moving to Liferay 7

New Member 帖子: 4 加入日期: 14-7-24 最近的帖子
I have a portlet which deploys in Liferay all the way until 6.2, but in Liferay 7 I get:

25-Aug-2016 23:54:51.073 SEVERE [http-nio-9090-exec-1] org.apache.catalina.core.ApplicationDispatcher.invoke Servlet.service() for servlet jsp threw exception
java.lang.ClassNotFoundException: com.liferay.portal.util.PortalUtil cannot be found by proxy-portlet_7.0.2
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:394)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:357)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:349)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.orbeon.private.orbeon.oxf.portlet.liferay.FormRunnerAuthFilter$.amendRequestWithUser(FormRunnerAuthFilter.scala:97)


The call is from our own portlet filter which makes use of com.liferay.portal.util.PortalUtil.

I checked the API modules page, and Breaking Changes part of the doc, but I don't see anything indicating that the class is no longer present.

Due to OSGi, do I need to somehow indicate in a portlet descriptor that I need PortalUtil? Or should I use another API?
thumbnail
Juan Gonzalez,修改在7 年前。

RE: PortalUtil class not found when moving to Liferay 7

Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子
Hi Erik, PortalUtil had been moved to:

com.liferay.portal.kernel.util


package, as you can see here:

https://github.com/liferay/liferay-portal/blob/7.0.2-ga3/portal-kernel/src/com/liferay/portal/kernel/util/PortalUtil.java
Erik Bruchez,修改在7 年前。

RE: PortalUtil class not found when moving to Liferay 7

New Member 帖子: 4 加入日期: 14-7-24 最近的帖子
Thanks, I will give that a try!