on 02-04-2014 3:42 PM
HI,
i need some help with my first scheduler task in the 7.3 Netweaver :
I am trying to get a XML Document stored in KM
public Vector<String> initializeUserData(String exceptionList){
IResourceFactory resurceFactory = null;
IResource resourceUser = null;
Document userDoc = null;
Vector<String> users = new Vector<String>();
try {
IServiceUserFactory userfact=UMFactory.getServiceUserFactory();
IUser tempUser = userfact.getServiceUser("cmadmin_service");
IResourceContext ctxt = ResourceContext.getInstance(tempUser);
if (logger.beDebug())
logger.debugT("initializeData ctxt: " + ctxt);
RID userNotToChange = RID.getRID(exceptionList);
resurceFactory = ResourceFactory.getInstance();
if (logger.beDebug()){
logger.debugT("initializeData resurceFactory: " + resurceFactory);
}
resourceUser = resurceFactory.getResource(userNotToChange, ctxt);
userDoc = parseXML(resourceUser.getContent().getInputStream());
users = fillUserList(userDoc);
} catch (ResourceException e) {
logger.errorT("ResourceException initializeData: " + getStackTrace(e));
} catch (Exception ex) {
logger.errorT("Exception initializeData: " + getStackTrace(ex));
}
return users;
}
The result is the following Exception:
avax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/sapportals/portal/security/usermanagement/UserManagementException
java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/sapportals/portal/security/usermanagement/UserManagementException
which points to the following line :
IResourceContext ctxt = ResourceContext.getInstance(tempUser);
I have referenced the JAR in the build path:
tc~je~usermanagement~api.jar
Any ideas ?
Hi,
The reason is that the ResourceContext in the background references the com.sapportals.portal.security.usermanagement.UsermanagementException. This is not par of the tc~je~usermanagement~api.jar, which only contains the JEE level UME (com.sap.security. ...).
So, as discussed today, a scheduler task which refers to KM should be implemented as a KM scheduler task (and not a scheduled job two layers above).
Best regards
Detlev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kai,
How you solved this issue?
apart from tc~je~usermanagement~api.jar, whether we have to reference any other?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kai & Mr. Ram,
> cannot use UME Functions in Scheduler Tasks (which are part of the NW AS and not the portal).
That's not correct. Of course one can use UME functionality in WAS scheduler jobs, and for this the reference tc~je~usermanagement~api.jar is correct and sufficient. In this thread, the original issue came from using KM functionality, which refers to old "portal-subpart-pseudo-UME" classes.
So as long as no KM is addressed but solely WAS functionality (including WAS UME), all this is possible in a WAS scheduler job (and, at the same time, as soon as KM should be used, it is much better design to use KM scheduler tasks for this!).
@Mr Ram: The question if you need to add references depends on what you are developing. The given reference should be sufficient for UME, but if you refer to other stuff, additional references might be needed. But this should be discussed in a new thread with a concrete question - means if you cannot get something running for missing references...
Hope it clarifies this
Detlev
Thanks Kai.
I am doing some development with 7.3, which uploads couple of documents to KM folder.
I was using the similar code and struck with same error.
Whether you have any suggestions for me?
java.lang.NoClassDefFoundError: com/sapportals/portal/security/usermanagement/UserManagementException
at com.sap.coll.km.uploadDoc.doContent(uploadDoc.java:63)
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.