Struts has detected an unhandled exception:
Messages:
1. org.hibernate.Session
2. org/hibernate/Session
Stacktraces
java.lang.reflect.InvocationTargetException
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
java.lang.NoClassDefFoundError: org/hibernate/Session
com.my.logintest.action.RegAction.execute(RegAction.java:19)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
java.lang.ClassNotFoundException: org.hibernate.Session
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
com.my.logintest.action.RegAction.execute(RegAction.java:19)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
package com.my.logintest.service;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import com.my.logintest.model.LoginUser;
public class LoginUserService {
public void register(){
System.out.println("sssss");
// if(id==null||password==null)
// return ;
//
// String md5_id=MD5.compute(id);
// String md5_password=MD5.compute(password);
// System.out.println("register method");
//
// Configuration conf=new Configuration();
// SessionFactory sessonFactory=conf.buildSessionFactory();
// Session session=sessonFactory.getCurrentSession();
// session.beginTransaction();
//
// LoginUser user=new LoginUser();
// user.setId(md5_id);
// user.setPassword(md5_password);
// session.save(user);
// session.getTransaction().commit();
// sessonFactory.close();
}
}
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。