Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Anurag Piyush
ContactBirthdayException
December 27, 2012 10:25 PM
Answer

Anurag Piyush

Rank: New Member

Posts: 24

Join Date: July 19, 2012

Recent Posts

Hi,

I am using liferay6.1. I have created one custom portlet to import new users. While importing the users it throwing com.liferay.portal.ContactBirthdayException error. I have checked the Birthday and chenged it but still its throwing same error. I don't know how to resolve this error.

Can anyone suggest me.

Thanks,
Anurag
Hitoshi Ozawa
RE: ContactBirthdayException
December 29, 2012 4:14 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

Which method are you using to add user and what parameters are you passing? Should work.
Jelmer Kuperus
RE: ContactBirthdayException
December 29, 2012 4:30 AM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1192

Join Date: March 10, 2010

Recent Posts

If you get that exception then this check is failing

com.liferay.portal.kernel.util.Validator.isGregorianDate(month, day, year) for whatever you are passing in as birthday , maybe you swapped the day and month ?
Hitoshi Ozawa
RE: ContactBirthdayException
December 29, 2012 4:53 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

jelmer,
if he's using addUser method in UserLocalServiceUtil or UserLocalServiceImpl, month, day, and year parameters are passed as 3 int arguments (int birthdayMonth, int birthdayDay, int birthdayYear). I think one of them started from 0 instead of 1.
Anurag Piyush
RE: ContactBirthdayException
January 2, 2013 1:00 AM
Answer

Anurag Piyush

Rank: New Member

Posts: 24

Join Date: July 19, 2012

Recent Posts

Thanks for reply!

I have resolved the error. The exception was thrown because of month. I was trying to add 12 as a month which is invalid month because it counts month from 0 to 11.

Thanks emoticon
Anurag