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

ISearchResult

Hi all

I've got the following problem. I get a IncompatibleClassChangeError when I try to cast a result from the ISearchResult-Object in a string.

All the try statements I didn't wrote!

Codefragment:

IUserFactory iuf = UMFactory.getUserFactory();

IUserSearchFilter iusf;

IUserFactory iusf = iuf.getUserSearchFilter();

ISearchResult isr = iuf.searchUsers(iusf);

String str = (String)isr.next();

I have the same error when I try do it like that:

Codefragment

Object o = isr.next();

Does somebody know what kind of Object the next-Method from the ISearchResult returns? In the API the return value is defined as a java.lang.Object.

For help I would be pleased

greets

pascal

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 03, 2005 at 08:51 AM

    Hi Pascal,

    the Javadoc of class IncompatibleClassChangeError states: Thrown when an incompatible class change has occurred to some class definition. The definition of some class, on which the currently executing method depends, has since changed.

    Could it be that you are using different versions of some UME libs when compiling as compared to your runtime environment?

    The following code works for me:

    IUserFactory userFactory = UMFactory.getUserFactory();
    IUserSearchFilter searchFilter = userFactory.getUserSearchFilter();
    searchFilter.setUniqueName(userSearchString, ISearchAttribute.LIKE_OPERATOR , false);
        		
    ISearchResult searchRes = userFactory.searchUsers(searchFilter);
        		
    while (searchRes.hasNext()) {
       String uniqeID = searchRes.next().toString();
       IUser user = UMFactory.getUserFactory().getUser(uniqeID); 
    ...

    Hope that helps. In case it does, please reward some points.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 03, 2005 at 09:11 AM

    Hi

    Thanks for the answer what do you mean with UME?

    rgds

    Pascal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 03, 2005 at 09:38 AM

    UME = User management engine. Probably you need only com.sap.security.api.jar in your classpath. maybe you should download this jar from your portal and then compile against it.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 03, 2005 at 10:12 AM

    Hi All

    I fixed the problem.

    Here a little hint that can be helpful.

    If you are working with Eclipse or netWeaver Development Studio delete all the automatic generated Libraries for the Java Build Path and insert only external Libraries directly from the portal J2EE-engine.

    Kind regards to you all

    pascal

    Add a comment
    10|10000 characters needed characters exceeded

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.