Skip to Content

Create/Publish Connection SDK : Error (SLS 16002)

Hi All, When I execute my Java program in order to create and publish relational connection, I get the error : com.sap.sl.sdk.authoring.internal.AuthoringException: An error occurred while getting the list of connection drivers {0}. (SLS 16002) my code as below: package createnewuser; 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; import com.sap.sl.sdk.framework.SlContext; import com.sap.sl.sdk.framework.cms.CmsSessionService; import com.sap.sl.sdk.authoring.cms.CmsResourceService; import com.sap.sl.sdk.authoring.cms.internal.right.SessionRight; import com.sap.sl.sdk.authoring.connection.Connection; import com.sap.sl.sdk.authoring.connection.DatabaseConnection; import com.sap.sl.sdk.authoring.connection.DatabaseConnection.AuthenticationMode; import com.sap.sl.sdk.authoring.connection.ConnectionFactory; import com.sap.sl.sdk.authoring.connection.ConnectionParameter; import com.sap.sl.sdk.authoring.connection.ConnectionService; import com.sap.sl.sdk.authoring.connection.RelationalConnection; import com.sap.sl.sdk.authoring.local.LocalResourceService; import com.sap.sl.sdk.framework.SlContext; import com.sap.sl.sdk.framework.cms.CmsSessionService; import com.businessobjects.framework.*; import com.crystaldecisions.sdk.exception.SDKException; import com.crystaldecisions.sdk.framework.CrystalEnterprise; import com.crystaldecisions.sdk.framework.IEnterprisePrincipal; import com.crystaldecisions.sdk.framework.IEnterpriseSession; import com.crystaldecisions.sdk.framework.EnterpriseVersion; import com.crystaldecisions.sdk.framework.ISessionMgr; import com.crystaldecisions.sdk.framework.internal.SessionMgr; import com.crystaldecisions.sdk.properties.IProperties; import com.businessobjects.dsl.framework.session.SessionManager; public class createnewuser { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String CMS = "WIN-SADERTL72LE:6400"; String userID = "administrator"; String password = "Techedge01"; String auth = "secEnterprise"; IEnterpriseSession enterpriseSession; try { ISessionMgr mySessionMgr = CrystalEnterprise.getSessionMgr(); enterpriseSession = mySessionMgr.logon(userID, password, CMS,auth);

if (enterpriseSession != null) {//Create and store useful objects for the session.

SlContext context; context = SlContext.create();

context.getService(CmsSessionService.class).setSession(enterpriseSession); CmsResourceService service = context.getService(CmsResourceService.class);

String tempFolder = "c:\\Temp\\";

String user = "TEST_DB_USER"; // dbconnection.getParameter(DatabaseConnection.USER_NAME).getValue(); String pwd = "TEST_DB_PWD" ; String dbmsName = "MS SQL Server 2008" ; //dbconnection.getParameter(DatabaseConnection.DBMS).getValue(); String ntwkName = "OLE DB Providers" ; //dbconnection.getParameter(DatabaseConnection.NETWORK_LAYER).getValue(); String connName = "WIN-SADERTL72LE" ; //dbconnection.getParameter(DatabaseConnection.DATASOURCE).getValue(); String dbName = "TEST_DB"; String connectionName = "SDKTestRelationalConn";

com.sap.sl.sdk.authoring.connection.ConnectionFactory connectionFactory; connectionFactory = context.getService(com.sap.sl.sdk.authoring.connection.ConnectionFactory.class);

RelationalConnection connection = connectionFactory.createRelationalConnection(connectionName, dbmsName, ntwkName);

connection.getParameter("DATASOURCE").setValue(connName); connection.getParameter("DATABASE").setValue(dbName); connection.getParameter("USER_NAME").setValue(user); connection.getParameter("PASSWORD").setValue(pwd);

com.sap.sl.sdk.authoring.local.LocalResourceService localResourceService = context.getService(com.sap.sl.sdk.authoring.local.LocalResourceService.class); localResourceService.save(connection, tempFolder + connectionName + ".cnx", true);

service.publish(tempFolder + connectionName + ".cnx", "/Connections" , true); } enterpriseSession.logoff();

} catch(Exception e) { e.printStackTrace(); } } } Any help is appreciated Best regards,MJ

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Mar 10, 2017 at 03:28 PM

    Dear All,
    the error was related to 64Bit JVM, now using 32Bit JVM and its works!


    Thanks a lot,
    MJ

    :)

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 02, 2017 at 12:15 AM

    make sure you have a 32bit JVM installed and add the path <bo install dir>/SAP BusinessObjects Enterprise XI 4.0\win32_x86 to your path statement.

    There is a section in the SL Java SDK developer guide on "troubleshooting the Semantic Layer Java SDK" that addresses this error.

    Dan

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 02, 2017 at 06:28 PM

    Dear Joe/Daniel,

    below my java version (64Bit is not reported so I think I'm on 32Bit ) :

    java version "1.7.0_51"
    Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
    Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)

    And on my path I have the folder reported by you :

    SAP BOXI Installation folder\SAP BusinessObjects Enterprise XI 4.0\win32_x86;

    Below the code formatted :

    package createnewuser; 
    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;
    import com.sap.sl.sdk.framework.SlContext;
    import com.sap.sl.sdk.framework.cms.CmsSessionService;
    import com.sap.sl.sdk.authoring.cms.CmsResourceService;
    import com.sap.sl.sdk.authoring.cms.internal.right.SessionRight;
    import com.sap.sl.sdk.authoring.connection.Connection;
    import com.sap.sl.sdk.authoring.connection.DatabaseConnection;
    import com.sap.sl.sdk.authoring.connection.DatabaseConnection.AuthenticationMode;
    import com.sap.sl.sdk.authoring.connection.ConnectionFactory;
    import com.sap.sl.sdk.authoring.connection.ConnectionParameter;
    import com.sap.sl.sdk.authoring.connection.ConnectionService;
    import com.sap.sl.sdk.authoring.connection.RelationalConnection;
    import com.sap.sl.sdk.authoring.local.LocalResourceService;
    import com.sap.sl.sdk.framework.SlContext;
    import com.sap.sl.sdk.framework.cms.CmsSessionService;
    import com.businessobjects.framework.*;
    import com.crystaldecisions.sdk.exception.SDKException;
    import com.crystaldecisions.sdk.framework.CrystalEnterprise;
    import com.crystaldecisions.sdk.framework.IEnterprisePrincipal;
    import com.crystaldecisions.sdk.framework.IEnterpriseSession;
    import com.crystaldecisions.sdk.framework.EnterpriseVersion;
    import com.crystaldecisions.sdk.framework.ISessionMgr;
    import com.crystaldecisions.sdk.framework.internal.SessionMgr;
    import com.crystaldecisions.sdk.properties.IProperties;
    import com.businessobjects.dsl.framework.session.SessionManager;
    
    public class 
    createnewuser { /** * @param args */ public static void main(String[] args) { 
    // TODO Auto-generated method stub 
    
    String CMS = "WIN-SADERTL72LE:6400"; 
    String userID = "administrator"; 
    String password = "XFGYTRRE"; 
    String auth = "secEnterprise"; 
    IEnterpriseSession enterpriseSession; 
    
    try 
    { 
    ISessionMgr mySessionMgr = CrystalEnterprise.getSessionMgr(); 
    enterpriseSession = mySessionMgr.logon(userID, password, CMS,auth);
    
    if (enterpriseSession != null) {
    
    //Create and store useful objects for the session.
    SlContext context; 
    context = SlContext.create();
    context.getService(CmsSessionService.class).setSession(enterpriseSession);
    CmsResourceService service = context.getService(CmsResourceService.class);
    
    String tempFolder = "c:\\Temp\\";
    String user = "TEST_DB_USER"; 
    String pwd = "TEST_DB_PWD" ; 
    String dbmsName = "MS SQL Server 2008" ; 
    String ntwkName = "OLE DB Providers" ; 
    String connName = "WIN-SADERTL72LE" ; 
    String dbName = "TEST_DB"; 
    String connectionName = "SDKTestRelationalConn";
    
    com.sap.sl.sdk.authoring.connection.ConnectionFactory connectionFactory;
    connectionFactory = context.getService(com.sap.sl.sdk.authoring.connection.ConnectionFactory.class);
    
    RelationalConnection connection = connectionFactory.createRelationalConnection(connectionName, dbmsName, ntwkName);
    
    connection.getParameter("DATASOURCE").setValue(connName); 
    connection.getParameter("DATABASE").setValue(dbName); 
    connection.getParameter("USER_NAME").setValue(user); 
    connection.getParameter("PASSWORD").setValue(pwd);
    
    com.sap.sl.sdk.authoring.local.LocalResourceService localResourceService = context.getService(com.sap.sl.sdk.authoring.local.LocalResourceService.class);
    localResourceService.save(connection, tempFolder + connectionName + ".cnx", true);
    service.publish(tempFolder + connectionName + ".cnx", "/Connections" , true); } 
    
    enterpriseSession.logoff();
    } catch(Exception e) { 
    e.printStackTrace(); 
    } 
    } 
    }

    I get the error "com.sap.sl.sdk.authoring.internal.AuthoringException: An error occurred while getting the list of connection drivers {0}. (SLS 16002)" on line below :

    RelationalConnection connection = connectionFactory.createRelationalConnection(connectionName, dbmsName, ntwkName);

    Best regards,

    MJ

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 10, 2017 at 08:37 PM

    Hi Michael,

    Thanks for sharing your solution. It helps,

    Dan

    Add comment
    10|10000 characters needed characters exceeded