cancel
Showing results for 
Search instead for 
Did you mean: 

ConnectionFailedException: Connection Failed: Catalog failed to login

Former Member
0 Kudos

Hi,

I am unable to connect to MDM Repository using MDM API's. I am getting the error mentioned above at this line:

connection = connectionFactory.getConnectionEx(spec);

The method returns null value.

I am on MDM 5.5 Patch 03

I have checked the userid, password, MDM server and port are right.

I am getting all the values set for IConnectionSpec and ConnectFactory lookup returns the object properly.

I have checked the thread with similar issue , considering I am on the latest patch, I am not able to figure out where the Issue is (patch issue is suggested over there).

In Visual Administrator, the JNDI Registry for mdm adapter is also proper. In the server log file it says connection refused, but I am unable to get the reason as I am able to loggon with the same user credentials to the MDM Server thru MDM Console.

Please help on this.

Regards,

Anish

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I had a similar issue that was happening because my versions were slightly different. The version of the Java API that I had in my classpath was 5.5.35.16 and the version of the MDM software on the server was 5.5.34.26. Check very closely to see the exact versions of the software / api you are using to make sure they are the same.

Former Member
0 Kudos

Hi Harrison,

Thanks for the reply. Yes my MDM Console and Java APIs are at slightly different versions, will bring them at the same level and get back to you on the status of my Issue.

Do let me know, if u have any other suggestions ...

Regards,

Anish

Former Member
0 Kudos

Hi,

I am able to loggon to the server now, it was the version Issue after all, Thanks for the reply, Harrison. But Now I have a different issue. I am able to read the records. but when I try to write a record I am getting this error.

a2i.core.StringException: AddRecord error

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

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

at Create.addRecord(Create.java:421)

at Create.runExample(Create.java:59)

at Create.<init>(Create.java:40)

at Create.main(Create.java:51)

I have tested the connection, with getReadyStatus() on CatalogData (before calling the addRecord() method) it returns value 1 not zero (which for connection is ok). I tried login out and loggin again, after which though I got the connection status right, the original issue of AddRecord error persists.

Kindly help on that.

Regards,

Anish

Former Member
0 Kudos

Hi Anish,

Can you please give some code snippet through which you are trying to Add record into MDM.

And is this related to connection? Was this code working previously and now it has stopped working because of the connection issues? or AddRecord and Connection are 2 different issues?

Regards,

Mausam

Former Member
0 Kudos

Hi,

These are different Issues, Basically I have written a simple code to add, modify and delete record from the MDM Table. The Initial Issue was that I was unable to connect to the MDM Server. That was resolved after, the versions were made similar.

Now I have another issue, I am able to read the records, but when I try to write a record the error mentioned in the previous post is coming.

This code was not working previously as I was getting stuck with the Connection Issue.

Now I am able to read the record, but not able to write one in the MDM Table.

The code is too lengthy to put here, but the error is coming at this line.

this.catalog.AddRecord(Schema.Products.TABLE, a2iFields,0,0);

Hope this info is enough,

Thanks in advance,

Anish

Former Member
0 Kudos

Anish,

How are you forming a2iFields list.

I mean, Are you trying to set any Flat Lookup with the code? If that is the case I would recommend you to first try to put in values in Direct field first.

Suppose, in Products table you are have having Material Number ( Code: MATNUM ), create the field like this,

Value val = new Value("Material Value");

a2iField fld = new a2iField("MATNUM",val);

a2iFields flds = new a2iFields();

flds.add(fld);

then, addRecord function.

You also have to check the length of the specified fields, like if MATNUM is of 10 chars and you are trying to put long string in that, this function will fail.

I would recommend you to open a new thread for the new issue.

Regards,

Mausam

"Please mark helpful answers"

Former Member
0 Kudos

Hi,

Value val = new Value("Material Value");

a2iField fld = new a2iField("MATNUM",val);

a2iFields flds = new a2iFields();

flds.add(fld);

This is what is making the code lengthy, also length is not an issue (I have checked), I am unable to understand "unknown source", in the error, is it unable to find the table ? Earlier, it was giving me invalid Parameter for wrong field names, but here it is not mentioning what is unknown, I am unable to debug this further.

Points assured for helpful answers

Thanks again,

Anish

Former Member
0 Kudos

Hi Anish,

"unknown source" is mistry till today.

I was not pointing towards coding length, that was regarding the field length in MDM and length you are passing from your application.

Are you trying to enter any data apart from normal Text field? Can you please post some code snippet you are using and the field list as from one line "AddRecord error", I wouldnt be able to deduce anything.

Regards,

Mausam

Former Member
0 Kudos

I was talking about the code length in the first sentence and field length in the second. Here is the code:

A2iFields a2iFields = new A2iFields();

//Name

A2iField a2iField = null;

Value value = null;

int ID = -1;

a2iField = new A2iField(Schema.Vendors.NAME);

value = new Value(name);

a2iField.SetValue(value);

