Hibernate version: 3
Mapping documents:
Code:
<class name="ProductSizeViewBean" table="Product_Size_View" mutable="false">
<cache usage="read-only" region="productInformationCache"/>
<composite-id>
<key-property name="productId" type="string" column="Product_Id"/>
<key-property name="productSizeId" type="string" column="PRODUCT_SIZE_ID"/>
<key-property name="scentId" type="string" column="SCENT_ID"/>
<key-property name="languageCountryId" type="string" column="LANGUAGE_COUNTRY_ID"/>
</composite-id>
<property name="shortProductName" type="string" column="SHORT_PRODUCT_NAME"/>
<property name="longProductName" type="string" column="LONG_PRODUCT_NAME"/>
<property name="sizeValue" type="float" column="SIZE_VALUE"/>
<property name="unitId" type="string" column="UNIT_ID"/>
<property name="unitDescription" type="string" column="UNIT_DESCRIPTION"/>
<property name="clubSize" type="string" column="CLUB_SIZE"/>
<property name="languageName" type="string" column="LANGUAGE_NAME"/>
<property name="countryCode" type="string" column="COUNTRY_CODE"/>
</class>
Code between sessionFactory.openSession() and session.close():Full stack trace of any exception that occurs:Code:
[31/Mar/2006:18:30:53] info ( 3280): CORE3282: stdout: 18:30:53,235 ERROR BasicP
ropertyAccessor:167 - IllegalArgumentException in class: com.downy.productinform
ation.beans.ProductSizeViewBean, getter method of property: productId
[31/Mar/2006:18:30:53] failure ( 3280): for host 10.25.128.73 trying to POST /en
_US/productAdvisor/mostAppealingScent.do, service-j2ee reports: ApplicationDispa
tcher[] WEB2649: Servlet.service() for servlet action threw exception
javax.servlet.ServletException: IllegalArgumentException occurred calling getter
of com.downy.productinformation.beans.ProductSizeViewBean.productId; nested exc
eption is org.hibernate.PropertyAccessException: IllegalArgumentException occurr
ed calling getter of com.downy.productinformation.beans.ProductSizeViewBean.prod
uctId
at org.apache.struts.action.RequestProcessor.processException(RequestPro
cessor.java:523)
at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
tProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:119
4)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:807)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp
atcher.java:770)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationD
ispatcher.java:471)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDis
patcher.java:382)
at common.filters.LanguageSelectFilter.doFilter(LanguageSelectFilter.jav
a:196)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at common.filters.AdminFilter.doFilter(AdminFilter.java:102)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at common.filters.TargetUriRemovalFilter.doFilter(TargetUriRemovalFilter
.java:64)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:280)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:509)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:212)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:509)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:209)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:509)
at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProce
ssor.java:161)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:586)
----- Root Cause -----
org.springframework.orm.hibernate3.HibernateSystemException: IllegalArgumentExce
ption occurred calling getter of com.downy.productinformation.beans.ProductSizeV
iewBean.productId; nested exception is org.hibernate.PropertyAccessException: Il
legalArgumentException occurred calling getter of com.downy.productinformation.b
eans.ProductSizeViewBean.productId
org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling
getter of com.downy.productinformation.beans.ProductSizeViewBean.productId
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPro
pertyAccessor.java:171)
at org.hibernate.tuple.AbstractComponentTuplizer.getPropertyValue(Abstra
ctComponentTuplizer.java:121)
at org.hibernate.tuple.AbstractComponentTuplizer.getPropertyValues(Abstr
actComponentTuplizer.java:133)
at org.hibernate.tuple.PojoComponentTuplizer.getPropertyValues(PojoCompo
nentTuplizer.java:88)
at org.hibernate.type.ComponentType.getPropertyValues(ComponentType.java
:307)
at org.hibernate.type.ComponentType.isEqual(ComponentType.java:111)
at org.hibernate.cache.CacheKey.equals(CacheKey.java:51)
at java.util.HashMap.eq(HashMap.java:270)
at java.util.HashMap.put(Has
Name and version of the database you are using:Oracle 9i
My Java class:
Code:
public class ProductSizeViewBean
implements Serializable
{
public static final String PRODUCT_ID = "productId";
public static final String PRODUCT_SIZE_ID = "productSizeId";
public static final String SCENT_ID = "scentId";
public static final String LANGUAGE_COUNTRY_ID = "languageCountryId";
public static final String SIZE_VALUE = "sizeValue";
public static final String CLUB_SIZE = "clubSize";
private String productId;
private String shortProductName;
private String longProductName;
private String productSizeId;
private String scentId;
private Float sizeValue;
private String unitId;
private String unitDescription;
private String clubSize;
private String languageCountryId;
private String languageName;
private String countryCode;
public String getProductId()
{
return productId;
}
public void setProductId(String productId)
{
this.productId = productId;
}
public String getShortProductName()
{
return shortProductName;
}
public void setShortProductName(String shortProductName)
{
this.shortProductName = shortProductName;
}
public String getLongProductName()
{
return longProductName;
}
public void setLongProductName(String longProductName)
{
this.longProductName = longProductName;
}
public String getProductSizeId()
{
return productSizeId;
}
public void setProductSizeId(String productSizeId)
{
this.productSizeId = productSizeId;
}
public String getScentId()
{
return scentId;
}
public void setScentId(String scentId)
{
this.scentId = scentId;
}
public Float getSizeValue()
{
return sizeValue;
}
public void setSizeValue(Float sizeValue)
{
this.sizeValue = sizeValue;
}
public String getUnitId()
{
return unitId;
}
public void setUnitId(String unitId)
{
this.unitId = unitId;
}
public String getUnitDescription()
{
return unitDescription;
}
public void setUnitDescription(String unitDescription)
{
this.unitDescription = unitDescription;
}
public String getClubSize()
{
return clubSize;
}
public void setClubSize(String clubSize)
{
this.clubSize = clubSize;
}
public String getLanguageCountryId()
{
return languageCountryId;
}
public void setLanguageCountryId(String languageCountryId)
{
this.languageCountryId = languageCountryId;
}
public String getLanguageName()
{
return languageName;
}
public void setLanguageName(String languageName)
{
this.languageName = languageName;
}
public String getCountryCode()
{
return countryCode;
}
public void setCountryCode(String countryCode)
{
this.countryCode = countryCode;
}
public ProductSizeViewBean()
{
}
}
I am using Spring integration, so this is the search code:
Code:
DetachedCriteria search = DetachedCriteria.forClass(ProductSizeViewBean.class);
search.add(Restrictions.eq(ProductSizeViewBean.PRODUCT_ID, productId));
search.add(Restrictions.eq(ProductSizeViewBean.SCENT_ID, scentId));
search.add(Restrictions.eq(ProductSizeViewBean.LANGUAGE_COUNTRY_ID, languageCountryId));
search.add(Restrictions.eq(ProductSizeViewBean.CLUB_SIZE, "No"));
return getHibernateTemplate().findByCriteria(search, startIndex, maxResults);
The view ties many tables together and I am looking for something that is in the composite key. The Select it generates works.
WHat causing such an error on a getter?
[/code]