Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
a g
No Employee exists with the key {emailaddress=test@liferay.com}
October 18, 2012 12:33 AM
Answer

a g

Rank: Expert

Posts: 409

Join Date: March 2, 2012

Recent Posts

I put the break point below line

com.bc.od.model.Employee empDetails = EmployeeLocalServiceUtil.findByEmailAddress(user.getEmailAddress());

but it is not break any where, it means it will not hit the EmployeePortlet.java. My assumption is I misplaced java file?. plz see the screenshot

I am getting error in the console


Inside do view method
Inside do view() try
06:30:28,760 WARN [EmployeePersistenceImpl:479] No Employee exists with the key {emailaddress=test@liferay.com}
com.bc.od.NoSuchEmployeeException: No Employee exists with the key {emailaddress=test@liferay.com}
at com.bc.od.service.persistence.EmployeePersistenceImpl.findByEmailAddress(EmployeePersistenceImpl.java:482)


Vishal, siby and other do you have any idea. Please help me.
Attachment

Attachments: Portlet.jpg (31.2k)
a g
RE: No Employee exists with the key {emailaddress=test@liferay.com}
October 18, 2012 12:36 AM
Answer

a g

Rank: Expert

Posts: 409

Join Date: March 2, 2012

Recent Posts

For your information:

In both User_ & Employee Table has email address=test@liferay.com.


In other portlet I can able to fetch the all employees record. So Problem In condition only.

com.bc.od.model.Employee empDetails = EmployeeLocalServiceUtil.findByEmailAddress(user.getEmailAddress());
Bart Simpson
RE: No Employee exists with the key {emailaddress=test@liferay.com}
October 18, 2012 9:47 PM
Answer

Bart Simpson

Rank: Liferay Master

Posts: 524

Join Date: August 29, 2011

Recent Posts

What is the finder you have used ? set
1hibernate.show_sql=true
in your portal-ext.properties and check the query being generated. You should start debugging your code!!
a g
RE: No Employee exists with the key {emailaddress=test@liferay.com}
October 18, 2012 11:09 PM
Answer

a g

Rank: Expert

Posts: 409

Join Date: March 2, 2012

Recent Posts

Hello Bart,


I will check your suggestion and mean while I have attached the document(Screenshot). in below thered.
it will help you to where i did the mistake.

http://www.liferay.com/community/forums/-/message_boards/message/17229492
Vishal Panchal
RE: No Employee exists with the key {emailaddress=test@liferay.com}
October 18, 2012 11:23 PM
Answer

Vishal Panchal

Rank: Expert

Posts: 280

Join Date: May 20, 2012

Recent Posts

anand gopalan:
I put the break point below line

com.bc.od.model.Employee empDetails = EmployeeLocalServiceUtil.findByEmailAddress(user.getEmailAddress());

but it is not break any where, it means it will not hit the EmployeePortlet.java. My assumption is I misplaced java file?. plz see the screenshot

I am getting error in the console


Inside do view method
Inside do view() try
06:30:28,760 WARN [EmployeePersistenceImpl:479] No Employee exists with the key {emailaddress=test@liferay.com}
com.bc.od.NoSuchEmployeeException: No Employee exists with the key {emailaddress=test@liferay.com}
at com.bc.od.service.persistence.EmployeePersistenceImpl.findByEmailAddress(EmployeePersistenceImpl.java:482)


Vishal, siby and other do you have any idea. Please help me.



Hi anand,

I checked your attached file It looks everything right.
But have you ever tried below code by using any other emailAddress..?
EmployeeLocalServiceUtil.findByEmailAddress(user.getEmailAddress());

and one thing I doubt that in your database Employee table the field name you gave is emailaddress ,try to change it to emailAddress and
than clear database cache from control panel > serverAdministration
and try again.


hope it will work.

Thanks & Regards,
Vishal R. Panchal
Attachment

Attachments: Capture.PNG (58.6k)
a g
RE: No Employee exists with the key {emailaddress=test@liferay.com}
October 19, 2012 12:07 AM
Answer

a g

Rank: Expert

Posts: 409

Join Date: March 2, 2012

Recent Posts

Hello Vishal,

I have done as per your suggestion.
But it gives same error.
a g
RE: No Employee exists with the key {emailaddress=test@liferay.com}
October 19, 2012 1:38 AM
Answer

a g

Rank: Expert

Posts: 409

Join Date: March 2, 2012

Recent Posts

What is the finder you have used ? set
hibernate.show_sql=true
in your portal-ext.properties and check the query being generated.


Hello Bart,

I didn't find any where in this location (liferay-portal-6.1.0-ce-ga1\tomcat-7.0.23\webapps\MyEmployeLeave-portlet\WEB-INF\classes)portal-ext.properties file in my portlet.

I need to generate myself. Please send your comments.
a g
RE: No Employee exists with the key {emailaddress=test@liferay.com}
October 19, 2012 1:40 AM
Answer

a g

Rank: Expert

Posts: 409

Join Date: March 2, 2012

Recent Posts

Hello Bart,

sorry i forget inform about finder method,
below onle i am using
<!-- Finder methods -->
<finder name="EmailAddress" return-type="Employee">
<finder-column name="emailAddress" />
</finder>
Siby Mathew
RE: No Employee exists with the key {emailaddress=test@liferay.com}
October 19, 2012 5:05 AM
Answer

Siby Mathew

Rank: Expert

Posts: 265

Join Date: March 4, 2011

Recent Posts

Hi Anand,
As per your attachment here , you dont have primary="true" for your empId.
Please add that and rebuild your services.

Thanks,
Siby