cancel
Showing results for 
Search instead for 
Did you mean: 

MDM4J API - Login Code Error

Former Member
0 Kudos

Hi All

We encounter issue while logging into repository using MDM API.

We are using MDM SP05 and MDM4J API.

We receive the following error in logs

java.lang.IllegalStateException: Login method has not been successfully called.

java.lang.IllegalStateException: Login method has not been successfully called.

at a2i.common.CatalogData.Preprocess(Unknown Source)

at a2i.common.CatalogData.GetRecordsByValue(Unknown Source)

at a2i.common.CatalogData.GetRecordsByValue(Unknown Source)

Please help us finding the cause for this error.

Here is the code that we have for login functionality

public class PublishCatalog{

private static CatalogData catalogData;

private static CatalogCache catalogImageCache;

private static CatalogCache documentCache;

private static Object catalogLock = new Object();

private static final LogWrapper log = new LogWrapper(PublishCatalog.class, "com.ges.pca.mdme.PublishCatalog");

public PublishCatalog(){}

public static CatalogData getCatalogData(){

if(catalogData == null){

String server = System.getProperty("GES.PublishCatalog.server");

int port = Integer.parseInt(System.getProperty("GES.PublishCatalog.port"));

String user = System.getProperty("GES.PublishCatalog.user");

String password = System.getProperty("GES.PublishCatalog.password");

int minCon = -1;

int maxCon = -1;

int timeOut = -1;

try{

minCon = Integer.parseInt(System.getProperty("GES.PublishCatalog.minCon"));

}

catch(Exception e){

minCon = 2;

}

try {

maxCon = Integer.parseInt(System.getProperty("GES.PublishCatalog.maxCon"));

}

catch(Exception e){

maxCon = 8;

}

try{

timeOut = Integer.parseInt(System.getProperty("GES.PublishCatalog.timeOut"));

}

catch(Exception e){

timeOut = 0;

}

String logFile = System.getProperty("GES.PublishCatalog.logfile");

synchronized(catalogLock){

if(catalogData == null){

catalogData = new CatalogData();

int status = catalogData.Login(server, port, user, password, "English [US]", minCon, maxCon, timeOut, logFile);

if(status != 0){

catalogData = null;

log.error("Unable to connect to the Publish Catalog on " + server + ":" + port + " MDMEErrorCode: " + status);

}

}

}

}

return catalogData;

}

}

Thanks

Prakash

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Parkash,

Not sure just idea.

Try after " import a2i.common.* ";

import a2i.core.*;

so on....

BR,

Alok