-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Error setting property values
PostPosted: Fri Sep 16, 2005 6:53 am 
Newbie

Joined: Tue Sep 13, 2005 4:44 am
Posts: 7
I'm using Hibernate version 3 and when I try to deploy my application I get an error:

11:43:12,843 WARN [jbossweb] org.springframework.beans.factory.BeanCreationExce
ption: Error creating bean with name 'hibernateInterceptor' defined in ServletCo
ntext resource [/WEB-INF/application-context.xml]: Error setting property values
; nested exception is org.springframework.beans.NotWritablePropertyException: In
valid property 'hibernateTemplate' of bean class [org.springframework.orm.hibern
ate3.HibernateInterceptor]: Bean property 'hibernateTemplate' is not writable or
has an invalid setter method: Does the parameter type of the setter match the r
eturn type of the getter?
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'hibernateInterceptor' defined in ServletContext resource [/WEB-INF/appli
cation-context.xml]: Error setting property values; nested exception is org.spri
ngframework.beans.NotWritablePropertyException: Invalid property 'hibernateTempl
ate' of bean class [org.springframework.orm.hibernate3.HibernateInterceptor]: Be
an property 'hibernateTemplate' is not writable or has an invalid setter method:
Does the parameter type of the setter match the return type of the getter?
org.springframework.beans.NotWritablePropertyException: Invalid property 'hibern
ateTemplate' of bean class [org.springframework.orm.hibernate3.HibernateIntercep
tor]: Bean property 'hibernateTemplate' is not writable or has an invalid setter
method: Does the parameter type of the setter match the return type of the gett
er?

My mapping file:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>

<class name="bus.Country" table="XMCTRY0">

<id name="COUNTRY" column="ID" type="string">
<generator class="increment"/>
</id>

<property name="ROOTNAME" column="RootName" type="string"/>
<property name="DESCRIPTION" column="Description" type="string"/>
<property name="SHORTDESCRIPTION" column="Short_Description" type="string"/>
<property name="ECONOMICGROUP" column="Economic_Group" type="string"/>
<property name="ECCNGROUP" column="Eccn_Group" type="string"/>
<property name="IMPORTGROUP" column="Import_Group" type="string"/>
<property name="EXPORTGROUP" column="Export_Group" type="string"/>
<property name="DOMESTICINBOUNDGROUP" column="Domestic_Inbound_Group" type="string"/>
<property name="DOMESTICOUTBOUNDGROUP" column="Domestic_Outbound_Group" type="string"/>
<property name="VATPREFIXNUMBER" column="Vat_Prefix_Number" type="string"/>
<property name="NATIONALITY" column="Nationality" type="string"/>
<property name="ALTERNATIVECODE" column="Alternative_Code" type="string"/>
<property name="MARKET" column="Market" type="string"/>
<property name="DATEFORMAT" column="Date_Format" type="string"/>
<property name="DECIMALFORMAT" column="Decimal_Format" type="string"/>
<property name="ISOCODE" column="ISO_Code" type="string"/>
<property name="ISONUMERICCODE" column="ISO_Numeric_Code" type="string"/>
<property name="FORINTRASTATREPORTING" column="For_Intrastat_Reporting" type="string"/>
<property name="ZONE" column="Zone" type="string"/>
<property name="ZONEFORMAT" column="Zone_Format" type="string"/>
<property name="POSTALCODEFORMAT" column="Postal_Code_Format" type="string"/>
<property name="FOREIGNTRADEZONE" column="Foreign_Trade_Zone" type="string"/>
<property name="PRIMARYLANGUAGEONDOCUMENTS" column="Primary_Language_On_Documents" type="string"/>
<property name="ADDRESSLAYOUTTYPE" column="Address_Layout_Type" type="string"/>
<property name="CHARGECLASS" column="Charge_Class" type="string"/>
<property name="EUCLASSIFICATION" column="UE_Classification" type="string"/>
<property name="REFUNDABLE" column="Refundable" type="string"/>
<property name="USERDEFINED1" column="User_Defined_1" type="string"/>
<property name="USERDEFINED2" column="User_Defined_2" type="string"/>
<property name="USERDEFINED3" column="User_Defined_3" type="string"/>

</class>

</hibernate-mapping>

The error is suggesting that my auto-generated java code is missing setters or getters, but its not as far as i can see, here's a snippet:

/** default constructor */
public Country() {
}

public String getCOUNTRY() {
return this.COUNTRY;
}

public void setCOUNTRY(String COUNTRY) {
this.COUNTRY = COUNTRY;
}

public String getROOTNAME() {
return this.ROOTNAME;
}

public void setROOTNAME(String ROOTNAME) {
this.ROOTNAME = ROOTNAME;
}

public String getDESCRIPTION() {
return this.DESCRIPTION;
}

public void setDESCRIPTION(String DESCRIPTION) {
this.DESCRIPTION = DESCRIPTION;
}

Any help would relally be appreciated


Top
 Profile  
 
 Post subject: That's a problem with Spring
PostPosted: Fri Sep 16, 2005 7:53 am 
Contributor
Contributor

Joined: Thu Nov 06, 2003 9:49 pm
Posts: 104
Location: New York, NY
This is a problem in your Spring bean definition file: /WEB-INF/application-context.xml. You are trying to dependency inject a value into the 'hibernateInterceptor' (wich is a Spring class in this case) and there is no setter for it.

Try the Spring forums: http://forum.springframework.org


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.