-->
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: PropertyNotFoundException issue
PostPosted: Thu Nov 24, 2005 6:30 am 
Newbie

Joined: Mon Nov 21, 2005 7:42 am
Posts: 2
Hi,

I'm new with Hibernate and (naturally) I'm experiencing some problems on the way.
I'm using Hibernate 3.1 RC2 under JBoss 4.0.3SP1. Trying to deploy a HAR, containing only my domain object model + META-INF/jboss-service.xml, I'm getting the following exception (partial log output + stack trace):
Code:
12:09:54,626 INFO  [Environment] Hibernate 3.1
12:09:54,658 INFO  [Environment] hibernate.properties not found
12:09:54,658 INFO  [Environment] using CGLIB reflection optimizer
12:09:54,658 INFO  [Environment] using JDK 1.4 java.sql.Timestamp handling
12:09:54,939 INFO  [Configuration] processing extends queue
12:09:54,939 INFO  [Configuration] processing collection mappings
12:09:54,939 INFO  [Configuration] processing association property references
12:09:54,939 INFO  [Configuration] processing foreign key constraints
12:09:54,954 INFO  [NamingHelper] JNDI InitialContext properties:{}
12:09:54,954 INFO  [DatasourceConnectionProvider] Using datasource: java:/MySqlDS
12:09:55,001 INFO  [SettingsFactory] RDBMS: MySQL, version: 4.1.7-log
12:09:55,001 INFO  [SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0-nightly-20050831 ( $Date: 2005-08-23 21:37:22 +0000 (T
ue, 23 Aug 2005) $, $Revision: 4131 $ )
12:09:55,079 INFO  [Dialect] Using dialect: org.hibernate.dialect.MySQLInnoDBDialect
12:09:55,251 INFO  [TransactionFactoryFactory] Transaction strategy: org.hibernate.transaction.JTATransactionFactory
12:09:57,423 INFO  [NamingHelper] JNDI InitialContext properties:{}
12:09:57,439 INFO  [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
12:09:57,439 INFO  [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
12:09:57,439 INFO  [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
12:09:57,439 INFO  [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
12:09:57,439 INFO  [SettingsFactory] Automatic flush during beforeCompletion(): enabled
12:09:57,439 INFO  [SettingsFactory] Automatic session close at end of transaction: enabled
12:09:57,439 INFO  [SettingsFactory] JDBC batch size: 15
12:09:57,439 INFO  [SettingsFactory] JDBC batch updates for versioned data: disabled
12:09:57,439 INFO  [SettingsFactory] Scrollable result sets: enabled
12:09:57,439 INFO  [SettingsFactory] JDBC3 getGeneratedKeys(): enabled
12:09:57,439 INFO  [SettingsFactory] Connection release mode: after_statement
12:09:57,439 INFO  [SettingsFactory] Maximum outer join fetch depth: 2
12:09:57,439 INFO  [SettingsFactory] Default batch fetch size: 1
12:09:57,454 INFO  [SettingsFactory] Generate SQL with comments: disabled
12:09:57,454 INFO  [SettingsFactory] Order SQL updates by primary key: disabled
12:09:57,454 INFO  [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
12:09:57,454 INFO  [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
12:09:57,454 INFO  [SettingsFactory] Query language substitutions: {}
12:09:57,454 INFO  [SettingsFactory] Second-level cache: enabled
12:09:57,454 INFO  [SettingsFactory] Query cache: disabled
12:09:57,470 INFO  [SettingsFactory] Cache provider: org.hibernate.cache.TreeCacheProvider
12:09:57,470 INFO  [SettingsFactory] Optimize cache for minimal puts: enabled
12:09:57,470 INFO  [SettingsFactory] Structured second-level cache entries: disabled
12:09:57,548 INFO  [SettingsFactory] Echoing all SQL to stdout
12:09:57,548 INFO  [SettingsFactory] Statistics: disabled
12:09:57,548 INFO  [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
12:09:57,564 INFO  [SettingsFactory] Default entity-mode: POJO
12:09:57,939 INFO  [SessionFactoryImpl] building session factory
...................
12:10:43,876 INFO  [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
12:10:43,892 INFO  [Configuration] processing extends queue
12:10:43,892 INFO  [Configuration] processing collection mappings
12:10:43,892 INFO  [Configuration] processing association property references
12:10:43,892 INFO  [Configuration] processing foreign key constraints
12:10:43,892 INFO  [Configuration] processing extends queue
12:10:43,892 INFO  [Configuration] processing collection mappings
12:10:43,892 INFO  [Configuration] processing association property references
12:10:43,892 INFO  [Configuration] processing foreign key constraints
12:10:43,892 INFO  [SchemaExport] Running hbm2ddl schema export
12:10:43,908 INFO  [SchemaExport] exporting generated schema to database
12:10:43,908 INFO  [SchemaExport] schema export complete
12:10:43,908 INFO  [Configuration] processing extends queue
12:10:43,908 INFO  [Configuration] processing collection mappings
12:10:43,923 INFO  [Configuration] processing association property references
12:10:43,923 INFO  [Configuration] processing foreign key constraints
12:10:43,923 INFO  [Configuration] processing extends queue
12:10:43,923 INFO  [Configuration] processing collection mappings
12:10:43,923 INFO  [Configuration] processing association property references
12:10:43,923 INFO  [Configuration] processing foreign key constraints
12:10:43,923 INFO  [NamingHelper] JNDI InitialContext properties:{}
12:10:43,923 INFO  [SessionFactoryImpl] Checking 0 named queries
12:10:43,923 INFO  [Hibernate] SessionFactory successfully built and bound into JNDI [java:/hibernate/WMonitorSessionFactory]
12:10:44,001 INFO  [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
12:10:44,533 INFO  [Configuration] Searching for mapping documents in jar: HiberDataModel.har
12:10:44,533 INFO  [Configuration] Found mapping document in jar: samples/hmodel/HDeposit.hbm.xml
12:10:44,814 INFO  [HbmBinder] Mapping class: samples.hmodel.HDeposit -> H_DEPOSIT
12:10:44,939 WARN  [ServiceController] Problem starting service samples.hmodel:name=WMonitorModelSF
org.hibernate.MappingException: Could not read mapping documents from jar: HiberDataModel.har
        at org.hibernate.cfg.Configuration.addJar(Configuration.java:537)
        at org.jboss.hibernate.jmx.Hibernate.handleMappings(Hibernate.java:275)
        at org.jboss.hibernate.jmx.Hibernate.buildSessionFactory(Hibernate.java:189)
        at org.jboss.hibernate.jmx.Hibernate.startService(Hibernate.java:131)
....................
Caused by: org.hibernate.PropertyNotFoundException: field not found: depositName
        at org.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:97)
        at org.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:104)
        at org.hibernate.property.DirectPropertyAccessor.getGetter(DirectPropertyAccessor.java:112)
        at org.hibernate.util.ReflectHelper.getter(ReflectHelper.java:89)
        at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:77)
        at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:276)
        at org.hibernate.cfg.HbmBinder.createProperty(HbmBinder.java:2022)
        at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2007)
        at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:1984)
        at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:1897)
        at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:325)
        at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:239)
        at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:110)
        at org.hibernate.cfg.Configuration.add(Configuration.java:379)
        at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:418)
        at org.hibernate.cfg.Configuration.addJar(Configuration.java:534)
        ... 140 more


