cancel
Showing results for 
Search instead for 
Did you mean: 

ISearchResult

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi

Thanks for the answer what do you mean with UME?

rgds

Pascal

Former Member
0 Kudos

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.