Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Hibernate mycustomer.hbm.xml not found

Have Programming Question? Ask it here!
 
 
 


swati kadu
mycustomer.hbm.xml not found
0 Answer(s)      a year and 6 months ago
Posted in : Hibernate


feed.jsp
print("<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body bgcolor="pink">
<form action="./Thanks.jsp">
Enter name: &nbsp;&nbsp;&nbsp;<input type="text" name="name"/>
<br/> </br>
Mobile number:<input type="text" name="mob"/><br/><br/>
Email address:<input type="text" name="email"/>
<br/></br>
Quality of information&nbsp;&nbsp;&nbsp;<input type="radio" name="quality" value="Good"/> Good<input type="radio" name="quality" value="Average"/> Average  
<input type="radio" name="quality" value="Poor"/> Poor
<br/><br/>
Amount of information&nbsp;&nbsp;&nbsp;<input type="radio" name="amount" value="Good"/> Good<input type="radio" name="amount" value="Average"/> Average  
<input type="radio" name="amount" value="Poor"/> Poor
<br/> <br/>
Any suggestion? <textarea name="suggestion" ></textarea>
<br/> <br/><br/>
<input type="submit" name="submit" value="Submit"/>
</form>
</body>
</html>");

Thanks.jsp

 print("<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page import="java.util.List"%> 
    <%@ page import="p1.saveCustomer"%>
    <%@ page import="p1.mycustomer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body bgcolor="sky blue">
<font color="white" size="30">
Thank you <%=request.getParameter("name")%>
<jsp:useBean id="f1" class="p1.mycustomer" scope="page">
</jsp:useBean>
<jsp:setProperty name="f1" property="*"/>
<%
saveCustomer.getDetails(f1);
%> 

</font> 
</body>
</html>");

hibernate.cfg.xml

print("<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.org/dtd/hibernate-configuration-3.0.dtd" >
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver-class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql:localhost:3306/test</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">root</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.hbm2ddl.auto">create</property>
<mapping package="p1" resource="p1.mycustomer.hbm.xml"/>
</session-factory>
</hibernate-configuration>");

All the files below are under src/ package p1.

mycustomer.java

print("package p1;

public class mycustomer 
{
String name,email,quality,amount,suggestion;
int mob;
public mycustomer(String name, String email, String quality, String amount,
        String suggestion, int mob) {
    super();
    this.name = name;
    this.email = email;
    this.quality = quality;
    this.amount = amount;
    this.suggestion = suggestion;
    this.mob = mob;
}



public mycustomer() {
    super();
    // TODO Auto-generated constructor stub
}

public String getName() {
    return name;
}
public void setName(String name) {
    this.name = name;
}
public String getEmail() {
    return email;
}
public void setEmail(String email) {
    this.email = email;
}
public String getQuality() {
    return quality;
}
public void setQuality(String quality) {
    this.quality = quality;
}
public String getAmount() {
    return amount;
}
public void setAmount(String amount) {
    this.amount = amount;
}
public String getSuggestion() {
    return suggestion;
}
public void setSuggestion(String suggestion) {
    this.suggestion = suggestion;
}
public int getMob() {
    return mob;
}
public void setMob(int mob) {
    this.mob = mob;
}


}
");

saveCustomer.java


    print("package p1;
import java.util.List;

import org.apache.catalina.Session;
import org.hibernate.Query;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;

public class saveCustomer {

    List<mycustomer> l=null;
    public static void getDetails(mycustomer mc)
    {
SessionFactory  sf=new Configuration().configure().buildSessionFactory();
org.hibernate.Session s=sf.openSession();
Transaction t=s.beginTransaction();
//Query q=s.createQuery("from mycustomer");
//q.setCacheable(true);
//l=q.list();
//s.getTransaction().commit();
t.begin();
int i=(Integer)s.save(mc);
t.commit();
s.close();


    }

}
");

mycustomer.hbm.xml

print("<?xml version="1.0" encoding="UTF-8"?>
<hibernate-mapping>
<class name="p1.mycustomer" table="fedback_data">
<composite-id name="name" type="varchar2" column="Name">
<generator class="native"/>
</composite-id>

 <property name="mob">
 <column name="mobile"/>
 </property>

 <property name="email">
 <column name="email"/>
 </property>

  <property name="quality">
 <column name="Q"/>
 </property>

  <property name="amount">
 <column name="A"/>
 </property>

  <property name="suggestion">
 <column name="s"/>
 </property>


</class>

</hibernate-mapping>");


exception 

org.apache.jasper.JasperException: org.hibernate.MappingNotFoundException: resource: p1.mycustomer.hbm.xml not found
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

Advertisement
View Answers

Related Tutorials/Questions & Answers:
mycustomer.hbm.xml not found
mycustomer.hbm.xml not found  feed.jsp print("<%@ page language...(); //Query q=s.createQuery("from mycustomer"); //q.setCacheable(true); //l...); t.commit(); s.close(); } } "); mycustomer.hbm.xml print("<
mycustomer.hbm.xml not found
mycustomer.hbm.xml not found  feed.jsp print("<%@ page...(); org.hibernate.Session s=sf.openSession(); Transaction t=s.beginTransaction(); //Query q...(); } } "); mycustomer.hbm.xml print("<?xml
Advertisements
Path was not found
Path was not found  The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path
identifier not found
identifier not found  Getting compilation error " identifier not found " please explain ?   identifier means variable name,,,,make sure it same as declaration
File not found
not found
File not found
not found
File not found
"(specified file not found
File not found
"(specified file not found
File not found
getting an error "emp_code.doc"(specified file not found)  Hi Friend
Steps not found.
Steps not found.  import java.io.*; import java.net.*; import javax.servlet.*; import javax.servlet.http.*; public class Details1 extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse
File not found
not found)  Hi Friend, Visit Here Thanks
class not found exception
class not found exception  org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilterprint("code sample
javascript image not found
javascript image not found  javascript if image not found   <a href='$image'> <img alt='No Image' src='$image' onError="this.parentNode.onclick=function() {return(false);}"> </a>
javax.servlet not found error
javax.servlet not found error  why iam getting javax.servlet error while running my servlet program...after setting the classpath also i am finding that problem
no def found - JSP-Servlet
no def found  i have used the code of file upload from rose india but when i run no def found for fileupload exception although i have put jar file in lib folder code i get from D:\project\Uploading Employee Profile
CLASS NOT FOUND EXCEPTION
CLASS NOT FOUND EXCEPTION   I AM USING INTERNET EXPLORER VERSION 6.00... NOT FOUND EXCEPTION AND THE BOX IS DISPLAYED AND I CLICK ON DETAILS BUTTON...: trigger logging q: hide console r: reload policy configuration s
class not found error - JDBC
class not found error  thanks for your response. please clarify the following doubts. i am having the specified mysql connector jar file. where that jar file has to be placed. also does the jdbc driver need to be installed
SQLException caught: No data found
SQLException caught: No data found  i m using ms office 2010, n when i run my source code it is giving error SQLException caught:No data found, plz help me why i am getting this exception, thanks alot, my source code
Error:No Class Found Exception:org.postgresql.driver
Error:No Class Found Exception:org.postgresql.driver  Error:No Class Found Exception:org.postgresql.driver while connecting JDBC With PostgreSQL 8.4 I m running My Program with java 6.0
unable to import class com.opensymphony.xwork2.ActionContext not found
unable to import class com.opensymphony.xwork2.ActionContext not found  Imported class com.opensymphony.xwork2.ActionContext not found gettin the above error
http 404 resource not found error
http 404 resource not found error   Sir, I have downloaded your RichLRApplication and deployed on tomcat 6 with oracle backend. Application started... not found error. Kindly advise. ss
Java file not found exception
Java file not found exception This section illustrates you the concept of file not found exception. Java provides a powerful concept of Exceptions... by a code. When a file with the specified pathname does not exist, file not found
SQLException:Column not found? (help me:(
SQLException:Column not found? (help me:(  import javax.swing.*; import java.sql.*; import java.awt.*; import java.awt.event.*; public class Mini2 extends JFrame implements ActionListener { String userid="data",password="1234
MySQL server PID file could not be found! [FAILED]
MySQL server PID file could not be found! [FAILED]  MySQL server PID file could not be found! [FAILED
exception handling code for file not found error..
exception handling code for file not found error..  How to do exception handling for file not found error
spring3 mvc appliation bean definition not found error
spring3 mvc appliation bean definition not found error  hi deepak I executed the spring3 registration validation example from rose india. when I execute it shows index page, when I click on link it shows the following error
spring3 mvc appliation bean definition not found error
spring3 mvc appliation bean definition not found error  hi I executed spring3 mvc with annotation example after clicking on the register page I got the following error, can you suggest me how to solve. The error message
No suitable driver found for jdbc:mysql://localhost:3306/TEST
No suitable driver found for jdbc:mysql://localhost:3306/TEST  hii, I have wrietten web project using jsp and hibernate but its not working. ava.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/TEST
JSP error: class UserForm not found in class model.UserAction
JSP error: class UserForm not found in class model.UserAction  etting the following error in the program..wat shod i do to remove this?I am using jdeveloper 10 g [code] package model; import javax.servlet.http.HttpServletRequest
ODBC driver manager return 'Data source name not found.
ODBC driver manager return 'Data source name not found.  Why does the ODBC driver manager return 'Data source name not found and no default driver specified Vendor: 0
Tag In Project POM To Close My Java Application If JRE 1.6 Is Not Found?
Tag In Project POM To Close My Java Application If JRE 1.6 Is Not Found?  I have an application compiled in Java. I build my code through Maven. I want a tag in my project POM, so that if JRE 1.6 is not found in the system during
How to found which class or method contain specific annotation?
How to found which class or method contain specific annotation?  Suppose we are having a class with separate user define annoation in same package... categories of testcase. i want to found method or class according to category
I don't found in Tomcat 7.0 's bin folder..
I don't found in Tomcat 7.0 's bin folder..  While making servlet using tomcat 7.0, i don't find startup.bat file in bin folder. My servlet is not working, what should i do ? Is it because of this my servlet is not working
This is the beautiful Coral color set that is mostly found in deep blue ocean.
found in deep blue ocean. Here is a set of 18 shades of Coral colors
what are the jar files should i add to resolve the Exception(Class org.apache.jsp.index_jsp Not Found) ?
what are the jar files should i add to resolve the Exception(Class org.apache.jsp.index_jsp Not Found) ?  what are the jar files should i add to resolve the following Exception HTTP Status 500 - type Exception report
i have installed oracle 10g (both ee and xe) editions... while am installing i found port num as 1521 for ee, 1522 for xe
i have installed oracle 10g (both ee and xe) editions... while am installing i found port num as 1521 for ee, 1522 for xe  i have installed oracle 10g (both ee and xe) editions... while am installing i found port num as 1521
JDBC Class Not Found Exception
());     } If the database driver class not found then it throws ClassNotFoundException. The catch block must handle this class not found exception
JDBC Architecture
is found in "java.sql" and "javax.sql" packages. Given below... the Drivers found in JDBC environment, load the most appropriate driver
Java: Example - Count occurences
Java: Example - Count occurences Problem: Count the number of times one string is found in another. //-------------------------------------------- count() int count(String base, String searchFor) { int len
Struts Software
Struts Software Enterprise Components The Cotsec product range covers common components found in typicaly Enterprise applications. Cotsec also supports both the Java language and framework and the .NET framework
Summary: Math Class
Java Summary: Math Class In this section we will study about the Match class of Java API. Some basic math functions can be found in the Math class. The StrictMath class (not described here) may produce less accurate results
Summary: Math and java.util.Random Classes
Java Summary: Math and java.util.Random Classes In this section we will discuss Math and java.util.Random classes. Both these classes can be used for generating the random numbers. Some basic math functions can be found in the Math
String substring method example
.style1 { font-size: medium; } String substring() method example:- In the Action Script3, substring are sequential characters that are found from a string. String class provide methods for finding substring from string. Method
Send a Response Status in servlet
(response.SC_OK,response.SC_NOT_FOUND etc..) values to return process status... not found, it will show error Not found. Otherwise, it will show OK. Here...;else {   response.sendError(response.SC_NOT_FOUND,    "
Relationship among Design patterns
Relationship among Design patterns       Patterns have relationships and work together to form a weave. That is why, it is found that more familiar you
Why Web Development with PHP Is Useful
A good website is one that will do more than just look great and have plenty of features. It is also one that can be found on a search engine. A site that can... will be easily found. Outside object codes will not have to be gathered as often
 

 

 

DMCA.com