Foren

No Employee exists with the key {emailaddress=test@liferay.com}

anand gopalan, geändert vor 11 Jahren.

No Employee exists with the key {emailaddress=test@liferay.com}

Expert Beiträge: 442 Beitrittsdatum: 02.03.12 Neueste Beiträge
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.
anand gopalan, geändert vor 11 Jahren.

RE: No Employee exists with the key {emailaddress=test@liferay.com}

Expert Beiträge: 442 Beitrittsdatum: 02.03.12 Neueste Beiträge
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());
thumbnail
Bart Simpson, geändert vor 11 Jahren.

RE: No Employee exists with the key {emailaddress=test@liferay.com}

Liferay Master Beiträge: 522 Beitrittsdatum: 29.08.11 Neueste Beiträge
What is the finder you have used ? set
hibernate.show_sql=true
in your portal-ext.properties and check the query being generated. You should start debugging your code!!
anand gopalan, geändert vor 11 Jahren.

RE: No Employee exists with the key {emailaddress=test@liferay.com}

Expert Beiträge: 442 Beitrittsdatum: 02.03.12 Neueste Beiträge
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
anand gopalan, geändert vor 11 Jahren.

RE: No Employee exists with the key {emailaddress=test@liferay.com}

Expert Beiträge: 442 Beitrittsdatum: 02.03.12 Neueste Beiträge
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.
anand gopalan, geändert vor 11 Jahren.

RE: No Employee exists with the key {emailaddress=test@liferay.com}

Expert Beiträge: 442 Beitrittsdatum: 02.03.12 Neueste Beiträge
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>
thumbnail
Vishal Panchal, geändert vor 11 Jahren.

RE: No Employee exists with the key {emailaddress=test@liferay.com}

Expert Beiträge: 289 Beitrittsdatum: 20.05.12 Neueste Beiträge
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
anand gopalan, geändert vor 11 Jahren.

RE: No Employee exists with the key {emailaddress=test@liferay.com}

Expert Beiträge: 442 Beitrittsdatum: 02.03.12 Neueste Beiträge
Hello Vishal,

I have done as per your suggestion.
But it gives same error.
Siby Mathew, geändert vor 11 Jahren.

RE: No Employee exists with the key {emailaddress=test@liferay.com}

Expert Beiträge: 268 Beitrittsdatum: 04.03.11 Neueste Beiträge
Hi Anand,
As per your attachment here , you dont have primary="true" for your empId.
Please add that and rebuild your services.

Thanks,
Siby