掲示板

"UserService is not set" exception while accessing Liferay webservices

11年前 に Damayanthi Herath によって更新されました。

"UserService is not set" exception while accessing Liferay webservices

New Member 投稿: 1 参加年月日: 13/03/04 最新の投稿
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