I'm finding the exception :-[java.lang.NoSuchMethodError: org.hibernate.internal.CoreMessageLogger.debugf(Ljava/lang/String;I)V] while calling the buildsessionfactory method. For this exception I haven't been able to connect with the database(mysql). Here is my code:- Action file :- EmpAction.java:-
package techmyguru.actions;
import com.opensymphony.xwork2.ActionSupport;
//import com.opensymphony.xwork2.ModelDriven;
//import com.opensymphony.xwork2.Preparable;
public class EmpAction extends ActionSupport {
//Employee emp;
private int id;
private String password;
private String name;
private String email;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
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 execute()
{
try{
int i=EmpDao.register(this);
if(i==1)
{
return "success";
}
else
{
return "error";
}
}
catch(Throwable t)
{
t.toString();
return "fail";
}
}
}
See Question&Answers more detail:os