Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: "org.hibernate.Session" ClassNotFoundException

  1. #1
    Junior Member talha06's Avatar
    Join Date
    Feb 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default [SOLVED] "org.hibernate.Session" ClassNotFoundException

    Hello to all,

    Despite I added all necessary .jar files to project, I always take boring exception warnings that say "class not found". I added the code and exception output below. I'll be so happy if someone can help me.

    Thanks in advance..
    With regards,
    T
    -----------------------------------------------------
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    		// TODO Auto-generated method stub
    		KisiHelper kh = new KisiHelper();  // ======> *Exception Warning!!!*
    		try {			
    			JSONArray arr = kh.getAll();
    			response.getWriter().write(arr.toString());
    		} catch(Exception e) {
    			e.printStackTrace();
    		}
    	}
    ---------------------------------------------------------
    public class KisiHelper {
     
    	public JSONArray getAll() {	
    		JSONArray arr = null;
     
    		try {
    			System.out.println("KisiHelper calisti..");
    			SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
    			Session session = sessionFactory.openSession();
    			Transaction transaction = session.beginTransaction();
    			String hql = "from Kisi";
    		    Query query = session.createQuery(hql);
    		    List<Kisi> list = query.list();
    			List<Kisi> kisiList = list;
    		    arr = JSONArray.fromObject(kisiList);
    		    transaction.commit();
    		    session.close();
    		} catch(Exception e) {
    			e.printStackTrace();
    		}
    		return arr;
    	}
    }
    ----------------------------------------------------------------
    *Exception:*

    java.lang.ClassNotFoundException: org.hibernate.Session
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
    	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
           *at servlets.tabloDoldur.doGet(tabloDoldur.java:34)*
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
    	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
    	at java.lang.Thread.run(Thread.java:619)
    Last edited by talha06; February 28th, 2010 at 01:29 PM. Reason: Solved..


  2. #2
    Junior Member talha06's Avatar
    Join Date
    Feb 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: "org.hibernate.Session" ClassNotFoundException

    thanx everyone who read my topic. Eventually the solution was found. I want to share the solution here, maybe it can help others. The problem was occured because of wrong build path. JAR files must be in WEB-INF folder. This is the point here.
    Thanx everyone,
    T

  3. #3
    Junior Member
    Join Date
    Dec 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: "org.hibernate.Session" ClassNotFoundException

    Thank you so much, it took me over a week because of this stupid error

  4. #4
    Junior Member
    Join Date
    Aug 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: "org.hibernate.Session" ClassNotFoundException

    Thank you!! =)

Similar Threads

  1. Replies: 16
    Last Post: August 27th, 2010, 03:30 PM
  2. "java.lang.NoSuchMethodError: main" and "fatal exception occured."
    By joachim89 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 10th, 2010, 08:35 AM
  3. Replies: 1
    Last Post: October 25th, 2009, 11:54 AM
  4. Replies: 4
    Last Post: August 13th, 2009, 05:54 AM
  5. [SOLVED] "GridLayout" problem in Java program
    By antitru5t in forum AWT / Java Swing
    Replies: 3
    Last Post: April 16th, 2009, 10:26 AM

Tags for this Thread