a2iFields.Add(a2iField);

this is repeated for the other fields....

// add Record

catalog.AddRecord(Schema.Vendors.TABLE, a2iFields, 0, 0);

Regards,

Anish

Former Member
0 Kudos

Anish,

The code looks fine to me for the Text type field in MDM repository.

Just check if any of the field is of type LookUp flat, you will have to provide RecordId of the value you are trying to save.

Just a check, does Schema.Vendors.* contains Code of the fields or Name of the fields? It should have Code of the fields.

Regards,

Mausam

Former Member
0 Kudos

Hi,

To elaborate on the error I am getting now:

I tried adding values only to plain text field it is adding the record in the main table, but I am unable to set value to Lookup Flat fields while adding record.

My Scenario is as follows:

I have a main Vendor Table, which has a Lookup flat field Region, Region in turn has Lookup Flat field Country. When I try the following code for adding Lookup Flat field Region it gives error (StackTrace mentioned in above post)

Code:

a2iField = null;

value = null;

ID = -1;

ID =

getRecordID(

Schema.Regions.TABLE,

Schema.Regions.REGION_CODE,

Region_Code);

if (ID != -1) {

a2iField = new A2iField(Schema.Vendors.REGION);

value = new Value(ID);

value.GetStringValue();

a2iField.SetValue(value);

a2iFields.Add(a2iField);

In the StackTrace mentioned in post above the "unknown source" is bcoz source file for CatalogData is not available.

Can anyone provide a sample code to add lookup flat field here.

I have got this example in one of the thread posted here, but I am not sure this is the answer to my issue:

Example:

Search search = new Search(table name to be passed here);

SearchParameters sParam = search.GetParameters();

//get a new lookup parameter for the table/field combination

LookupParameter lookupParameter = sParam.NewLookupParameter("main Tablename to be passsed here, lookup field name to be passed here);

//find the mdm record id for lookup table facility id and facilty type. - You can use a search technque to arrive at this id as well

// add the new parameter to the search object

lookupParameter.add(recordid)

Please provide a suitable example code pertaining to my Issue.

Points assured for helpful answer

Regards,

Anish

Former Member
0 Kudos

Hi Anish,

Great to see that you are able to create records in Main Table with simple text fields.

When you want to set the value in Look Up flat field, you will need RecordID of that value from the LookUp table.

First, go and fetch the records from the LookUp table i.e. Regions here.

You can do this with CatalogData.getResultSet(). This should give you a2IResultSet.

Traverse ResultSet and find out the value that you want to set. Get the record ID.

Now, create the a2IField object and set the Code of the field and put record ID in the Value object.

Hope this helps.

Regards,

Mausam

Former Member
0 Kudos

Hi,

Thanks for replying. I am not sure if you saw the Code: mentioned in my post above, I have done exactly the same thing, what you have said. Can you tell me where I am going wrong or is there other way to fetch the Record ID for Nested Lookup Flat Fields

Some more information on Region Table:

Unique Fields: Country+Region

Key Mapping: Yes

Q: Does these paramters affect the way we retreive the records or retreival is independant of it ?

Regards,

Anish

Former Member
0 Kudos

Hi Anish,

I have the same connection problem like you:

<i>com.sapportals.connector.connection.ConnectionFailedException: Connection Failed: failed to connect server BARTON due to:com/sap/mdm/internal/commands/AbstractCommand

at com.sap.mdm.connector.connection.MdmConnectionFactory.getConnectionEx(MdmConnectionFactory.java:173)

</i>

My MDM4J.jar and the MDM Java API jars have version 5.5.35.16, MDM Server and MDM Data Manager have the version 5.5.35.46

I was told that these versions work together, but using WD type DC over Portal, the connection is not successful.

How did you solve the problem?

Thank & Regards,

Peter

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi to All,

I've got the same error (Unknown Source), could you please help me to find sources of library MDM4J in order to trace under debugging?

Has anybody documentation to library MDM4J ?

I managed to receive stack trace of exception that occured inside CatalogData.AddRecord

Could you please help me to find the reason of this problem ?

java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)

java.lang.Integer.parseInt(Integer.java:468)

java.lang.Integer.parseInt(Integer.java:518)

a2i.core.Value.ConvertToType(Unknown Source)

com.a2i.xcat.internal.conversion.StructsToStructsUtil.ConvertFieldsToModifiedFields(Unknown Source)

a2i.common.CatalogData.AddRecord(Unknown Source)

a2i.common.CatalogData.AddRecord(Unknown Source)

com.accenture.mdp.common.db.DBUtilDAO.addMultipleRecords(DBUtilDAO.java:419)

Edited by: Sergey Chernushenko on Sep 4, 2009 2:16 PM

Former Member
0 Kudos

Are you sure that you have the right JAR files?

Former Member
0 Kudos

Hi Lars,

I think I have the right Jars, Can you give details of the Jars you are talking about.

Regards,

Anish