Combination View Flat View Tree View
Threads [ Previous | Next ]
Damayanthi Herath
"UserService is not set" exception while accessing Liferay webservices
March 3, 2013 9:03 PM
Answer

Damayanthi Herath

Rank: New Member

Posts: 1

Join Date: March 3, 2013

Recent Posts

Hi,

I am trying to access Liferay provided web services as per below :

UserServiceSoapServiceLocator locatorUser = new UserServiceSoapServiceLocator();
UserServiceSoap serviceUser = locatorUser.getPortal_UserService(URL for Portal_UserService);
System.out.println(serviceUser.getUserByEmailAddress(10112, "bruno@7cogs.com"));

I am using Liferay 5.2 and when I try to execute above code, I get the following exception.


java.lang.RuntimeException: UserService is not set
at com.liferay.portal.service.UserServiceUtil.getService(UserServiceUtil.java:408)
at com.liferay.portal.service.UserServiceUtil.getUserByEmailAddress(UserServiceUtil.java:171)
at com.test.ClientService.main(ClientService.java:25)

I am grateful if any body could enlighten me on how to resolve this error since I could not find any hint on it.

Thanks,

-D.Herath