<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>BeanLocatorException in VM Template file in Liferay 7.2</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119943012" />
  <subtitle>BeanLocatorException in VM Template file in Liferay 7.2</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119943012</id>
  <updated>2026-04-04T12:32:11Z</updated>
  <dc:date>2026-04-04T12:32:11Z</dc:date>
  <entry>
    <title>RE: BeanLocatorException in VM Template file in Liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119943821" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119943821</id>
    <updated>2020-09-14T17:13:15Z</updated>
    <published>2020-09-14T17:13:15Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi,&lt;br&gt;Try below code&lt;br&gt;&lt;pre&gt;&lt;code&gt;$layoutLocalService = $serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService")&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;​​​​​​​&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2020-09-14T17:13:15Z</dc:date>
  </entry>
  <entry>
    <title>BeanLocatorException in VM Template file in Liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119943011" />
    <author>
      <name>Shiva Lingam K</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119943011</id>
    <updated>2020-09-14T13:30:03Z</updated>
    <published>2020-09-14T13:30:03Z</published>
    <summary type="html">Hi All,          I am getting the exception for below code in VM Template&lt;img alt="emoticon" src="@theme_images_path@/emoticons/kiss.gif" &gt;set ($layoutLocalService = $serviceLocator.findService(&amp;#34;com.liferay.portal.service.LayoutLocalService&amp;#34;))&lt;br /&gt;#set ($layoutId = $getterUtil.getLong($internallink.getData()))#set ($themeDisplay = $request.get(&amp;#39;theme-display&amp;#39;))&lt;br /&gt;#set ($currentPlid = $getterUtil.getLong($themeDisplay.get(&amp;#39;plid&amp;#39;)))&lt;br /&gt;#set ($currentLayout = $layoutLocalService.getLayout($currentPlid))&lt;strong&gt;Exception:&lt;/strong&gt;&lt;strong&gt;2020-09-14 09:25:38.456 ERROR [http-nio-8080-exec-1][ServiceLocator:50] com.liferay.portal.kernel.bean.BeanLocatorException: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named &amp;#39;com.liferay.portal.service.LayoutLocalService&amp;#39; available&lt;br /&gt;com.liferay.portal.kernel.bean.BeanLocatorException: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named &amp;#39;com.liferay.portal.service.LayoutLocalService&amp;#39; available&lt;br /&gt;        at com.liferay.portal.bean.BeanLocatorImpl.locate(BeanLocatorImpl.java:105)&lt;br /&gt;        at com.liferay.portal.kernel.bean.PortalBeanLocatorUtil.locate(PortalBeanLocatorUtil.java:82)&lt;br /&gt;        at com.liferay.portal.template.ServiceLocator.findService(ServiceLocator.java:45)&lt;/strong&gt;&lt;br /&gt;Any one tell me how to resolve this ?</summary>
    <dc:creator>Shiva Lingam K</dc:creator>
    <dc:date>2020-09-14T13:30:03Z</dc:date>
  </entry>
</feed>
