• Post Reply Bookmark Topic Watch Topic
  • New Topic

Not able to create Hibernate Session from JSP....Could any experts help me on this !!!!  RSS feed

Praveen Ramachandran
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I am facing a small issue with the HIbernate session creation again!!..
Description: I am having a jsp which takes two files and the business logic lies in a java file wich manipulates the uploaded files.So here i am introducing the Hibernate.
The jsp file is using the java class like this:
<jsp:useBean id="ppMbr" scope="page"
<jsp:setProperty name="ppMbr" property="*" />

Here Coventry_PP_MBR.java is the file in which i am introducing hibernate..

the code snippet is as follows:

public class Coventry_PP_MBR {

ArrayList a=new ArrayList();
private File file = null;

StringBuffer duplicate1 = new StringBuffer();
StringBuffer duplicate2 = new StringBuffer();
StringBuffer duplicate3 = new StringBuffer();
List<String> b = new ArrayList<String>();
String Review_Vendor_Control= null;
int kk = 0;
int count= 0;
Session session = HiberUtil.getSession(); ==>> here the hiber sessison is called..


session factory class :HIberUtil.java

public class HiberUtil
private static SessionFactory sessionFactory;
private static Session session;
static {
try {
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (Throwable ex){
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);}}
public static Session getSession()
return session;}

when i run this and upload the files i get this nasty exception :


Same was happening with servlets too.I could'nt get a [proper solution and i am stuck half way.Could anybody out there help me on this.May be i am overlooking some jars or so?Thanks ..Please reply


  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!