2 Replies Latest reply: Feb 19, 2013 10:07 AM by gCubed RSS

    P6 V8.0 PMDB Unable to resolve privileged username and password

    user382973
      Hello there,

      I am having a problem getting my java primavera api service to connect to the primavera database.

      I am getting a Primavera exception thrown "Unable to resolve privileged username and password" on the getDatabaseInstances(null)... from the code snippet below, does anyone have any idea what this means?

      Session session = null;
      DatabaseInstance[] dbi = Session.getDatabaseInstances(null);

      Have installed an 8.0 api to connect to an Oracle P6 V8.0 PMDB database using Local Mode.

      thanks
        • 1. Re: P6 V8.0 PMDB Unable to resolve privileged username and password
          gCubed
          I think you want something like this:

          DatabaseInstance[] dbInstances = Session.getDatabaseInstances(RMIURL.getRmiUrl(_mode, url, rmiport));

          For local mode:
          DatabaseInstance[] dbInstances = Session.getDatabaseInstances( RMIURL.getRmiUrl( RMIURL.LOCAL_SERVICE ) );

          I have a helper that returns the id base on a name.

          public String GetDatabaseId(String databaseName) {

          String databaseId = null;
          try {
          DatabaseInstance[] dbInstances = Session.getDatabaseInstances(RMIURL.getRmiUrl(_mode, url, rmiport));

          for (DatabaseInstance dbInstance : dbInstances) {
          if (dbInstance.getDatabaseName().equals(databaseName)) {
          databaseId = dbInstance.getDatabaseId();
          break;
          }
          }
          } catch (Exception ignored) {

          }
          return databaseId;
          }

          Gene

          Edited by: gCubed on Feb 19, 2013 10:07 AM
          • 2. Re: P6 V8.0 PMDB Unable to resolve privileged username and password
            gCubed
            Another thing you can do is check your configuration.

            In the api folder run the admin.cmd / admin.sh to see check the API configuration.

            You should be able to find the api folder under the P6 install directory. In my case it was here: C:\Oracle\P6EPPM\api

            Gene