Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Object Relational Mapping and the fly likes class not found exception while running my first hebernate example Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "class not found exception while running my first hebernate example" Watch "class not found exception while running my first hebernate example" New topic
Author

class not found exception while running my first hebernate example

kiran kumar reddy
Ranch Hand

Joined: Jun 28, 2012
Posts: 41

i am a newbie to hibernate i was trying to run my first hibernate program but it says "class not found exception"
i was running in eclipse IDE and i have attached all jars and i ran Manager.java....i am attaching a screen shot of my eclipse error and details of my program......
here is Person.hbm.xml file contents...i use Oracle XE with port n0:5656......

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-mapping package="kiran.kumar">
<class name="Person" table="PERSON">
<id name="id" column="PERSON_ID">
<generator class="native"/>
</id>
<property name="age"/>
<property name="firstName" column="first_name"/>
<property name="lastName" column="last_name"/>

</class>
</hibernate-mapping>
_________________________________________________________________________

here is my Person.java file
package kiran.kumar;

public class Person {
private Integer id;
private String firstName;
private String lastName;
private Integer age;
public Integer getId()
{
return id;
}
public void setId(Integer id)
{
this.id=id;
}
public String getfirstName()
{
return firstName;
}
public void setfirstName(String firstName)
{
this.firstName=firstName;
}
public String getlastName()
{
return lastName;
}
public void setlastName(String lastName)
{
this.lastName=lastName;
}
public Integer getAge()
{
return age;
}
public void setAge(Integer age)
{
this.age=age;
}
}
_____________________________________________________________________________________________________

......
please help me to correct my error


[Thumbnail for hibernate_cgf_xml.JPG]

[Thumbnail for eclipse_structure.JPG]

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: class not found exception while running my first hebernate example
 
Similar Threads
Mapping in Hibernate for nested Bean Structure
Hibernate mapping
cannot insert record in MS SQLServer 2000
/hibernate.cfg.xml not found while Running simple java program
org.hibernate.exception.GenericJDBCException