Foros de discusión

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

anand gopalan, modificado hace 11 años.

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

Expert Mensajes: 442 Fecha de incorporación: 2/03/12 Mensajes recientes
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.

Archivos adjuntos:

anand gopalan, modificado hace 11 años.

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

Expert Mensajes: 442 Fecha de incorporación: 2/03/12 Mensajes recientes
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, modificado hace 11 años.

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

Liferay Master Mensajes: 522 Fecha de incorporación: 29/08/11 Mensajes recientes
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, modificado hace 11 años.

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

Expert Mensajes: 442 Fecha de incorporación: 2/03/12 Mensajes recientes
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, modificado hace 11 años.

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

Expert Mensajes: 442 Fecha de incorporación: 2/03/12 Mensajes recientes
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, modificado hace 11 años.

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

Expert Mensajes: 442 Fecha de incorporación: 2/03/12 Mensajes recientes
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, modificado hace 11 años.

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

Expert Mensajes: 289 Fecha de incorporación: 20/05/12 Mensajes recientes
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

Archivos adjuntos:

anand gopalan, modificado hace 11 años.

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

Expert Mensajes: 442 Fecha de incorporación: 2/03/12 Mensajes recientes
Hello Vishal,

I have done as per your suggestion.
But it gives same error.
Siby Mathew, modificado hace 11 años.

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

Expert Mensajes: 268 Fecha de incorporación: 4/03/11 Mensajes recientes
Hi Anand,
As per your attachment here , you dont have primary="true" for your empId.
Please add that and rebuild your services.

Thanks,
Siby