Hi,
I'm having a problem getting the hibernate tools set up for my current project on eclipse. It seems that when I use a component it is complaining. It is able to load all my other configurations just fine. When I try to load the configuration it gets an error finding the component's class. I tried adding the classpath manually to the compiled folder, and even to the source, but that does not change the issue. I've checked the package structure in the error, and it is looking in the right place, for some reason its just not finding it. Any ideas?
Hibernate version:
3.1
Mapping documents:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class
name="org.govgrnds.example.webapp.domain.ExampleUser"
table="sys_user"
proxy="org.govgrnds.example.webapp.domain.ExampleUser"
dynamic-update="true"
dynamic-insert="true">
<cache usage="read-write" />
<id
name="id"
column="user_id"
type="java.lang.Long">
<generator class="increment">
</generator>
</id>
<version
name="version"
column="version"
type="long"
/>
<property
name="accountNonLocked"
column="account_non_locked"
type="boolean"
update="true"
insert="true"
/>
<property
name="accountNonExpired"
column="account_non_expired"
type="boolean"
update="true"
insert="true"
/>
<property
name="credentialsNonExpired"
column="credentials_non_expired"
type="boolean"
update="true"
insert="true"
/>
<property
name="userModified"
type="java.lang.String"
update="true"
insert="true"
column="last_modified_user"
/>
<component name="name" class="org.govgrnds.example.webapp.domain.Name"> <!-- class attribute optional -->
<property name="firstname" column="first_name" />
<property name="lastname" column="last_name"/>
<property name="middlename" column="middle_name"/>
</component>
<property
name="username"
type="java.lang.String"
update="true"
insert="true"
column="username"
/>
<property
name="password"
type="java.lang.String"
update="true"
insert="true"
column="password"
/>
<property
name="enabled"
type="boolean"
update="true"
insert="true"
column="enabled"
/>
<property
name="dateCreated"
type="java.util.Date"
update="false"
insert="true"
column="date_created"
/>
<property
name="dateModified"
type="java.util.Date"
update="true"
insert="true"
column="date_updated"
/>
<array name="authorities"
table="user_authorities">
<cache usage="read-write" />
<key column="user_id"/>
<index column="sort_order"/>
<many-to-many
column="authority_id"
class="org.govgrnds.security.domain.AuthorityImpl" />
</array>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:Code:
org.hibernate.MappingException: Could not read mapping document from file: C:\webarch\projects\govgrnds-example\src\webapp\org\govgrnds\example\webapp\domain\ExampleUser.hbm.xml
at org.hibernate.cfg.Configuration.addFile(Configuration.java:270)
at org.hibernate.console.ConsoleConfiguration$1.execute(ConsoleConfiguration.java:142)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:112)
at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:98)
at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:19)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:70)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:192)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
Caused by: org.hibernate.MappingException: class org.govgrnds.example.webapp.domain.Name not found while looking for property: firstname
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:80)
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:276)
at org.hibernate.cfg.HbmBinder.createProperty(HbmBinder.java:2138)
at org.hibernate.cfg.HbmBinder.bindComponent(HbmBinder.java:1867)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2055)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2005)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:368)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:282)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:153)
at org.hibernate.cfg.Configuration.add(Configuration.java:386)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)
at org.hibernate.cfg.Configuration.addFile(Configuration.java:267)
... 8 more
Caused by: java.lang.ClassNotFoundException: org.govgrnds.example.webapp.domain.Name
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:405)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:350)
at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:78)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
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:108)
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:76)
... 19 more
Name and version of the database you are using:
Oracle 9i