Skip to Content
author's profile photo Former Member
Former Member

method getService is deprecated

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 11, 2005 at 11:21 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 10, 2005 at 05:31 PM

    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
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 22, 2005 at 04:11 PM

    How can I reward points? There are no radio buttons or similar. Has this service been removed?

    BR,

    David

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.