Skip to Content
author's profile photo Former Member
Former Member

InterfaceNotSupportedException at MDM Java API

I wrote very simple SAP EP-application, which connects to MDM Repository:

public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)

{

try {

Context ctx = new InitialContext();

IConnectionFactory connectionFactory = (IConnectionFactory) ctx.lookup("deployedAdapters/MDM Factory/shareable/MDM Factory");

IConnectionSpec spec = connectionFactory.getConnectionSpec();

spec.setPropertyValue("Server", "mdm2");

spec.setPropertyValue("Port", "5678");

spec.setPropertyValue("UserName", "Admin");

spec.setPropertyValue("Password", "");

IConnection connection = connectionFactory.getConnectionEx(spec);

INative nativeInterface = connection.retrieveNative();

ConnectionAccessor connAccessor = nativeInterface.getNative(ConnectionAccessor.class.getName());

....

And I got strange exception:

com.sapportals.connector.connection.InterfaceNotSupportedException: Interface com.sap.mdm.net.ConnectionAccessor is not supported

at line "ConnectionAccessor connAccessor = nativeInterface.getNative(ConnectionAccessor.class.getName());".

I found out that if I pass a2i.common.CatalogData class instead of ConnectionAccessor to getNative method it works fine, but I need ConnectionAccessor!

I have following system configuration:

SAP EP 7.00 SP9

SAP MDM 5.5 SP5 (5.5.40.83)

What's wrong?

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2008 at 05:40 PM

    Hi, you have to connect using the connector architecture from the portal, like this:

    final String mdmFactory =

    "deployedAdapters/MDM Factory/shareable/MDM Factory";

    final String server = "10.15.6.44";

    final int port = 2010;

    final String user = "portal";

    final String password = "portal";

    IConnectionFactory connectionFactory = null; // Log, entering

    IConnectionSpec spec = null;

    IConnection connection = null;

    Context ctx = new InitialContext(); // Get the context

    connectionFactory = (IConnectionFactory) ctx.lookup(mdmFactory);

    spec = connectionFactory.getConnectionSpec();

    spec.setPropertyValue("UserName", user);

    spec.setPropertyValue("Password", password);

    spec.setPropertyValue("Server", server);

    spec.setPropertyValue("Port", port + "");

    spec.setPropertyValue("RepositoryLanguage", language);

    connection = connectionFactory.getConnectionEx(spec);

    INative nativeInterface = connection.retrieveNative();

    CatalogData catalog =

    (CatalogData) nativeInterface.getNative(

    CatalogData.class.getName());

    Hope this helps.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I've already tried to connect to my repository using MDM Java API at J2SE application, it works fine. The problem appears only when I try to use Portal's MDM connection mechanism (IConnectionFactory class and things like that).

  • author's profile photo Former Member
    Former Member
    Posted on Jan 16, 2008 at 04:34 PM

    What SP of MDM are you working on? If it is SP04,05,06 you shold use the new API, and, as you said, CatalogData is deprecated.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      I use MDM 5.5 SP05 and as you can see I already use new MDM Java API (and that is the problem). And now I probably found out the source of my problem: the aforementioned code I took from "SAP NetWeaver MDM 5.5 SP06 - MDM Connector (Java)" document and it seems that this code work only on SP06. Thus, possible solution of my problem is to switch to SP06, but I unable to check it sine I don't have MDM 5.5 SP06. If somebody does, please check whether this code works for you.

      But anyhow it doesn't completely solve my problem since I'm not able to switch my repository to SP06 (because of some technical reasons), and I have to use SP05 and make this code work.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.