Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6102103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:34:33+00:00 2026-05-23T13:34:33+00:00

before reading my problem this work in a normal dynamic web project i create

  • 0

before reading my problem this work in a normal dynamic web project
i create a web service like this methode:
http://www.youtube.com/watch?v=o2Vjs8ylmFM
using CFX 2.4 and with the 2.5 dynamic web model version and when i run hibernate in this current client web project generated by the web service i get an exception
this is it:

  Etat HTTP 500 - 

     --------------------------------------------------------------------------------

      type Rapport d''exception

      message 

      description Le serveur a rencontré une erreur interne () qui l'a empêché de satisfaire la                 requête.

       exception 

       org.apache.jasper.JasperException: Impossible de compiler la classe pour la JSP: 

        An error occurred at line: 1 in the generated java file
        The type net.sf.hibernate.Session cannot be resolved. It is indirectly referenced from         required .class files

         Une erreur s'est produite à la ligne: 16 dans le fichier jsp: /JSP/ebook/index.jsp
          Session cannot be resolved to a type
         13: <BODY> 
         14: <%
         15: 
         16: Session hibernateSession = HibernateUtil.currentSession();
         17: Transaction tx = hibernateSession.beginTransaction(); 
         18: 
         19: Etudinat etudiant = new Etudinat();


         Une erreur s'est produite à la ligne: 16 dans le fichier jsp: /JSP/ebook/index.jsp

and my class hibernateUtil is :

package DBase;

import net.sf.hibernate.*;

import net.sf.hibernate.cfg.*;


 public class HibernateUtil {

 private static final SessionFactory sessionFactory;

 static {
 try {
 // Crée la SessionFactory
 sessionFactory =
 new Configuration().configure().buildSessionFactory();
 } catch (HibernateException ex) {
 throw new RuntimeException("Problème de configuration : "
 + ex.getMessage(), ex);
 }
 }

 public static final ThreadLocal session = new ThreadLocal();

  public static Session currentSession()
  throws HibernateException {
  Session s = (Session) session.get();
 // Ouvre une nouvelle Session, si ce Thread n'en a aucune
 if (s == null) {
 s = sessionFactory.openSession();
 session.set(s);
 }
 return s;
}

and my hibernate.cfg.xml page is:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>
<session-factory >

<!-- local connection properties -->
<property name="hibernate.connection.url">jdbc:mysql://localhost/ebook</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">162826</property>
<!-- property name="hibernate.connection.pool_size"></property -->

<!-- dialect for MySQL -->
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>



 <!-- Echo all executed SQL to stdout -->
 <property name="show_sql">true</property>

  <property name="current_session_context_class">thread</property>

  <mapping resource="DBase/Favorieensei.hbm" />
  <mapping resource="DBase/Ajouter.hbm" />
  <mapping resource="DBase/Favorie.hbm" />
  <mapping resource="DBase/Enseignant.hbm" />

and this is my page jsp

<%@page import="DBase.HibernateUtil"%>
<%@ page import="java.io.*" %> 
<%@ page import="java.util.*" %> 
<%@ page import="DBase.*" %> 
<%@ page import="net.sf.hibernate.*" %> 
<%@ page import="net.sf.hibernate.cfg.*" %> 

<HTML> 
<HEAD> 
<title>Greetings!</title> 
</HEAD>  
  <BODY> 
<%

 Session hibernateSession = HibernateUtil.currentSession();
  Transaction tx = hibernateSession.beginTransaction(); 

  Etudinat etudiant = new Etudinat();
  etudiant.setUserName("davido");
 etudiant.setPassword("mioo");
  etudiant.setQuestion("best music");
   etudiant.setAnswer("rock");
   etudiant.setEmail("david@live.fr");
  etudiant.setNom(".....");
  etudiant.setPrenom("....");
  etudiant.setSexe("Homme");

   etudiant.setIDFilliere(Filliere.INFORMATIQUE);
  hibernateSession.save(etudiant); 
  tx.commit();
  HibernateUtil.closeSession();


  %> 


  <br> 
 <br> 
 <br> 
 <br> 
  <table width="400" border="0" cellspacing="1" cellpadding="0" align="center" class="tableBox"> 
  <tr> 
  <td CLASS="bluebanner" align="center"> Greetings, </TD> 
    </tr> 
  </table> 
    </BODY> 
    </HTML>

this is my screan shot

screan shot about hibernate

plz help us we are running on time i have 3 left to finish it

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:34:34+00:00Added an answer on May 23, 2026 at 1:34 pm
     An error occurred at line: 1 in the generated java file
        The type net.sf.hibernate.Session cannot be
    

    resolved. It is indirectly referenced
    from required .class files

    Apparently there is something wrong with your classpath. Verify that you are importing everything as required (which seems correct to me on first sight), and that your hibernate.jar is in the correct folder and get loadet properly during execution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My problem involves checking if I have a valid database connection before reading from
Reading about Kohana templates and saw something I've never seen before: $this->template->title = __('Welcome
I am trying to create a moderately complex web page. This is not something
Before you answer this I have never developed anything popular enough to attain high
Before I start, I know there is this post and it doesn't answer my
Before I do this I figured I would ask if it was the best
Before moving on to use SVN, I used to manage my project by simply
Before anyone suggests scrapping the table tags altogether, I'm just modifying this part of
Problem: We have to read from a proprietary binary file at work. It changes
I quickly searched for this before posting, but could not find any similar posts.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.