on 01-26-2007 9:32 AM
Dear All,
I have added a new service user i"contract_service" in the following two places:
1) UM
2)System Administration->System Configuration->(In detail Navigation)Knowledge Management->Content Management and in configuration iview go to Utilities->System Principals->System User
An exception arrises when I try to create a KM folder with "contract_serive" user.
The exception is as follows:<b>com.sapportals.portal.security.usermanagement.UserManagementException: Could not get service user "contract_service".</b> at com.sapportals.portal.security.usermanagement.ServiceUserFactoryImpl.getServiceUser(ServiceUserFactoryImpl.java:54) at com.sap.dc.AttachmentCompInterface.CreateKMFolder
I used the following piece of codes to get service user...
private static final String CONTRACT_SERVICE_USER = "contract_service";
//create an user object from the current user
com.sapportals.portal.security.usermanagement.IUser serviceUser = WPUMFactory.getServiceUserFactory().getServiceUser(CONTRACT_SERVICE_USER);
Can anyone point out where I may do wrongly?
thanks,
Zita
Hi All,
No body answered me!
I have created the service user programmly by using the piece of code:
private static final String CONTRACT_SERVICE_USER = "contract_service";
try{
serviceUser =(com.sap.security.api.IUser) AccessController.doPrivileged
(
new PrivilegedExceptionAction()
{
public Object run() throws UMException
{
IUserManagementEngine umService = (IUserManagementEngine)
PortalRuntime.getRuntimeResources().getService(
IUserManagementEngine.KEY );
IServiceUserFactory userFactory = umService.getServiceUserFactory();
com.sap.security.api.IUser user = null;
try
{
userFactory.createServiceUser(CONTRACT_SERVICE_USER );
user = (com.sap.security.api.IUser)userFactory.getServiceUser
(CONTRACT_SERVICE_USER );
}
catch (UMException ex)
{
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
ex.printStackTrace(pw);
String str = sw.toString();
}
return user;
}
}
);
}
catch (PrivilegedActionException ex)
{
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
ex.printStackTrace(pw);
String str = sw.toString();
}
return serviceUser;
}
I also create this "contract_service" in the following two places:
1) UM
2)System Administration->System Configuration->(In detail Navigation)Knowledge Management->Content Management and in configuration iview go to Utilities->System Principals->System User
But when I tried to print out something like this "user.getFirstName()"....I got an "null pointer exception". Funny thing is that I did not get any exception in the line "userFactory.createServiceUser(CONTRACT_SERVICE_USER );"
I used this created user name to create a KM folder and the modified name showed "anonymous".
Can anyone kindly tell me or share with me your experieces in creating a service user?
thanks alot,
Zita
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
No body answered me!
I have created the service user programmly by using the piece of code:
private static final String CONTRACT_SERVICE_USER = "contract_service";
try{
serviceUser =(com.sap.security.api.IUser) AccessController.doPrivileged
(
new PrivilegedExceptionAction()
{
public Object run() throws UMException
{
IUserManagementEngine umService = (IUserManagementEngine)
PortalRuntime.getRuntimeResources().getService(
IUserManagementEngine.KEY );
IServiceUserFactory userFactory = umService.getServiceUserFactory();
com.sap.security.api.IUser user = null;
try
{
userFactory.createServiceUser(CONTRACT_SERVICE_USER );
user = (com.sap.security.api.IUser)userFactory.getServiceUser
(CONTRACT_SERVICE_USER );
}
catch (UMException ex)
{
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
ex.printStackTrace(pw);
String str = sw.toString();
}
return user;
}
}
);
}
catch (PrivilegedActionException ex)
{
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
ex.printStackTrace(pw);
String str = sw.toString();
}
return serviceUser;
}
I also create this "contract_service" in the following two places:
1) UM
2)System Administration->System Configuration->(In detail Navigation)Knowledge Management->Content Management and in configuration iview go to Utilities->System Principals->System User
But when I tried to print out something like this "user.getFirstName()"....I got an "null pointer exception". Funny thing is that I did not get any exception in the line "userFactory.createServiceUser(CONTRACT_SERVICE_USER );"
I used this created user name to create a KM folder and the modified name showed "anonymous".
Can anyone kindly tell me or share with me your experieces in creating a service user?
thanks alot,
Zita
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.