Exception - Liferay Portlet3 Requires 3.0 opt-inException - Liferay Portlet3 Requires 3.0 opt-inhttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1179593442024-03-28T15:58:01Z2024-03-28T15:58:01ZRE: Exception - Liferay Portlet3 Requires 3.0 opt-inMirko Romstadthttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1201026012020-10-16T10:04:46Z2020-10-16T10:04:46ZHow did you fix the problem? Not using "javax.portlet.version=3.0" at all?Mirko Romstadt2020-10-16T10:04:46ZRE: Exception - Liferay Portlet3 Requires 3.0 opt-inAldo De Vleeschauwerhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1187776002020-03-20T11:20:19Z2020-03-20T11:20:19ZNone of the Liferay portlets have "javax.portlet.version=3.0" set, so no help in using the Liferay code as an example.The issues happens typically when using PortletURLFactoryUtil because the PortletURLImpl.java code checks the portlet(ID) version and decides that _portletSpecMajorVersion == 3. So it sets up the PortletURLImpl as a 3.0 version. BUT the request that gets passed around is _portletSpecMajorVersion < 3 (because the request is from on of the Liferay portlets) so this throws an exception down the line.Aldo De Vleeschauwer2020-03-20T11:20:19ZRE: Exception - Liferay Portlet3 Requires 3.0 opt-inAldo De Vleeschauwerhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1183645382020-01-29T09:57:18Z2020-01-29T09:57:18ZWe have the same issue, it looks like the Request object that is passed to the AssetRenderer is not 3.0.Aldo De Vleeschauwer2020-01-29T09:57:18ZRE: Exception - Liferay Portlet3 Requires 3.0 opt-inFilipe Santanahttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1179638422019-12-03T17:40:15Z2019-12-03T17:40:15ZHi Jamie. That's fine. Same impression here... Thanks.Filipe Santana2019-12-03T17:40:15ZRE: Exception - Liferay Portlet3 Requires 3.0 opt-inJamie Sammonshttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1179635032019-12-03T17:37:26Z2019-12-03T17:37:26ZHi Filipe,<br />My apologies I missed the fact that you already had <strong>javax.portlet.version=3.0 </strong>set in the app. What's strange is it appears to be the Asset Publisher that is displaying the error.<strong></strong>Jamie Sammons2019-12-03T17:37:26ZRE: Exception - Liferay Portlet3 Requires 3.0 opt-inFilipe Santanahttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1179611592019-12-03T17:31:53Z2019-12-03T17:31:53ZHello Jamie,I could not found any other property to set.Do you know which one is missing from my configuration?<br />Thank youFilipe Santana2019-12-03T17:31:53ZRE: Exception - Liferay Portlet3 Requires 3.0 opt-inJamie Sammonshttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1179608142019-12-03T17:26:11Z2019-12-03T17:26:11ZHi Filipe,<br /><br />It looks like you may need to set an addtional property to enable portlet 3.0: <a href="https://portal.liferay.dev/docs/7-1/reference/-/knowledge_base/r/breaking-changes#upgrade-considerations">https://portal.liferay.dev/docs/7-1/reference/-/knowledge_base/r/breaking-changes#upgrade-considerations</a>Jamie Sammons2019-12-03T17:26:11ZException - Liferay Portlet3 Requires 3.0 opt-inFilipe Santanahttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1179593432019-12-03T15:33:16Z2019-12-03T15:33:16Z<html><head></head><body>Hi everyone.I'm trying to enable portlet 3.0 in my app, using Liferay 7.2 CE.<br>I've already configure my Portlet class like this<br><br><pre><code>@Component(
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;immediate = true,
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;property = {
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"com.liferay.portlet.display-category=category.hidden",
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"com.liferay.portlet.scopeable=true",
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"javax.portlet.display-name=Guestbooks",
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"javax.portlet.expiration-cache=0",
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"javax.portlet.init-param.portlet-title-based-navigation=true",
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"javax.portlet.init-param.template-path=/",
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"javax.portlet.init-param.view-template=/guestbook_admin/view.jsp",
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"javax.portlet.name=" + GuestbookPortletKeys.GUESTBOOK_ADMIN,
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"javax.portlet.resource-bundle=content.Language",
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"javax.portlet.security-role-ref=administrator",
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"javax.portlet.supports.mime-type=text/html",
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"com.liferay.portlet.add-default-resource=true",
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"javax.portlet.version=3.0"
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;},
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;service = javax.portlet.Portlet.class
)</code></pre><br><br>However I still getting the following exception:<pre><code>2019-12-03 15:23:09.182 ERROR [http-nio-8080-exec-4][IncludeTag:128] Current URL /web/guest/home/-/asset_publisher/P3UE1H5OERI4/guestbook/id/33615?_com_liferay_asset_publisher_web_portlet_AssetPublisherPortlet_INSTANCE_P3UE1H5OERI4_redirect=http%3A%2F%2Flocalhost%3A8080%2Fweb%2Fguest%2Fhome%3Fp_p_id%3Dcom_liferay_asset_publisher_web_portlet_AssetPublisherPortlet_INSTANCE_P3UE1H5OERI4%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26_com_liferay_asset_publisher_web_portlet_AssetPublisherPortlet_INSTANCE_P3UE1H5OERI4_cur%3D0%26p_r_p_resetCur%3Dfalse%26_com_liferay_asset_publisher_web_portlet_AssetPublisherPortlet_INSTANCE_P3UE1H5OERI4_assetEntryId%3D33615 generates exception: java.lang.UnsupportedOperationException: Requires 3.0 opt-in
java.lang.UnsupportedOperationException: Requires 3.0 opt-in
&nbsp;&nbsp; &nbsp;at com.liferay.portlet.internal.PortletRequestImpl.getRenderParameters(PortletRequestImpl.java:522)
&nbsp;&nbsp; &nbsp;at com.liferay.portlet.internal.PortletURLImpl._initMutableRenderParameters(PortletURLImpl.java:1607)
&nbsp;&nbsp; &nbsp;at com.liferay.portlet.internal.PortletURLImpl.<init>(PortletURLImpl.java:1280)
&nbsp;&nbsp; &nbsp;at com.liferay.portlet.internal.PortletURLImpl.<init>(PortletURLImpl.java:119)
&nbsp;&nbsp; &nbsp;at com.liferay.portlet.internal.RenderURLImpl.<init>(RenderURLImpl.java:43)
&nbsp;&nbsp; &nbsp;at com.liferay.portlet.internal.PortletURLFactoryImpl._create(PortletURLFactoryImpl.java:236)
&nbsp;&nbsp; &nbsp;at com.liferay.portlet.internal.PortletURLFactoryImpl._create(PortletURLFactoryImpl.java:248)
&nbsp;&nbsp; &nbsp;at com.liferay.portlet.internal.PortletURLFactoryImpl.create(PortletURLFactoryImpl.java:173)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.kernel.portlet.PortletURLFactoryUtil.create(PortletURLFactoryUtil.java:115)
&nbsp;&nbsp; &nbsp;at com.liferay.docs.guestbook.web.internal.asset.GuestbookAssetRenderer.getURLViewInContext(GuestbookAssetRenderer.java:149)
&nbsp;&nbsp; &nbsp;at org.apache.jsp.view_005fasset_005fentry_005ffull_005fcontent_jsp._jspService(view_005fasset_005fentry_005ffull_005fcontent_jsp:348)
&nbsp;&nbsp; &nbsp;at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
&nbsp;&nbsp; &nbsp;at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
&nbsp;&nbsp; &nbsp;at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
&nbsp;&nbsp; &nbsp;at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
&nbsp;&nbsp; &nbsp;at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
&nbsp;&nbsp; &nbsp;at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:369)
&nbsp;&