ILandscapeService method getSystem(systemAlias) is deprecated

Im using ILandscapeService method getSystem(systemAlias) to return information from my Sysytem Definition in the PCD, but this method is deprecated:
ILandscapeService landscapeService = (ILandscapeService) PortalRuntime.getRuntimeResources().getService(ILandscapeService.KEY);
ISystem system = landscapeService.getSystem(systemAlias);
Can anyone tell me the correct, or just a non-deprecated, way I should be obtaining the System Definition details, and the JAR files I need in the build path to use the service?
Cheers,
Steve

Hi Steve,
try the following code snippet.
//get initial context to lookup system object
  Hashtable env = new Hashtable();
  env.put(Context.INITIAL_CONTEXT_FACTORY, IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
  env.put(Context.SECURITY_PRINCIPAL, currentUser);                              
  env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);
  InitialContext initialContext = null;
    try{
      initialContext = new InitialContext(env);
      ISystems systemService = (ISystems)PortalRuntime.getRuntimeResources().getService(ISystems.KEY);
     String systemId = systemService.getSystemId(alias);
     ISystem system = (ISystem)initialContext.lookup(systemId);
    catch(NamingException nException){
Best regards,
Martin

Similar Messages

  • Window.destroy() - Method of IWDWindow is deprecated.

    Hi Experts,
    I am getting following message inside a Java program of Web Dynpro:
    window.destroy() - Method of IWDWindow is deprecated.
    Could you please let me know how to sort out the issue. I am using NWDS 7.0.06.
    Regards,
    S

    According to <a href="https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/services/session/api/IWDWindow.html#destroy()">JavaDoc</a> :
    <i>
    Deprecated. This method is not part of the Web Dynpro API and might be withdrawn with the first new NetWeaver release in 2007. Please use <a href="https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/services/session/api/IWDWindow.html#destroyInstance()">destroyInstance()</a> instead
    Method destroy: invalidates/destroys window instance - the instance is closed and destroyed and can not be reused/reopened
    </i>

  • Jclient 10.1.2 - method setBaseErrorHandler has been deprecated ????

    I receive the following error from the Jclient statement :
    JUMetaObjectManager.setBaseErrorHandler(new JUErrorHandlerDlg());
    Warning(100,27): method setBaseErrorHandler(oracle.jbo.uicli.binding.JUErrorHandler) in class oracle.jbo.uicli.mom.JUMetaObjectManager has been deprecated
    We attempted to correct this looking at the default boot strap code the wizard creates but it uses the same call. Can someone tell me how to modify the boot strap code ?
    It causes strange behavior in the client with no errors being reported back to the client at all with its current method.
    thanks,

    Rob,
    its only a deprecation warning and should not bear any functionality loss because the class is still available and functional.
    The correct call is
    JUMetaObjectManager.setErrorHandler(new JUErrorHandlerDlg());
    Frank

  • File handling deprecated method - which one?

    I have this code, it should basically use the lines of text in a file and use them to construct nodes in a JTree. The compilation error is that the class uses a deprecated method - so does anybody know what method is the problem and what I should use?
    private void createNodes(DefaultMutableTreeNode top)
       DefaultMutableTreeNode anode = null; 
       File theFile = new File("categories.txt");
    try
    DataInputStream din1 = new DataInputStream(new FileInputStream(theFile));     
        //while (din1.available() !=0)
        while (true)
           String topic = din1.readLine().trim();
           //set the string as a tree node
           anode = new DefaultMutableTreeNode(topic);
           top.add(anode);
         din1.close();//close the file handle
         catch (Exception e)
              System.err.println("File input error");
    }//end of method

    If you compile with deprecation it will tell you specifically.
    I think it is:
    javac -deprecation ...
    The only method from below that I think it could be is readLine() in DataInputStream...
    If you are reading text...try:
    BufferedReader br = new BufferedReader(new FileReader(theFile));
    String topic;
    while ((topic=br.readLine())!=null)
        anode = new DefaultMutableTreeNode(topic);
        top.add(anode);
    br.close();

  • Deprecated Method's Replacement in NW7.3

    hi,
    In version 7.3 of NW, following methods seem to be deprecated. Please suggest their replacements.
    mappingOfOnAction().addParameter
    wdComponentAPI.getWindowManager().createConfirmationWindow
    com.sap.tc.webdynpro.services.session.api.IWDConfirmationDialog
    wdComponentAPI.getMessageManager().reportMessage
    wdComponentAPI.getMessageManager().reportException(
           e.getLocalizedMessage(), true);
    WDWebResource.getWebResource
    Thanks !
    seventyros
    [Learn SAP Online|http://learnsaponline.blogspot.com]

    move your mouse over it. i think it will give some idea
    or ctrl+click, check the api doc

  • 1.4 deprecated methods

    Are there any methods that have been deprecated as of JDK 1.3 that have been removed in JDK 1.4 / 1.4.2? I can't find a list anywhere. Generally, do we need to worry about Sun completely removing deprecated methods?

    Woohoo! I wonder how long before the move to 1.5 happens.<thinks about how wonderful moving data structures
    consisting of 6 nested hashtables into generics will be/>
    *splort*
    Exactly! I've already thought about that. But, probably no worries--the contract has ended. What is supposed to be the last release is supposed to happen in a couple of days (once they fix a problem with a data file the subcontractor gave us). Our code to parse their text file (one time thing as part of a build) didn't have much error checking, so the error wasn't found until the testers tried to run something else. Then, the first person debugging it tried to find a latent bug in our code (spend a few days on it). They called me up today (I'm on another project now) to see if I could find anything, because the other guy was out for two days. As soon as I saw where the error occurred, I looked at the data files and quickly found that they were corrupted. Our code is still fragile, but if the data file is fixed, that should be sufficient (might as well keep this part fragile, especially if the contract is over--everything else in the code is fragile, too).

  • How to Diasble JLabel since enable(false) method is deprecated in jdk1.4

    Hi friends
    i am using jdk1.4 in which enable method is deprecated.
    i am disabling my jlabel using jlabel.enable(false); method
    however this is deprecated.
    what method should i then use
    please do help

    You just try with the .setEnabled(false); This will
    help to solve your problem.Hey Thanks Mr. Sumode , its working with .setEnabled(false);

  • Method Session session.connection() is deprecated - version 1.6

    hi, making migration 1.4 to 1.6 version JDK, the method session.connection() is deprecated, by what method or feature you can run the code without deprecation
    a method which is used:
    public void saveFinding(DasFinding finding) {
    if (finding.getId() == null) {
    Long sequenceNumber = (Long) getSession().createQuery("select count(*) from DasFinding f where f.das = :das").setParameter("das", finding.getDas()).setFlushMode(FlushMode.COMMIT).uniqueResult();
    finding.setSequenceNumber(sequenceNumber.intValue() + 1);
    if (finding.getStatus().equals(FindingStatus.CLONE)) {
    finding.setStatus(FindingStatus.OPEN);
    Session hibernateSession = getHibernateTemplate().getSessionFactory().getCurrentSession();
              hibernateSession.setFlushMode(FlushMode.ALWAYS);
              hibernateSession.saveOrUpdate(finding);
              hibernateSession.flush();
              if (finding.getDescription() != null) {
                   try {
                        ClobSolver.insertClobString("AUD_DAS_FINDING", "DESCRIPTION", "DAS_FINDING_ID", finding.getId(), finding
                                  .getDescription(), hibernateSession.connection());                     
                   } catch (Exception e) {
                        log.error("Comments CLOB not saved for Summary '" + finding.getDescription() + "'(" + finding.getId()
                                  + ") " + "\nException : " + e.getClass().getName() + " Message(s): " + e.getMessage() + " "
                                  + e.getLocalizedMessage());
                        e.printStackTrace();
                   hibernateSession.refresh(finding);
    another method which is used:
    public void saveFindingComment(DasFindingComment comment) {
    if (comment.getId() == null) {
    Long sequenceNumber = (Long) getSession().createQuery("select count(*) from DasFindingComment f where f.finding = :finding").setParameter("finding", comment.getFinding()).setFlushMode(FlushMode.COMMIT).uniqueResult();
    comment.setSequenceNumber(sequenceNumber.intValue() + 1);
    Session hibernateSession = getHibernateTemplate().getSessionFactory().getCurrentSession();
              hibernateSession.setFlushMode(FlushMode.ALWAYS);
              hibernateSession.saveOrUpdate(comment);
              hibernateSession.flush();
              if (comment.getSummaryPosCommission() != null) {
                   try {
                        ClobSolver.insertClobString("AUD_DAS_FINDING_COMMENT", "SUMMARY_POS_COMMISSION",
                                  "DAS_FINDING_COMMENT_ID", comment.getId(), comment.getSummaryPosCommission(), hibernateSession.connection());
                   } catch (Exception e) {
                        log.error("Comments CLOB not saved for Commission Position Summary '"
                                  + comment.getSummaryPosCommission() + "'(" + comment.getId() + ") of finding "
                                  + comment.getFinding().getId() + "\nException : " + e.getClass().getName() + " Message(s): "
                                  + e.getMessage() + " " + e.getLocalizedMessage());
                        e.printStackTrace();
              if (comment.getSummaryPosCountry() != null) {
                   try {
                        ClobSolver.insertClobString("AUD_DAS_FINDING_COMMENT", "SUMMARYPOSCOUNTRY", "DAS_FINDING_COMMENT_ID",
                                  comment.getId(), comment.getSummaryPosCountry(), hibernateSession.connection());
                   } catch (Exception e) {
                        log.error("Comments CLOB not saved for Country Position Summary '" + comment.getSummaryPosCountry()
                                  + "'(" + comment.getId() + ") of finding " + comment.getFinding().getId() + "\nException : "
                                  + e.getClass().getName() + " Message(s): " + e.getMessage() + " " + e.getLocalizedMessage());
                        e.printStackTrace();
    * deleteFindingComment
    * @param comment DasFindingComment
    a another:
    public void saveFindingComment(DasFindingComment comment) {
    if (comment.getId() == null) {
    Long sequenceNumber = (Long) getSession().createQuery("select count(*) from DasFindingComment f where f.finding = :finding").setParameter("finding", comment.getFinding()).setFlushMode(FlushMode.COMMIT).uniqueResult();
    comment.setSequenceNumber(sequenceNumber.intValue() + 1);
    Session hibernateSession = getHibernateTemplate().getSessionFactory().getCurrentSession();
              hibernateSession.setFlushMode(FlushMode.ALWAYS);
              hibernateSession.saveOrUpdate(comment);
              hibernateSession.flush();
              if (comment.getSummaryPosCommission() != null) {
                   try {
                        ClobSolver.insertClobString("AUD_DAS_FINDING_COMMENT", "SUMMARY_POS_COMMISSION",
                                  "DAS_FINDING_COMMENT_ID", comment.getId(), comment.getSummaryPosCommission(), hibernateSession.connection());
                   } catch (Exception e) {
                        log.error("Comments CLOB not saved for Commission Position Summary '"
                                  + comment.getSummaryPosCommission() + "'(" + comment.getId() + ") of finding "
                                  + comment.getFinding().getId() + "\nException : " + e.getClass().getName() + " Message(s): "
                                  + e.getMessage() + " " + e.getLocalizedMessage());
                        e.printStackTrace();
              if (comment.getSummaryPosCountry() != null) {
                   try {
                        ClobSolver.insertClobString("AUD_DAS_FINDING_COMMENT", "SUMMARYPOSCOUNTRY", "DAS_FINDING_COMMENT_ID",
                                  comment.getId(), comment.getSummaryPosCountry(), hibernateSession.connection());
                   } catch (Exception e) {
                        log.error("Comments CLOB not saved for Country Position Summary '" + comment.getSummaryPosCountry()
                                  + "'(" + comment.getId() + ") of finding " + comment.getFinding().getId() + "\nException : "
                                  + e.getClass().getName() + " Message(s): " + e.getMessage() + " " + e.getLocalizedMessage());
                        e.printStackTrace();
    * deleteFindingComment
    * @param comment DasFindingComment
    thanks in advance

    I'am sorry for not using the tags, I wrote quickly, thanks.
    Yes, new version of Hibernate, until today, 3.3.0, hibernate3.jar, don't have replace the metod connection,
    P:S:
    www.hibernate.org recommend using the SPI or DoWork(),
    "Session.connection()" is used in lines of code below:
    public void saveFinding(Finding finding) {
    if (finding.getId() == null) {
    // hibernate 3.2.6 uniqueresult is now int64 => Long
    Long sequenceNumber= (Long)getSession().createQuery("select count(*) from Finding f where f.mission = :mission").setParameter("mission", finding.getMission()).setFlushMode(FlushMode.COMMIT).uniqueResult();
    finding.setSequenceNumber(sequenceNumber.intValue() + 1);
    // CR 1266
    // if the finding status is CLONE, change it to OPEN
    if (finding.getStatus().equals(FindingStatus.CLONE)) {
    finding.setStatus(FindingStatus.OPEN);
    Session hibernateSession = getHibernateTemplate().getSessionFactory().getCurrentSession();
              hibernateSession.setFlushMode(FlushMode.ALWAYS);
              hibernateSession.saveOrUpdate(finding);
              hibernateSession.flush();
    if (finding.getDescription() != null) {
                   try {
                        ClobSolver.insertClobString("AUD_FINDINGS", "DESCRIPTION", "FINDING_ID", finding.getId(), finding
                                  .getDescription(), hibernateSession.connection());
                   } catch (Exception e) {
                        log.error("Comments CLOB not saved for Summary '" + finding.getDescription() + "'(" + finding.getId()
                                  + ") " + "\nException : " + e.getClass().getName() + " Message(s): " + e.getMessage() + " "
                                  + e.getLocalizedMessage());
                        e.printStackTrace();
                   hibernateSession.refresh(finding);
    you can replicate the functionality
    thank you

  • 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.

  • How to mark a method as deprecated

    Hello,
    please does anyone knows how to mark a method as deprecated.
    thanks

    I know about the documentation i mean about the method
    itself.
    is putting @deprecated at the documentation will
    generate a warrning message if u did not use
    -deprecation as a parameter while compilingThat is how to do it! You will only get a warning if you make use of a deprecated method. Why would you want to deprecate a method, and then carry on using it in your own code? You need to change the usages to whatever you have implemented to replace the missing required functionality.

  • Work around for deprecated getIds() and getSession()

    Hi All,
    As getIds() and getSession() methods of HTTPSessionContext are deprecated I need to know some work around for them. Can anyone please help me out ?
    My problem is as follows -
    My application has users who can have more than one login till a maximum number. After that maximum number is reached, if same user tries to make another login system will only allow him/her to make it after removing all of his/her previous logins. As a part of that, system should also delete all the sessions associated with those previous logins. Now the methods getIds() and getSession() being deprecated, I don't know how it can be done without going to some persistent data layer (like database).
    I'm using WebSphere application server and the solution need to be applicable even for a clustered environment (i.e. I may need to put both of my web tier and application tier in a clustered environment).
    Any help will be really appreciated.
    Regards,
    Sourav

    i don't know about handling the multi tier issue but you can easily put an instance into the ServletContext that keeps track of the associations between users and sessions and can react accordingly.
    robert

  • Warning: [deprecation] getRealPath in ServletRequest has been deprecated

    I have extended class HttpServletRequestWrapper for custom implementation I have neither overriden the method getRealPath(java.lang.String) nor has this method been used/accessed anywhere. I still get following warning
    [javac] /home/pangav1/dev/upgrade/webapps/common/src/minimed/ddms/webapp/common/filter/LocaleFilter.java:222: warning: [deprecation] getRealPath(java.lang.String) in javax.servlet.ServletRequest has been deprecated
    [javac] public static class HttpRequest extends HttpServletRequestWrapper {
    [javac] ^
    Can anyone tell me the reason why compiler shows the warning message?

    It should certainly not be ignored, especially if you don't understand the reason of deprecation and don't know the alternatives, which is the case of the topicstarter. In any case of deprecated classes/methods, the reasoning of deprecation and any alternatives should already be described in the API docs.
    [Here is the API doc of ServletRequest#getRealPath()|http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getRealPath(java.lang.String)]

  • Thread.stop() -- Why is it deprecated ? - What alternatives ?

    Hi,
    I'm creating an XMPP server in Java and I have a problem. I have a thread that run the SAX parser and is constantly blocking to recive data from my socket. Now the problem is that at some point (after the authentication) I need to stop the XML parsing.
    The only way I can do this, I think, is by using the Thread.stop() method, but it is deprecated :(
    I read the FAQ about this deprecation but the alternatives given can't work for me:
    - I can't close the eocket because I need to read another XML document right after on the socket
    - I can't call Thread.interrupt() because the thread is blocking on an IO
    - I can't use a shared variable because the thread is blocked inside the SAX parser that call from time to time a callback. I can't modify the SAX code :(
    Does anyone have an idea how to make my thread stop the parsing ?
    Thanks
    Mildred

    If you've read the "FAQ" on deprecation of stop etc then you already know why stop() is deprecated - it is inherently unsafe as you can't know for sure what your thread was doing when you tried to stop it. Further, what those documents don't tell you is that Thread.stop doesn't break you out of most blocking situations any way - so it wouldn't necessarily help even if it weren't deprecated.
    I don't know the I/O or threading architecture of what you are working with so the following may not be applicable, but hopefully something will help:
    One of the alternatives you didn't mention is setting the SO_TIMEOUT option on the socket so that your thread can periodically check if its actually been cancelled. I don't know if that is possible in this case it depends on how the use of sockets gets exposed by the library.
    Other possibilities for unblocking a thread are to give the thread what it is waiting for - some data on the socket in this case. If you can send something that can be interpreted as "stop looking for more data", or if you check for cancellation before trying to interpret the data at all, then you can unblock the thread by writing to the socket. Whether this is feasible depends on how the real data is written to the socket.
    Final possibility is to create a new thread to do the socket reading. Your parser thread can then read from a BlockingQueue, for example, that is populated with data from the socket thread. You can use interrupt() to cancel the parser thread and just ignore the socket thread - which presumably will unblock when the next real data arrives.

  • Deprecation problem

    when i compile my program i get error message that says
    "myfile.java uses or overrides a deprecated API. Recompile with -deprecation for details."
    what does this mean and how do i fix it ?
    thanx
    trin

    means that you are probly either overriding or using a method which has been deprecated, not supported any more.
    It is just a warning, you could continue using it. The class file will be created. But you might probably want to use a more updated method.
    Normally when someone deprecates a Class or Method a replacement is usually there. Check to javadoc to find out more.
    To find out exactly which deprecated method/class you are trying to use, compile your code with the following:
    javac -deprecation myfile.java
    this will tell you the exact line in your code which is using it.

Maybe you are looking for

  • Save As Under File Tab problem?

    Hello, allo, I run seven sites and need to save the same htm file to all 7 when prices change. Even though the supporting files are in their respective directories, (images and templates) the "save as" selection does not respect the link information

  • Do I Need My MacBook Air???

    I am a retired teacher with money problems.  I sub now, and also do iPad Resource Nights at my local mental hospital. I have 7 iPads of various kinds. I need to keep them for my work. This summer, I bought the new 13" MacBook Air with the fast proces

  • Mouse cursor sometime jumps down

    I have ThinkPad Yoga 20CD0-038. If I use OneLink Dock, my mouse cursor sometime jump to down or down-right and sometimes makes a click or right-click. I have two OneLink Dock and two different mouse. It is the same when the mouse is connected to USB

  • How to make sure subsribed events processed synchronous in BPEL

    Hi, We have a BPEL processing that is triggerred by subscribed EO events. How to make these received events to be processed one by one in BPEL? Thanks! Susan

  • Robohelp HTML error message

    Everytime i try to generate webhelp I get an error message that shuts down Robohelp.  I just recently changed computers and had to have Robohelp 6 re-installed.  I have 3 projects, but this only happens with one particular project.  I don't know what