Hello Friends I am getting the following errors.Could you please guide me.
Error:
Code:
Exception in thread "main" org.hibernate.InvalidMappingException: Could not parse mapping document from resource customer.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:523)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1511)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1479)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1458)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1432)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1352)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1338)
at salesOrderSchema.SalesOrderUnmarshaller.main(SalesOrderUnmarshaller.java:36)
Caused by: org.hibernate.MappingException: class salesOrderSchema.Sales.Customer not found while looking for property: nameStyle
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:74)
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:276)
at org.hibernate.cfg.HbmBinder.createProperty(HbmBinder.java:2164)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2141)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2031)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:359)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:273)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:144)
at org.hibernate.cfg.Configuration.add(Configuration.java:424)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:465)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:520)
... 7 more
Caused by: java.lang.ClassNotFoundException: salesOrderSchema.Sales.Customer
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:100)
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:70)
... 17 more
cutomer.hbm.xml
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>
<class name="salesOrderSchema.Sales.Customer" table="SalesLT.Customer">
<id name="customerID" type="int" column="CustomerID" >
<generator class="identity"/>
</id>
<property name="nameStyle">
<column name = "NameStyle"/>
</property>
<property name="title">
<column name="Title"/>
</property>
<property name="firstName">
<column name="FirstName"/>
</property>
<property name="middleName">
<column name="MiddleName"/>
</property>
<property name="lastName">
<column name="LastName"/>
</property>
<property name="suffix">
<column name="Suffix"/>
</property>
<property name="companyName">
<column name="CompanyName"/>
</property>
<property name="salesPerson">
<column name="SalesPerson"/>
</property>
<property name="emailAddress">
<column name="EmailAddress"/>
</property>
<property name="phone">
<column name="Phone"/>
</property>
</class>
</hibernate-mapping>