Liferay $serviceLocator.findService("com.test.Foo") in portal_normal.vm giving NoSuchBeanDefinitionException

1.7k Views Asked by At

I'm using liferay6 and trying to access com.test.Foo (added to ext-service) in portal_normal.vm using

#set ($mySvc = $serviceLocator.findService("com.test.Foo"))

I'm getting the following exception.

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'com.test.Foo' is defined.

Where do i need to declare this bean?

1

There are 1 best solutions below

0
On

Please try the following snippet

$serviceLocator.findService("custom-portlet", "com.test.foo")

Replace custom-portlet with your portlet name