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

  • SEARCH
  • Home
  • 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 5993645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:42:17+00:00 2026-05-22T23:42:17+00:00

I am trying to interact hibernate with spring in my GWT project, below is

  • 0

I am trying to interact hibernate with spring in my GWT project, below is my code

    public class MyWebServiceImpl extends RemoteServiceServlet implements
    MyWebService {

public void myfirstmethod() {
    // TODO Auto-generated method stub

}

public String signIn(String userid, String password)  {
    ApplicationContext ctx = new ClassPathXmlApplicationContext(
    "applicationContext.xml");
    MySQLRdbHelper rdbHelper = (MySQLRdbHelper) ctx.getBean("ManagerJobs");
    **//THIS IS THE POINT WHERE IT THROWS THE EXCEPTION**

    return rdbHelper.getAuthentication(userid, password);
}

}

      public class MySQLRdbHelper {


private Session session;
private SessionFactory sessionFactory;
  /* FOR COUNT QUERY
   * session.createCriteria(RuleSet .class)   
   .setProjection( Projections.projectionList()   
           .add( Projections.rowCount() ) )   
   .add( Subqueries.geAll("entry_id", bolgsEntries) )   
   .list();   
 */
public void setSessionFactory(SessionFactory sessionFactory) {
    this.sessionFactory = sessionFactory;
    }

public String getAuthentication(String userid, String password)
{
    //Some detals like credit card are commented in the class
    User users = null;
    session = sessionFactory.openSession();
    Criteria crit = session.createCriteria(User.class);
    crit.add(Restrictions.eq("userName", userid));
    crit.add(Restrictions.eq("password", password));

    List rsList = crit.list();
    for(Iterator it=rsList.iterator();

    it.hasNext();
    )
    {
        users = (User)it.next();
        System.out.println(users.getUserName());
    }
    session.close();
    return users.getUserName();
}

}

         APPLICATIONCONTEXT.XML
       <?xml version="1.0" encoding="UTF-8"?>

        <beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"
     default-lazy-init="true">

       <!-- Datasource for database connection -->
       <bean id="dataSource"  class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="com.mysql.jdbc.Driver" />
        <property name="url"
        value="jdbc:mysql://localhost:3306/patients" />
        <property name="username" value="root" />
        <property name="password" value="" />
        </bean>

         <bean id="sessionFactory"  class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> 
         <property name="dataSource" ref="dataSource" /> 
        <property name="annotatedClasses"> 
         <list>  
 <value>com.Patient.shared.User</value> 

       </list> 
       </property> 
        </bean>
       <bean id ="ManagerJobs" class= "patient.persistence.MySQLRdbHelper">
      <property name="sessionFactory" ref="sessionFactory" /> 
     </bean>

THIS IS THE EXCEPTION

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ManagerJobs' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.cfg.AnnotationConfiguration]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
  • 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-22T23:42:17+00:00Added an answer on May 22, 2026 at 11:42 pm

    You are missing slf4j in your classpath as indicated by

    java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
    

    Get it and add to application.

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

Sidebar

Related Questions

I am trying to interact with the windows command prompt from code. My goal
I am trying to understand how native code can interact with .NET code and
I've been trying to write some code to interact with Photoshop, both by adding
I have this code for an Android application I'm trying to create into interact
I'm trying to interact with an application over the network which uses a simple
I am trying to interact with the NCBO annotator by setting a few parameters,
I am trying to develop a mobile application which can interact with a MOSS
I'm using OleDb to interact with an Access database, and I'm trying to find
I'm having a bit of trouble trying to understand how WARP could potentially interact
Trying to get parameters from a PUT request using HttpServlet#doPut: public void doPut(HttpServletRequest request,

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.