on 06-23-2017 4:50 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 disabledcause: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
, clusterServer name
and kind cms are down or disabledat 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
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.