Code: Select all
Exception evaluating SpringEL expression: "termsAndConditions" (catalog/product:63)
Caused by:
org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "termsAndConditions" (catalog/product:63)
...
Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Property or field 'termsAndConditions' cannot be found on object of type 'org.broadleafcommerce.core.catalog.domain.ProductImpl' - maybe not public?
Here is my new interface (added to 'core' module):
Code: Select all
package com.mycompany.core.catalog.domain;
import org.broadleafcommerce.core.catalog.domain.Product;
public interface ConeProduct extends Product {
public String getTermsAndConditions();
public void setTermsAndConditions(String termsAndConditions);
}
Here is my extended entity implementation:
Code: Select all
package com.mycompany.core.catalog.domain;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.broadleafcommerce.core.catalog.domain.ProductImpl;
@Entity
@Table(name = "CONE_PRODUCT")
public class ConeProductImpl extends ProductImpl implements ConeProduct {
private static final long serialVersionUID = 1L;
@Column(name = "TERMS_AND_CONDITIONS")
protected String termsAndConditions;
public String getTermsAndConditions() {
return termsAndConditions;
}
public void setTermsAndConditions(String termsAndConditions) {
this.termsAndConditions = termsAndConditions;
}
}
persistence-core.xml:
Code: Select all
<persistence-unit name="blPU" transaction-type="RESOURCE_LOCAL">
<non-jta-data-source>jdbc/web</non-jta-data-source>
<class>com.comverse.core.domain.HCCustomerImpl</class>
<class>com.mycompany.core.catalog.domain.ConeProductImpl</class>
<exclude-unlisted-classes/>
</persistence-unit>
product.html:
Code: Select all
<div><h3>Terms and Conditions</h3></div>
<div th:text="*{termsAndConditions}"></div>
Also tried this for product.html:
Code: Select all
<div><h3>Terms and Conditions</h3></div>
<div th:text="${product.termsAndConditions}"></div>
I have not added anything to applicationContext-entity.xml for the ConeProductImpl based on the comment that it is only necessary for entities like Customer, Fulfillment Group and Order. I did, however, try extending the Customer entity exactly how it was outlined in the Getting Started tutorial, and did add an entry for that in this file. Incidentally, I got the same type of Thymeleaf error for my custom Customer implementation, which is why I then tried extending the Product entity, thinking it was something related to applicationContext-entity.xml not getting merged properly.
I suspect this issue may have something to do with how I am building the modules, as I'm not really sure what the proper way to do it is. I have tried several different ways, but here is what I last tried, which I think should pretty much have nuked and rebuilt everything from scratch (via Eclipse):
- site-->jetty-stop
Maven Parents-->DemoSite-->Run As-->Maven Clean
Maven Parents-->DemoSite-->Run As-->Maven Install
My Broadleaf Site-->core-->Run As-->Maven Clean
My Broadleaf Site-->core-->Run As-->Maven Install
My Broadleaf Site-->admin-->Run As-->Maven Clean
My Broadleaf Site-->admin-->Run As-->Maven Install
My Broadleaf Site-->site-->Run As-->Maven Clean
My Broadleaf Site-->site-->Run As-->Maven Install
ant-->admin-->build-app
ant-->site-->build-app
Pretty sure most of that was redundant, but as I said I'm not real clear on the proper way to build the various modules.
Thanks for your help,
Mike