Hi,
I have made a portal application using EPCF in eclipse for EP60 SP2 but get the following error in the portal:
- - - - -
com.sapportals.portal.prt.component.PortalComponentException: Error in service call of Portal Component
Component : RIGSenderParProject02.RIGSenderParComponent02
Component class : RIGSenderParParckage02.RIGSenderParComponent02
at com.sapportals.portal.prt.core.PortalRequestManager.handlePortalComponentException(PortalRequestManager.java:858)
...
...
Caused by: java.lang.ClassCastException: com.sapportals.portal.prt.service.epcftoolbox.EpcfToolbox
at RIGSenderParParckage02.RIGSenderParComponent02$SenderDynPage.doProcessBeforeOutput(RIGSenderParComponent02.java:60)
- - - - -
It appears to be an error in line 60 of my java code which also has a warning in eclipse saying:
The method getService(String) from the type IPortalComponentRequest is deprecated
The code in the line is:
IEpcfToolbox myServ = (IEpcfToolbox) request.getService(IEpcfToolbox.KEY);
Do you know what the problem could be?
Thanks in advance,
David
David -
Try using the following :
IEpcfToolbox myServ = (IEpcfToolbox)PortalRuntime.getRuntimeResources().getService(IEpcfToolbox.KEY);
Dont forget to include the import com.sapportals.portal.prt.runtime.PortalRuntime;
John
Hi,
There have been some long threads on classcastexceptions but this doesn't seem to be the same problem.
Can you try to find out the name of the class you get returned, i.e. try out this code
Object objEpcfToolbox = request.getService(IEpcfToolbox.KEY); System.out.println("Class of objEpcfToolbox " + objEpcfToolbox.getClass().getName() ) ; EpcfToolbox myServ = (IEpcfToolbox)objEpcfToolbox ;
Add a comment