[
http://jira.jboss.com/jira/browse/HIBERNATE-7?page=comments#action_12315686 ]
Chris Buckley commented on HIBERNATE-7:
---------------------------------------
hibernate-service.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE server>
<server>
<mbean code="org.jboss.hibernate.jmx.Hibernate"
name="jboss.har:service=HibernateBossService">
<attribute name="DatasourceName">java:/MySqlDS</attribute>
<attribute
name="SessionFactoryName">java:/BossSessionFactory</attribute>
<attribute
name="Dialect">net.sf.hibernate.dialect.MySQLDialect</attribute>
<attribute
name="CacheProviderClass">net.sf.hibernate.cache.HashtableCacheProvider</attribute>
<attribute name="Hbm2ddlAuto">create-drop</attribute>
<attribute name="ShowSqlEnabled">true</attribute>
<depends>jboss.jca:service=DataSourceBinding,name=MySqlDS</depends>
</mbean>
</server>
Manufacturer.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class
name="com.umarble.model.Manufacturer"
table="MANUFACTURER"
dynamic-update="false"
dynamic-insert="false"
>
<jcs-cache usage="read-write" />
<id
name="id"
type="java.lang.Integer"
>
<column
name="MANUFACTURER_ID"
sql-type="integer"
/>
<generator class="assigned">
</generator>
</id>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Manufacturer.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>
Manufacturer.java
package com.umarble.model;
import java.io.Serializable;
/**
* @author cbuckley
* @hibernate.class table = "MANUFACTURER"
* @hibernate.jcs-cache usage="read-write"
*/
public class Manufacturer implements Serializable {
private Integer id;
/**
* @return Returns the id.
*
* @hibernate.id column = "MANUFACTURER_ID" generator-class = "assigned"
* @hibernate.column name = "MANUFACTURER_ID" sql-type = "integer"
*/
public Integer getId(){
return this.id;
}
public void setId(Integer id){
this.id = id;
}
}
> CLONE -PropertyNotFoundException on runtime HAR deployment
> ----------------------------------------------------------
>
> Key: HIBERNATE-7
> URL: http://jira.jboss.com/jira/browse/HIBERNATE-7
> Project: Hibernate
> Type: Bug
> Reporter: Chris Buckley
> Assignee: Steve Ebersole
>
>
> SourceForge Submitter: treinar .
> OS: Linux 2.4.22-36mdkenterprise (i386)
> JVM: 1.4.2_06-b03
> I have a HAR archive, with one class: Pesticide.class
> and its hibernate mapping file. Pesticide class has to
> properties: id and name (with getter/setter methods). A
> META-INF/hibernate-service.xml is also provided.
> When deploying a HAR archive when JBoss runs, the
> deployment fails. The following Exception is thrown:
> net.sf.hibernate.PropertyNotFoundException: Could not
> find a setter for property name in class
> no.planteforsk.pvmdb.persistent.Pesticide
> However, when JBoss is restarted, the HAR deploys fine.
> The Exception is thrown in
> net.sf.hibernate.property.BasicPropertyAccessor, in the
> method getSetter. The cause of the exception is that no
> match between set method (setName) and property (name)
> is found in method setterMethod.
> I inserted a few debug outputs in
> BasicPropertyAccessor, and it turns out that when the
> HAR is deployed at runtime, the method setName in
> Pesticide is wrongly assumed to take no parameters,
> (methods[i].getParameterTypes().length returns 0). When
> jboss is restarted, and the deployment takes place on
> the same HAR file, setName is assumed to take 1
> parameter, which of course is correct.
> I'm not sure if this is a Java error or a JBoss error,
> or even a Hibernate error, but maybe you do. It does
> concern JBoss, however.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development