Skip to Content

Add user to BI platform is crashing the system using Java SDK

cbo-issuesbousersdkaddusersdk.txtWe are using Java SDK to add users to Business Objects. We build the java code as a class file. Here is the snippet where our code is failing. Please look at it and let me know if there is anything wrong we are doing. Same code works in PROD, but not in QA. only difference is System name, user we are using SDK to create users, has admin access in both the systems.

See the attached code

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jun 27, 2017 at 09:25 PM

    Please try to commit only user object and No other operations like setting preferences . Please try this simple code to create the user with the basic properties which were used in CMC before.

    CreateUser.java

    import com.crystaldecisions.sdk.exception.SDKException;
    import com.crystaldecisions.sdk.framework.CrystalEnterprise;
    import com.crystaldecisions.sdk.framework.IEnterpriseSession;
    import com.crystaldecisions.sdk.framework.ISessionMgr;
    import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
    import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
    import com.crystaldecisions.sdk.plugin.desktop.user.IUser;
    
    
    public class CreateUser {
    	public static void main(String[] args) throws SDKException {
    		try
    		{
    			ISessionMgr sessionMgr = CrystalEnterprise.getSessionMgr();
    			ISessionMgr sessionManager = CrystalEnterprise.getSessionMgr();
    			IEnterpriseSession enterpriseSession = sessionManager.logon("administrator", "Password1", "localhost", "secEnterprise");
    			System.out.println("Logged into EnterpriseSession.....");
    			IInfoStore infostore = (IInfoStore) enterpriseSession.getService("InfoStore");
    			System.out.println("Got Infostore");
    			IInfoObjects newUsers = infostore.newInfoObjectCollection();
    			IUser newUser = (IUser) newUsers.add(IUser.KIND);
    			newUser.setTitle("username");
    			newUser.setNewPassword("password");
    			newUser.setConnection(IUser.CONCURRENT);
    			System.out.println("ready to commit");
    			infostore.commit(newUsers);
    			System.out.println("done");
    			enterpriseSession.logoff();
    		}
    		catch(Exception e)
    		{
    			e.printStackTrace();
    		}
    		
    	}
    
    
    }
    
    

    Please share the exemptions with line.

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 27, 2017 at 08:42 PM

    Is it failing in any specific case like high User list count? or Throwing any exceptions ?

    How about creating Users in CMC and applying same preferences?

    Add comment
    10|10000 characters needed characters exceeded

    • It is failing on first user itself where "Commit" in the code. if I manually add users in CMS it works fine.

      com.crystaldecisions.sdk.exception.SDKServerException: An error occurred at the server :

      All the servers with CMS :Server name>, cluster

      Server name

      and kind cms are down or disabled

      cause:com.crystaldecisions.enterprise.ocaframework.idl.OCA.oca_abuse: IDL:img.seagatesoftware.com/OCA/oca_abuse:3.2

      detail:An error occurred at the server :

      All the servers with CMS

      Server name

      , cluster

      Server name

      and kind cms are down or disabled

      at com.crystaldecisions.sdk.exception.SDKServerException.map(Unknown Source)

      at com.crystaldecisions.sdk.exception.SDKException.map(Unknown Source)

      at com.crystaldecisions.sdk.occa.infostore.internal.InternalInfoStore.queryHelper(Unknown Source)

      at com.crystaldecisions.sdk.occa.infostore.internal.InternalInfoStore.query(Unknown Source)

      at com.crystaldecisions.sdk.occa.infostore.internal.at.query(Unknown Source)

      at com.ari.createbouser.CreateBI4User.addUsers(CreateBI4User.java:159)

      at com.ari.createbouser.CreateBI4User.main(CreateBI4User.java:60)

      Caused by: com.crystaldecisions.enterprise.ocaframework.idl.OCA.oca_abuse: IDL:img.seagatesoftware.com/OCA/oca_abuse:3.2

      at com.crystaldecisions.enterprise.ocaframework.OCAFrameworkException.for(Unknown Source)

      at com.crystaldecisions.enterprise.ocaframework.e.invoke(Unknown Source)

      at com.crystaldecisions.sdk.occa.infostore.internal.am.queryEx3(Unknown Source)

      ... 5 more

  • Jun 28, 2017 at 01:41 AM

    Bharath,

    Thanks for the sample java code. Since we have expertise in .net area, we are planning to use that. We got the sample code for .net , it is working for BI4, but not for BI3. We are getting error message, while trying to add users "Access denied. You cannot log on to an older version of the CMS".

    We used the code from below. Link says, it should work for 3.1, but did not.

    https://archive.sap.com/documents/docs/DOC-50603

    Add comment
    10|10000 characters needed characters exceeded