Fórumok

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

anand gopalan, módosítva 11 év-val korábban

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

Expert Bejegyzések: 442 Csatlakozás dátuma: 2012.03.02. Legújabb bejegyzések
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.

Mellékletek:

anand gopalan, módosítva 11 év-val korábban

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

Expert Bejegyzések: 442 Csatlakozás dátuma: 2012.03.02. Legújabb bejegyzések
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, módosítva 11 év-val korábban

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

Liferay Master Bejegyzések: 522 Csatlakozás dátuma: 2011.08.29. Legújabb bejegyzések
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, módosítva 11 év-val korábban

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

Expert Bejegyzések: 442 Csatlakozás dátuma: 2012.03.02. Legújabb bejegyzések
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, módosítva 11 év-val korábban

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

Expert Bejegyzések: 442 Csatlakozás dátuma: 2012.03.02. Legújabb bejegyzések
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, módosítva 11 év-val korábban

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

Expert Bejegyzések: 442 Csatlakozás dátuma: 2012.03.02. Legújabb bejegyzések
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, módosítva 11 év-val korábban

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

Expert Bejegyzések: 289 Csatlakozás dátuma: 2012.05.20. Legújabb bejegyzések
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

Mellékletek:

anand gopalan, módosítva 11 év-val korábban

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

Expert Bejegyzések: 442 Csatlakozás dátuma: 2012.03.02. Legújabb bejegyzések
Hello Vishal,

I have done as per your suggestion.
But it gives same error.
Siby Mathew, módosítva 11 év-val korábban

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

Expert Bejegyzések: 268 Csatlakozás dátuma: 2011.03.04. Legújabb bejegyzések
Hi Anand,
As per your attachment here , you dont have primary="true" for your empId.
Please add that and rebuild your services.

Thanks,
Siby