The persistent field 'depositName' is declared as follows:
Code:
public class HDeposit extends Persistent {

  private String depositName;
..........
  public String getDepositName() {
    return depositName;
  }
  public void setDepositName(String depositName) {
    this.depositName = depositName;
  }
...........


Class Persistent is same as the one in the Hibernate auction example.
The depositName is declared in the metadata as follows:
Code:
<?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 package="samples.hmodel">

  <class name="HDeposit" table="H_DEPOSIT" lazy="true">
     
    <id name="id" type="long" column="DEPOSIT_ID">
      <generator class="org.hibernate.id.TableHiLoGenerator">
        <param name="table">UID_TABLE</param>
        <param name="column">NEXT_HI_VALUE_COLUMN</param>
      </generator>
    </id>

    <natural-id mutable="false">
      <property name="depositName" length="20" column="DEPOSIT_NAME"/>
    </natural-id>
..................


I've searched but didn't find any answer, and can't figure out myself what could cause this exception.

any help/hint is appreciated!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 24, 2005 7:30 am 
Newbie

Joined: Mon Nov 21, 2005 7:42 am
Posts: 2
Problem solved...by debugging the har deployment process.
Cause:
An outdated version of HDeposit was actually loaded from a jar residing in the server/all/lib directory, and not from the har as expected.


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.