cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a user in EP using a java standalone application

Former Member
0 Kudos

Hi,

I am trying to create a java application to create a user in Enterprise Portal.

I am getting the following error:

com.sap.security.api.UMRuntimeException: Cannot lookup ManageConnectionFactory "jdbc/sapep". Possible reasons: 1) The connector in which ManagedConnectionFactory "jdbc/sapep" is defined is not deployed or not started, 2) Cannot deserialize object due to a naming exception.

ume.db.connection_pool_type=jdbc/sapep

ume.db.connection_pool.j2ee.xatransactions_used=false

ume.db.connection_pool.j2ee.is_unicode=true

ume.db.connection_pool.j2ee.oracle_native_driver_used=false: Cannot lookup ManageConnectionFactory "jdbc/sapep". Possible reasons: 1) The connector in which ManagedConnectionFactory "jdbc/sapep" is defined is not deployed or not started, 2) Cannot deserialize object due to a naming exception.

Q1. Is it possible to create user from java standalone application.

Q2. Pls. help to resolve the error or give any sample code if you have

Thanks in advance.

Regards,

Pratik

Accepted Solutions (0)

Answers (2)

Answers (2)

thecodester
Developer Advocate
Developer Advocate
0 Kudos

Hi Ravi,

How about something like this:

IUserMaint user = UMFactory.getUserFactory().newUser("myNewUser");

user.setFirstName("1st Name");

user.setLastName("2nd Name");

user.setEmail("abc.xyz@sap.com");

user.save();

user.commit();

IUserAccount uacc = UMFactory.getUserAccountFactory().newUserAccount("myNewUser", user.getUniqueID());

uacc.setPassword("initial");

uacc.setPasswordChangeRequired(false);

uacc.save();

uacc.commit();

Hope this helps.

Daniel

Former Member
0 Kudos

Hi Daniel,

Thanks for the response. Infact the stand alone java program should retrieve the new user portal id and corresponding user group from DB and assign the user to the group.

Please let me know how this could be implemented in a stand alone java program.

thanks,

prasad

Former Member
0 Kudos

Hi,

I am unable to understand the reason for having a standalone application for user creation, while you have http://<ip>:<port>/useradmin

The lookup for SAP datasource is SAP<instace name>DB i.e SAPJ2EDB so i think you should use jdbc/SAPJ2EDB

Regards,

S.Divakar

Former Member
0 Kudos

Hi,

Thanks for the reply.

This need arose because my main application is a stand alone java application. Now I want to interface it with EP using standard APIs provided by SAP for user creation

Thanks,

Pratik

Former Member
0 Kudos

Hi Pratik,

I need to implement some what same functionality using a stand alone java program. I was wondering, if you found a solution. Any help is greatly appreciated.

Prasad

thecodester
Developer Advocate
Developer Advocate
0 Kudos

Hi,

The above code uses the UME API, which is not a portal service.

I can run the API without the use of the portal; sometimes I create a JSP page run by the Web AS in order to create a new user (again, without the portal).

Daniel