hi there I seem to be having the same problem and cannot figure out what is happening.
I compiled these mapping and tested them locally on my machine and it works fine .After that i integrated it into my web application and it gives me this error of the property not found. I have checked the file and it exists with all my other mappings and it loads all the other mappings fine except this one.
This maps a link table .
Any ideas why it doesnt work now ?
Quote:
max
how do you exepct hbm2java to generate code for you when you dont tell it what type you want for your properties ? ;)
.
I did not follow this , could you explain which properties ?
version : Hibernate 3.0 beta 4
oracle : 9i
Code:
mapping
<?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="org.orm.beans">
<class name="UserGroupApplicationFunction" table="PD_USER_GRP_APP_FUNC" lazy="true">
<composite-id name="id" class="UserGroupApplicationFunction$Id" unsaved-value="any">
<key-property name="functionId"
access="field"
column="APP_FUNC_ID"
length="10"/>
<key-property name="groupId"
access="field"
column="USER_GRP_ID"
length="10"/>
</composite-id>
<property name="dteCreated" column="DTE_CREATED" type="java.util.Date" update="false" not-null="true" />
<property name="idLogonCreated" column="ID_LOGON_CREATED" type="java.lang.String" update="false" not-null="true" />
<property name="dteLastUpdated" column="DTE_LAST_UPDATED" type="java.util.Date" update="false" not-null="true" />
<property name="idLogonLastUpdated" column="ID_LOGON_LAST_UPDATED" type="java.lang.String" update="false" not-null="true" />
<many-to-one name="function"
column="APP_FUNC_ID"
class="ApplicationFunction"
insert="false"
update="false"
not-null="true" />
<many-to-one name="userGroup"
column="USER_GRP_ID"
class="UserGroup"
insert="false"
update="false"
not-null="true" />
</class>
</hibernate-mapping>
Code:
2005-03-23 15:06:33,890 INFO org.hibernate.cfg.Environment.<clinit>() - 451 - Hibernate 3.0 beta 4
2005-03-23 15:06:33,906 INFO org.hibernate.cfg.Environment.<clinit>() - 464 - hibernate.properties not found
2005-03-23 15:06:33,906 INFO org.hibernate.cfg.Environment.<clinit>() - 497 - using CGLIB reflection optimizer
2005-03-23 15:06:33,906 INFO org.hibernate.cfg.Environment.<clinit>() - 527 - using JDK 1.4 java.sql.Timestamp handling
2005-03-23 15:06:33,906 INFO org.hibernate.cfg.Configuration.configure() - 1216 - configuring from resource: /hibernate.cfg.xml
2005-03-23 15:06:33,906 INFO org.hibernate.cfg.Configuration.getConfigurationInputStream() - 1187 - Configuration resource: /hibernate.cfg.xml
2005-03-23 15:06:33,968 DEBUG org.hibernate.util.DTDEntityResolver.resolveEntity() - 42 - trying to locate http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd in classpath under org/hibernate/
2005-03-23 15:06:33,968 DEBUG org.hibernate.util.DTDEntityResolver.resolveEntity() - 53 - found http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd in classpath
2005-03-23 15:06:34,015 DEBUG org.hibernate.cfg.Configuration.addProperties() - 1173 - show_sql=false
2005-03-23 15:06:34,015 DEBUG org.hibernate.cfg.Configuration.addProperties() - 1173 - connection.datasource=jdbc/localhost/orcl1/scott
2005-03-23 15:06:34,015 DEBUG org.hibernate.cfg.Configuration.addProperties() - 1173 - hibernate.dialect=org.hibernate.dialect.Oracle9Dialect
2005-03-23 15:06:34,015 DEBUG org.hibernate.cfg.Configuration.addProperties() - 1173 - transaction.manager_lookup_class=org.hibernate.transaction.WeblogicTransactionManagerLookup
2005-03-23 15:06:34,015 DEBUG org.hibernate.cfg.Configuration.addProperties() - 1173 - hibernate.transaction.auto_close_session=true
2005-03-23 15:06:34,312 DEBUG org.hibernate.util.DTDEntityResolver.resolveEntity() - 53 - found http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd in classpath
2005-03-23 15:06:34,328 INFO org.hibernate.cfg.HbmBinder.bindRootClass() - 439 - Mapping class: org.njsp.invest.common.orm.beans.UserGroupApplicationFunction -> PD_USER_GRP_APP_FUNC
2005-03-23 15:06:34,343 ERROR org.hibernate.cfg.Configuration.add() - 358 - Could not compile the mapping document
org.hibernate.MappingException: class org.orm.beans.UserGroupApplicationFunction$Id not found while looking for property: functionId
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:81)
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:230)
at org.hibernate.cfg.HbmBinder.createProperty(HbmBinder.java:1532)
at org.hibernate.cfg.HbmBinder.bindComponent(HbmBinder.java:1306)
at org.hibernate.cfg.HbmBinder.bindCompositeId(HbmBinder.java:1207)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:500)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:1867)
at org.hibernate.cfg.Configuration.add(Configuration.java:355)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:392)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:441)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1369)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1341)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1323)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1290)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1218)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1204)
at org.njsp.invest.pvtdet.common.mvc.model.hbn.ConfigureHibernate.init(ConfigureHibernate.java:42)
at org.njsp.invest.pvtdet.common.ejb.InitEjb.ejbCreate(InitEjb.java:86)
at org.njsp.invest.pvtdet.common.ejb.Init_alsfdp_Impl.ejbCreate(Init_alsfdp_Impl.java:135)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at weblogic.ejb20.pool.StatelessSessionPool.createBean(StatelessSessionPool.java:172)
at weblogic.ejb20.pool.Pool.createInitialBeans(Pool.java:254)
at weblogic.ejb20.manager.StatelessManager.initializePool(StatelessManager.java:376)
at weblogic.ejb20.deployer.EJBDeployer.initializePools(EJBDeployer.java:1607)
at weblogic.ejb20.deployer.EJBDeployer.start(EJBDeployer.java:1474)
at weblogic.ejb20.deployer.EJBModule.start(EJBModule.java:689)
at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer.java:2127)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2168)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2115)
at weblogic.management.deploy.slave.SlaveDeployer$Application.setActivation(SlaveDeployer.java:3082)
at weblogic.management.deploy.slave.SlaveDeployer.setActivationStateForAllApplications(SlaveDeployer.java:1751)
at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:359)
at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume(DeploymentManagerServerLifeCycleImpl.java:229)
at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:966)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
at weblogic.Server.main(Server.java:32)
Caused by: java.lang.ClassNotFoundException: org.njsp.invest.common.orm.beans.UserGroupApplicationFunction$Id
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:199)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:224)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:103)
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:77)
... 39 more
Quote: