掲示板
Service Builder Migration from 6.2 to Liferay DXP
6年前 に sony sing によって更新されました。
Service Builder Migration from 6.2 to Liferay DXP
New Member 投稿: 19 参加年月日: 15/03/10 最新の投稿
There have two tables taken from Liferay 6.2 databse in DXP database. (Did it in database migration).
I took reference from blade sample & created service builder by refering exact service.xml from liferay 6.2's (Service Builder).
It builds well and deploys too.
In UserSubscriptionsLocalServiceImpl I have added following method
public UserSubscriptions searchUserSubscriptions(String userId){
try{
return userSubscriptionsPersistence.findByUserSubscriptionsByentryUUID(userId);
}catch(Exception e){
}
return null;
}
But while executing following method I get ClassCastException.
UserSubscriptions userSubscriptions = UserSubscriptionsLocalServiceUtil.searchUserSubscriptions(themeDisplay.getUser().getScreenName());
Exception -
2017-11-08 01:30:07 ERROR DispatcherPortlet:559 - Could not complete request
java.lang.ClassCastException: com.sun.proxy.$Proxy958 cannot be cast to com.agco.dealer.engage.email.service.UserSubscriptionsLocalService
PFA
service.xml & log files
I took reference from blade sample & created service builder by refering exact service.xml from liferay 6.2's (Service Builder).
It builds well and deploys too.
In UserSubscriptionsLocalServiceImpl I have added following method
public UserSubscriptions searchUserSubscriptions(String userId){
try{
return userSubscriptionsPersistence.findByUserSubscriptionsByentryUUID(userId);
}catch(Exception e){
}
return null;
}
But while executing following method I get ClassCastException.
UserSubscriptions userSubscriptions = UserSubscriptionsLocalServiceUtil.searchUserSubscriptions(themeDisplay.getUser().getScreenName());
Exception -
2017-11-08 01:30:07 ERROR DispatcherPortlet:559 - Could not complete request
java.lang.ClassCastException: com.sun.proxy.$Proxy958 cannot be cast to com.agco.dealer.engage.email.service.UserSubscriptionsLocalService
PFA
service.xml & log files
添付ファイル:
6年前 に David H Nebinger によって更新されました。
RE: Service Builder Migration from 6.2 to Liferay DXP (回答)
Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
When in OSGi, try to avoid use of the static util classes.
If you @Reference to inject your UserSubscriptionsLocalService, I believe you'll find this class cast thing goes away.
If you @Reference to inject your UserSubscriptionsLocalService, I believe you'll find this class cast thing goes away.
6年前 に sony sing によって更新されました。
RE: Service Builder Migration from 6.2 to Liferay DXP
New Member 投稿: 19 参加年月日: 15/03/10 最新の投稿
Thanks Devid