on 04-03-2007 7:39 PM
Hi,
I´m trying to obtain a Repository Schema and I´m getting the following exception:
com.sap.mdm.commands.CommandException: com.sap.mdm.internal.protocol.manual.ServerException: Relationship not found.
at com.sap.mdm.schema.commands.GetRelationshipListCommand.execute(Unknown Source)
at com.sap.mdm.schema.commands.GetRepositorySchemaCommand.execute(Unknown Source)
at test.com.mycompany.TestJavaAPI.main(TestJavaAPI.java:80)
Caused by: com.sap.mdm.internal.protocol.manual.ServerException: Relationship not found.
at com.sap.mdm.internal.protocol.manual.AbstractProtocolCommand.execute(AbstractProtocolCommand.java:110)
... 3 more
I´m on MDM 5.5 SP4 P3 (5.5.35.16) on both server and client side.
I took pieces of code from
<a href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4ee2fc9a-0e01-0010-50ad-cfd44598b843">SAP NetWeaver MDM 5.5 SP3 and SP4 JAVA Admin API - Webinar Powerpoint</a>.
My code is the following:
String host = "<hostname>";
try {
// Get Connection
ConnectionAccessor conn = getConnection(host);
// Get Repository ID (DBMSName took from MDM Console)
RepositoryIdentifier repID = getRepositoryIdentifier(
conn, "<Repository Name>", "<DBMSName>", DBMSType.ORACLE);
// Repository Session
CreateRepositorySessionCommand repSession =
new CreateRepositorySessionCommand(conn);
repSession.setRepositoryIdentifier(repID);
repSession.execute();
// Repository ID
String repSessionString = repSession.getRepositorySession();
// Repository Authentication
AuthenticateRepositorySessionCommand authRep =
new AuthenticateRepositorySessionCommand(conn);
authRep.setSession(repSessionString);
authRep.setUserName("<username>"); // Ignored in SP4
authRep.setUserPassword("<password>"); // Server password
authRep.execute();
// Get Scheme
GetRepositorySchemaCommand repSchema = new GetRepositorySchemaCommand(conn);
repSchema.setSession(repSessionString);
// !!! This line throws the exception !!!
repSchema.execute();
RepositorySchema schema = repSchema.getRepositorySchema();
TableProperties tableProps = schema.getTable("Products");
TableId tableId = tableProps.getId();
System.out.println(tableId.getString());
} catch (CommandException e) {
e.printStackTrace();
return;
} catch (ConnectionException e) {
e.printStackTrace();
return;
}
¿ Can anybody figure out what I'm doing wrong ?
Any help will be appreciated.
Regards,
Daniel Sacco
Hi Daniel
We encountered the same problem. It was attributed to a bug in the API. The simple solution is to create a "Relationships" table (using the MDM Console) in your repository that you're connecting to with the API.
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Make sure that the MDM API jars and the MDM Server match.
All the components have to be compatible.
Message was edited by:
Adhappan Thiagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Adhappan,
Thanks for your quick response.
I tried your code replacing host, user, password and repository data and it throws the same exception. After that I compared line by line your code with mine and both are the same but with a different structure. Maybe my code works well in your environment.
¿ Can you tell the version of your MDM ? Maybe the version I´m using has a bug.
Regards,
Daniel
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.