Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Hibernate Mapping Exception Error reading resource: Help Please

800409Sep 21 2005 — edited Aug 1 2006
I've downloaded Hibernate this weekend and have been working at getting this up and running in my spare time. I've run into a problem and can't seem to find the solution. I'm hoping some one here can help me out.

I'm running MyEclipse
MySQL
and Hibernate 2 in a struts application

I've only got one form and table that I'm trying to map right now, but I get the above error when I run this line of code.

Configuration cfg = new Configuration().addClass(AddCustomerForm.class);

Does anyone have any ideas. Here are the important sections from the two configuration files
<!-- hibernate.cfg.xml-->
<hibernate-configuration>

    <session-factory>
        <!-- properties -->
        <property name="connection.username">PaintTracker</property>
        <property name="connection.url">jdbc:mysql://127.0.0.1:3306/PaintTracker</property>
        <property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
        <property name="connection.password">PaintTracker</property>
        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="show_sql">true</property>
       
        <mapping resource="com/PaintTracker/struts/form/AddCustomerForm.hbm.xml"/>

    </session-factory>

.
<!--AddCustomerForm.hbm.xml -->
<hibernate-mapping>
	<class name="com.PaintTracker.struts.form.AddCustomerForm" table="customer">
		<id name="customerID" column="CustomerID" type="java.lang.Long" unsaved-value="0">
			<generator class="identity"/>
		</id>
		<property name="firstName" column="FirstName" type="java.lang.String"/>
		<property name="lastName" column="LastName" type="java.lang.String"/>
		<property name="streetAddress" column="StreetAddress" type="java.lang.String"/>
		<property name="middleInitial" column="MiddleInitial" type="java.lang.String"/>
		<property name="city" column="City" type="java.lang.String"/>
		<property name="state" column="State" type="java.lang.String"/>
		<property name="zipCode" column="ZipCode" type="java.lang.String"/>
		<property name="phoneNumber" column="PhoneNumber" type="java.lang.Long"/>
		<property name="emailAddressLeft" column="EmailAddressLeft" type="java.lang.String"/>
		<property name="emailAddressRight" column="EmailAddressRight" type="java.lang.String"/>
		<property name="company" column="Company" type="java.lang.String"/>		
	</class>
</hibernate-mapping>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 29 2006
Added on Sep 21 2005
16 comments
1,009 views