Foros de discusión
Service Builder Migration from 6.2 to Liferay DXP
sony sing, modificado hace 6 años.
Service Builder Migration from 6.2 to Liferay DXP
New Member Mensajes: 19 Fecha de incorporación: 10/03/15 Mensajes recientes
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
Archivos adjuntos:
David H Nebinger, modificado hace 6 años.
RE: Service Builder Migration from 6.2 to Liferay DXP (Respuesta)
Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
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.
sony sing, modificado hace 6 años.
RE: Service Builder Migration from 6.2 to Liferay DXP
New Member Mensajes: 19 Fecha de incorporación: 10/03/15 Mensajes recientes
Thanks Devid