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

Thanks John, this removed the "deprecated" warning in eclipse, but I still get the same ClassCastException error at runtime:
”Caused by: java.lang.ClassCastException: com.sapportals.portal.prt.service.epcftoolbox.EpcfToolbox
at RIGSenderParParckage02.RIGSenderParComponent02$SenderDynPage.doProcessBeforeOutput(RIGSenderParComponent02.java:60)”
The class name I get returned is "com.sapportals.portal.prt.service.epcftoolbox.EpcfToolbox", both when I use my original code and the coding from John.
Any ideas how I can get rid of the ClassCastException error?
Thanks,
best regards,
David

Similar Messages

  • DataInputStream: method readLine() is deprecated. (What's the alternative?)

    Hi there,
    I have a DataInputStream object (code below). The code works great but I get a warning message below the code: dis.readLine()
    The method readLine() from the type DataInputStream is deprecated
    does anyone have an alternative to eliminate the warning?
    DataInputStream dis = null;
    String line = null;
    //read
    File f = new File(inputFolder+"/"+inputFileName);
    FileInputStream fis = new FileInputStream(f);
    BufferedInputStream bis = new BufferedInputStream(fis);
    dis = new DataInputStream(bis); 
    while ( (line=dis.readLine()) != null )
    }

    http://java.sun.com/j2se/1.4.2/docs/api/java/io/DataInputStream.html
    readLine()
    Deprecated. This method does not properly convert bytes to characters. As of JDK 1.1, the preferred way to read lines of text is via the BufferedReader.readLine() method. Programs that use the DataInputStream class to read lines can be converted to use the BufferedReader class by replacing code of the form:
    DataInputStream d = new DataInputStream(in);
    with:
    BufferedReader d
    = new BufferedReader(new InputStreamReader(in));

  • Method has been deprecated

    Hello !
    On the following code:
    oracle.sql.BLOB lobLocator = null;
    lobLocator = ss_DatePers.getFoto();
    java.io.OutputStream lobWriter = lobLocator.getBinaryOutputStream();
    .....Warning: method getBinaryOutputStream() has been deprecated
    What does this mean ?

    Meaning the version of Java no longer supports the command.
    Try the Java API for getting the related materials and start.

  • Alternative required for IService Configure Method which is Deprecated.

    Hi,
            I wanted to run few programs in EP 7.0 as soon as the User logs or as soon as the portal is started, without User running any thing to activate the functionality. For this, i am using IService (portal service) with Start-up parameter in Service-config set to True.
    But when i implemented IService to create portal service, the Iservice Method
    public void configure(IServiceConfiguration serviceConfiguration) should be implement or atleats left blank.
    But this is marked as deprecated. As i service is Inteface, i am forced to Implement(atleats blank) but are deprecated.
    and also the Class Used as parameter(IServiceConfiguration) in this method is marked as deprecated.
    So the Questions are.
    1. Is there any other way other than using Iservice to make the programe run autamatically, say by using Web dynpro or so on?
    2. Is it OK if i still use Iservice though The method and the class is deprecated.
    3. if i have to skip Iservice, then It will sound like EP 7.0 doesnt Encourage Portal service. Is it Ok If is use or , else please suggest a Way to Bring up the same functionality.
    Thanks..

    Hi ,
    Did you find an alternate for this? I am having the same issue.
    Appreciate your help.
    Thanks.

  • JPasswordField password        the method getText is deprecated

    Hi guys,
    The following code works, but for some reason, I get a small yellow line under it [I'm useing eclipse as my IDE] indicating:
    The method getText() from the type JPassword is deprecated
    WHY? any suggestions, or alternative to correct it?
    the code:
         private JTextField username;
         private JPasswordField password;
    password.setEchoChar('*');
         if (username.getText().equalsIgnoreCase("admin") && password.getText().equals("807SereNo#2"))
    //invoke ...
    the yellow line, indicating an err is under password.getText().

    // if (username.getText().equalsIgnoreCase("admin") && password.getText().equals("807SereNo#2"))
    change to
    String password = new String(password.getPassword());
    if (username.getText().equalsIgnoreCase("admin") && password.equals("807SereNo#2"))
    and will work fine I think.

  • Deprecated Methods in CE 7.2

    Hi,
    What are the methods that got deprecated in CE 7.2 when compared to CE 7.1
    Regards
    V. Suresh Kumar

    Every Java API javadoc has a 'deprecated' list, and so have the NWCE 7.2 API's
    For NWCE 7.2 Web Dynpro, check http://help.sap.com/javadocs/nwce/current/wdr/com.sap.wdr/index.html and from the top select the 'deprecated' link.
    FYI, all API's can be accessed via http://help.sap.com/javadocs/
    Best regards,
    Robin

  • Deprecated methods in Interfaces

    Hi all,
    I'm implementing an interface containing some deprecated methods. These deprecated methods have to be implemented, of course. If I compile my implementation I get deprecation warnings for these implemented methods. Does anyone know how I can get rid of these warnings? I've added @deprecated flags to my implementation of these methods, but that didn't solve these warnings. I'm using JDK 1.3.1.
    Thanks
    Daniel.

    Technically it's a feature. :p
    but seriously, the whole deprecated thing is a feature, it's too bad that in this case you have to live with it, but there's no way around it.
    besides it doesn't matter if you call a depreciated method as it is still going to work. It just means that some point in the future it will not be supported. And judgeing by sun's past actions, I would say that it's more of a way to encourage people not to use old methods, but I don't think that they will ever remove the depreciated methods from the api.
    The only methods you have to watch out for are the few like those the Thread which are just not implemented at all. Like thread.destroy()

  • Deprecated methods in 10.1.3

    Many methods in 10.1.3 are marked as deprecated.
    For example, class oracle.toplink.publicinterface.Descriptor is replaced by ClassDescriptor and RelationalDescriptor where getQueryManager() is deprecated with no replacement method.
    Another example, in oracle.toplink.sessions.Session interface, method containsObjectInIdentityMap is deprecated and no replacement is specified.
    I understand those deprecated methods will probably be removed in the future TopLink release. My question is: will TopLink provide the functions currently implemented in those methods, i.e. replacement methods?
    Thanks.
    Haiwei

    Haiwei,
    Yes the work done in 10.1.3 to add formal support for non-relational mapping (Object-XML and EIS/JCA) did require some refactoring of the descriptor class. In the end the previous Descriptor class was deprecated in place of a new ClassDescriptor hierarchy. This work is backwards compatible but some of the deprecated methods were not properly Java Doc'd with their new replacement.
    getQueryManager() -> getDescriptorQueryManager() - New method on ClassDescriptor
    All of the cache access methods have been refactored into a new IdentityMapAccessor class. This is available from any session using getIdentityMapAccessor().
    Doug

  • Deprecated Thread Methods

    My organization has recently come from the Microsoft world into the J2EE world. In .Net, Microsoft has an abort method on threads that is similar to the Java's stop method. Unfortunately, the stop method has been deprecated.
    While I have read the information on why this method is dangerous, I don't understand why the method has been removed. If I have a situation that warrants killing a thread (such as in the case of an application server that hosts other threads of execution), why remove it from the platform? While I agree with Sun's article on seeking out alternative methods, there are still exceptions where a thread just needs to be interrupted so that it can get out of a deadlock, endless loop or blocking I/O.
    Since the stop method is deprecated, is there an equivalent VM call that I can interface from native code?
    I must say that I feel a bit like I'm being mothered by Sun.

    From your comments, you make a strong argument that suggests there's no need for a VM-level stop function.
    This puzzles me because operating systems implement kill methods to terminate rogue processes, yet they remain efficient and manage to keep things clean. Granted, multiple processes don't generally share memory structures but certainly the OS, on their behalf, shares memory structures. I'm puzzled as to why similar desires/features aren't present in the JRE.
    Regardless, short of running multiple JRE instances, each managing just one piece of work, the current deprecated status of the stop method renders Java without the ability to stop something that's gone wild unless the application is specifically pre-programmed to anticipate this behavior. (Of course that's a bit of a catch 22 in and of itself but...)
    There is also a subscription to the notion that my company or company x can write perfect software that never hangs a Java-based application server. I feel that this is impractical -- especially when what businesses ask of IT continues to get more complex.
    At this point perhaps it's fair to reveal the underlying reasons for my up-to-now, hypothetical questions. In my situation, company x is actually Sun. They failed to expose a socket timeout on their implementation of HTTPUrlConnection. I suppose that pretty much removes the luster from the argument that I, or anyone else, can write perfect software when the inventors of Java are themselves, imperfect. Of course, like you said and the JDK documents, the stop method will not abort a blocking socket read anyway (...although there's no reason why it couldn't except for more flawed design decisions...)
    I've certainly investigated alternative packages but I'm just chasing a moving target. HTTPUrlConnection today, class x tomorrow. That's why I was wanting something at the framework level to provide a trap door so that recovery without terminating the JRE is possible.

  • Deprecated methods

    The following method has been deprecated. Does anyone know what it is replaced with? Also, is there a list of what has been deprecated and what the replacement method is and how to implement the replacement method?
    •     Warning(1886,24): setSelectedItemToStringConverter(oracle.bali.inspector.editor.ToStringConverter) in oracle.bali.inspector.PropertyEditorFactory2 has been deprecated
    Thanks

    Hi,
    such documentation should be part of the JavaDoc unless the developer deprecating the method forgot to mention it. There is no other documentation than that to provide the information. The JavaDocs say:
    * @deprecated use {@link #setEditorComponentInfo(EditorComponentInfo)} instead.
    So its in the same class
    Frank
    ps.: Hope you know what you do because I am not sure bali classes are open for public consumption

  • How I make deprecated method in JB4

    Hi, i make deprecated method like this:
    * @deprecated
    public String fillCharsToLimit(String value, int limit, char chr, boolean fromFirst) {
    value = value.trim();
    if (value == null || (value.length() == 0 && limit <= 0))
    ;//do st
    (in project properties i enable Show deprecations)
    I except that compiler say me warning.
    Its ignore deprecation in my code, but when I use deprecated method from JDK all is OK, only my method no why?
    Thanks DK

    You don't get a deprecation warning if the deprecated class or method and the code that uses the deprecated class or method are compiled at the same time. See Bug 4216683 http://developer.java.sun.com/developer/bugParade/bugs/4216683.html for details.

  • DocCheck comments on deprecated methods

    I am using the DocCheck utility to check the comments in my java packages, classes and methods. Methods that are deprecated have a @deprecated tag in the method comment, but DocCheck then complains about missing @params, etc. Is there any way that I can suppress the checking of deprecated methods?

    was just giving the way old doccheck tool a try - found it to be really useful
    and I ran into the problem mentioned here, I wished, doccheck wouldn't check deprecated methods ...
    so, what has happened to
    ericArmstrong wrote:
    I'll add it to the list of desired features, and give it
    a high priority.;-)
    Anyone still using doccheck? Are there any other tools, I mean, maybe doccheck will fail on some javadoc features introduced with Java 5 or 6 or ... 11 ;-)
    I like it! E.g., it gave me hints, to add @see in my getter and setter methods ... cool stuff!
    Merten

  • JBuilder deprecation warnings

    I'm working on a project using JBuilder, and some of our methods have been deprecated, but I don't get any deprecation warnings when I compile any of the classes that call the deprecated methods. I understand that it won't warn me when the class containing deprecated methods is compiled at the same time as the class calling them, but even when I compile one file at a time I get no deprecation warnings. I have verified that JBuilder is configured to show deprecations.
    Anybody have any idea what I might be doing wrong?
    Thanks,
    Sam

    I found this description:
    http://java.sun.com/products/jdk/1.1/docs/guide/misc/deprecation/deprecation.html
    With a note in the "What happens when an API is Deprecated" section. It says it will only suppress the warning if the class with the deprecated method is also compiled.
    Maybe if you remove the source file and leave the class file it will work..

  • Deprecated versus obsolete

    Hi,
    This has puzzled me for several years. Can anyone tell me the difference between deprecated methods and obsolete methods? I would normally think that "obsolete" is worse than "deprecated", but that doesn't seem to be the case.
    For instance, the Container method add(String, object) is "obsolete", but you don't get any warnings when you use it. Likewise, the java.awt.Choice method addItem() is supposed to be obsolete, but you don't get a compiler error or warning when you use it. On the other hand, the java.awt.List addItem() method is deprecated, and you do get a warning.
    Why aren't the obsolete methods marked as deprecated, and why don't obsolete methods trigger compile-time warnings?
    Anybody have an answer?
    --Steve

    Must be from a book.
    OP: In your case the author's intent for using the
    word 'obsolete' would be to mean that it is
    deprecated. Nope, should've read his post.
    From the API:
    add
    public Component add(String name,
                         Component comp)Adds the specified component to this container. This is a convenience method for addImpl
    (java.awt.Component, java.lang.Object, int).
    This method is obsolete as of 1.1. Please use the method add(Component,
    Object) instead.
    See Also:
    add(Component, Object)I would think "obsolete" is just an informal "deprecated". It is
    strange to have them refer to it as that without deprecating it,
    however.

  • Deprecation of Persistence API in ME2.1 SP03

    Hello together,
    I am coding an application with persistence functionality. I am following the example PersistenceSimple from the Mobile Development Kit (MDK):ME2.1 SP03, 4th revised Edition
    The example uses the class "Transaction" for persistence. But this class and its methods is declared deprecated. My coding looks like this:
    transaction = transactionManager.begin(TransactionType.WRITE);
    transactionManager.update(entity, TreeOptionType.COMPLETE);
    transaction.commit();
    If I simply avoid step 1 and step 3 and using TransationManager only, my data gets written to the disk but it is not persisted after the ME shuts down.
    So anybody here with an alternative for ME 2.1 SP03 which does NOT make use of "Transaction"?
    Best regards, Tim

    Hello,
    sorry - that is a "bug" in the Javadoc. For ME2.1 transaction has to be used - in MI2.5 it is different.
    Bye Sigi

Maybe you are looking for

  • Why do some black-and-white photos disappear in Mac Preview and Safari?

    I sent a PDF to a colleague recently only to discover that he uses Mac Preview to view PDFs and not Adobe Reader. The unfortunate part is that, although full-color photos all appeared, small black-and-whites were inconsistent: some appeared and other

  • Function moduls to create csv-file and send it per mail

    Hello, we have the following requirement. We created an eventhandler. Inside this eventhandler we built up an internal table with 1-n entries. Now we want to create a csv-file or excel-file in background and send it to the users mailadress. Are there

  • Using Actions in Photoshop Cloud?

    I just subscribed to Photoshop Clound service, and my actions I used in Photoshop CS3 are not working. Is it possible to load actions in Photoshop Cloud? Thank you.

  • How to get the same email for Eprint after resetting the printer

    Hi. I Have reset my HP Photosmart 7520 printer, but now i can't the the same email adress for Eprint as before the reset, when i try to register the same email adress, i got the message "adress used".. So how do i get the "old" email adress on the pr

  • Problem in calling arraylist from client

    Hi I am trying to execute a webservice program and facing some problems in the client side ,am trying to pass arraylist from client in weblogic8.1 this is my client code and the error i am getting on the serverside all the files are getting generated