Skip to Content
0

Create/Publish Connection SDK : Error (SLS 16002)

Mar 01, 2017 at 06:37 PM

151

avatar image

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

10 |10000 characters needed characters left characters exceeded

I may not be able to help you, but you'll be more likely to get an answer if you format your code and identify the line that produced the error.

0
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Michael Jennings Mar 10, 2017 at 03:28 PM
0

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


Thanks a lot,
MJ

:)

Share
10 |10000 characters needed characters left characters exceeded
Daniel Paulsen
Mar 02, 2017 at 12:15 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Michael Jennings Mar 02, 2017 at 06:28 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Daniel Paulsen
Mar 10, 2017 at 08:37 PM
0

Hi Michael,

Thanks for sharing your solution. It helps,

Dan

Share
10 |10000 characters needed characters left characters exceeded