Liferay is a Gartner Magic Quadrant Leader for the Sixth Year! Find out why

Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Bharani Ravi Kanth
Problem in creating new User
March 27, 2012 4:55 AM
Answer

Bharani Ravi Kanth

Rank: Junior Member

Posts: 63

Join Date: January 19, 2012

Recent Posts

Hello Guys,

I have used UserLocalServiceUtil to create user by taking the values from the Jsp page and later i have used user UserLocalService.addUser(.....) method to store the values into the database and i have successful in storing the values in the table but i cannot login by using using the credentials. Can you Guys tell me where am i doing wrong?

Regards

-Bharani
Jitendra Rajput
RE: Problem in creating new User
March 27, 2012 5:00 AM
Answer

Jitendra Rajput

Rank: Liferay Master

Posts: 858

Join Date: January 7, 2011

Recent Posts

Is your user is active ?
If not then activate it..

1user.setActive(true);
Bharani Ravi Kanth
RE: Problem in creating new User
March 27, 2012 5:18 AM
Answer

Bharani Ravi Kanth

Rank: Junior Member

Posts: 63

Join Date: January 19, 2012

Recent Posts

Hi Jitendra

i have have made my user active and my problem didn't solve yet.

Regards
bharani
Jitendra Rajput
RE: Problem in creating new User
March 27, 2012 5:23 AM
Answer

Jitendra Rajput

Rank: Liferay Master

Posts: 858

Join Date: January 7, 2011

Recent Posts

If possible can you tell me how you are adding new user ?
Manikandan S
RE: Problem in creating new User
March 27, 2012 5:25 AM
Answer

Manikandan S

Rank: Expert

Posts: 492

Join Date: September 15, 2010

Recent Posts

Give reindexing code after adding the user in your java class
Bharani Ravi Kanth
RE: Problem in creating new User
March 27, 2012 5:44 AM
Answer

Bharani Ravi Kanth

Rank: Junior Member

Posts: 63

Join Date: January 19, 2012

Recent Posts

For reindexing the code should i include portal-impl.jar in my project?
Manikandan S
RE: Problem in creating new User
March 27, 2012 6:04 AM
Answer

Manikandan S

Rank: Expert

Posts: 492

Join Date: September 15, 2010

Recent Posts

Yes..

Are you able to see your user in group_ table?
Hitoshi Ozawa
RE: Problem in creating new User
March 27, 2012 6:07 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Just to check, go to Control Panel -> Server Administration -> select the "reindex all search indexes" button.
Check if you can login.
Hitoshi Ozawa
RE: Problem in creating new User
March 27, 2012 6:14 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

If reindexing works, try adding the following:

Indexer indexer = IndexerRegistryUtil.getIndexer(User.class);
indexer.reindex(user);
Bharani Ravi Kanth
RE: Problem in creating new User
March 27, 2012 11:38 PM
Answer

Bharani Ravi Kanth

Rank: Junior Member

Posts: 63

Join Date: January 19, 2012

Recent Posts

Sorry for replying late. Even i included the the reindexing code. but i cannot login.
Manikandan S
RE: Problem in creating new User
March 28, 2012 1:53 AM
Answer

Manikandan S

Rank: Expert

Posts: 492

Join Date: September 15, 2010

Recent Posts

Are you getting any error in server log?
Hitoshi Ozawa
RE: Problem in creating new User
March 28, 2012 2:18 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Login as admin, go to Control Panel -> User

Check if the user exists. If the user exists, try changing the password and try to login again with the new password.
Bharani Ravi Kanth
RE: Problem in creating new User
March 28, 2012 4:51 AM
Answer

Bharani Ravi Kanth

Rank: Junior Member

Posts: 63

Join Date: January 19, 2012

Recent Posts

Please don't mind in asking this...can you people give me a working sample code which is used to add users.
Hitoshi Ozawa
RE: Problem in creating new User
March 28, 2012 5:52 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Please don't mind in asking this...can you people give me a working sample code which is used to add users.


Just check Liferay's source code. If you can't understand it, you probably can't understand other's source code as well.

Probably better if you just attach you code for others to check.
Paul Butenko
RE: Problem in creating new User
March 28, 2012 6:11 AM
Answer

Paul Butenko

Rank: Junior Member

Posts: 38

Join Date: July 1, 2010

Recent Posts

Hello,
You can check this post, it has some source code examples for adding user.

BR,
Paul Butenko
Bharani Ravi Kanth
RE: Problem in creating new User
April 2, 2012 11:22 PM
Answer

Bharani Ravi Kanth

Rank: Junior Member

Posts: 63

Join Date: January 19, 2012

Recent Posts

The problem which i am facing is the User user information is stored in the User_ table but i cannot see the user which i have created in the Control panel
and i even cannot send the mail(new Account created notification) to the respective email id. and there are no errors displayed in the console.
Bharani Ravi Kanth
RE: Problem in creating new User
April 4, 2012 4:21 AM
Answer

Bharani Ravi Kanth

Rank: Junior Member

Posts: 63

Join Date: January 19, 2012

Recent Posts

this is my code please review it and tell me where i am doing the mistakes
ragards
bharani
Attachments: Add_new_Employee.zip (26.5k)