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 8177203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:27:04+00:00 2026-06-06T23:27:04+00:00

Continue solving this situation , I’ve updated hibernate ond sqljdbc4 jars and the exception

  • 0

Continue solving this situation, I’ve updated hibernate ond sqljdbc4 jars and the exception is changed now (please take a look bellow).

I’m using

  • Hibernate v4.1.4 FINAL
  • JSF 2.1 (mojarra)
  • all my @ManagedBeans implements Serializable

It has some relation to @ViewScoped, because @SessionScoped beans are OK

What I’ve tried:

  • enable <Manager pathname=""/> in context.xml, and yes, the exception disappears, but I really lose persistent sessions, so I have to login again after tomcat server restart.

  • make changes in hiberanate.cfg.xml file (e.g. add name="java:hibernate/SessionFactory" to <session-factory> tag), but without success

  • play with SESSIONS.ser file, which is created after STOP the tomcat server.

    • When I open ser file, I can find there something like: …. uuidq ~ xppt $e8906373-f31b-4990-833c-c7680b2a77ce …
    • if i START tomcat server again, it reports Could not find a SessionFactory [uuid=8906373-f31b-4990-833c-c7680b2a77ce,name=null] – WHY??? The session seems to be present in SESSION.ser file…

My session manager:

@SessionScoped
@ManagedBean(name="userManager")
public class UserManager implements Serializable {
  private static final long serialVersionUID = 1L;
  private transient HttpSession session;
  private String username;
  private String password;
  private User user;

  public String login() {
    // here is seraching for user in database (based on username and password)

    if (user != null) {
      FacesContext context = FacesContext.getCurrentInstance();
      session = (HttpSession) context.getExternalContext().getSession(true);
      session.setAttribute("id", user.getId());
      session.setAttribute("username", user.getName());
      ...
      return "success";
    } 
  }

  public String logout() {
    user = null;
    FacesContext context = FacesContext.getCurrentInstance();
    session = (HttpSession) context.getExternalContext().getSession(true);
    ...     
    session.invalidate();
    return "success";
  }
  // getters and setters ----------------------------------------------------
}

my hibernate.cfg.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC 
  "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
  "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
 <session-factory>
  <property name="connection.url">jdbc:sqlserver://localhost;databaseName=RXP</property>
  <property name="connection.username">user</property>
  <property name="connection.password">password</property>
  <property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
  <property name="dialect">org.hibernate.dialect.SQLServer2008Dialect</property>
  <property name="current_session_context_class">thread</property>
  <property name="hibernate.show_sql">true</property>
  <property name="hibernate.hbm2ddl.auto">update</property>

  <mapping class="tables.User"/>

 </session-factory>
</hibernate-configuration>

and my session factory:

public final class DaoSF implements Serializable {
  private static final long serialVersionUID = 1L;

  private static SessionFactory sessionFactory;
  private static ServiceRegistry serviceRegistry;

  public static SessionFactory getSessionFactory() {
    try {
      Configuration configuration = new Configuration();
      configuration.configure("hibernate.cfg.xml");
      serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry();        
      sessionFactory = configuration.buildSessionFactory(serviceRegistry);
      return sessionFactory;
    }
    catch (HibernateException he) { 
      ...
    }
  }
}

exception:

30.6.2012 13:29:07 org.apache.catalina.session.StandardManager doLoad
SEVERE: IOException while loading persisted sessions: java.io.InvalidObjectException: Could not find a SessionFactory [uuid=f9c33312-cf7f-4f65-ae5f-44261705c18e,name=null]
java.io.InvalidObjectException: Could not find a SessionFactory [uuid=f9c33312-cf7f-4f65-ae5f-44261705c18e,name=null]
    at org.hibernate.internal.SessionFactoryImpl.locateSessionFactoryOnDeserialization(SessionFactoryImpl.java:2007)
    at org.hibernate.internal.SessionFactoryImpl.deserialize(SessionFactoryImpl.java:2037)
....

I’ve tried to edit my hibernate.cfg.xml file this way:

<session-factory name="java:hibernate/SessionFactory">

And the error reportd has been changed to:

30.6.2012 13:38:23 org.apache.catalina.session.StandardManager startInternal
SEVERE: Exception loading sessions from persistent storage
java.lang.NullPointerException
    at java.util.concurrent.ConcurrentHashMap.get(Unknown Source)
    at org.hibernate.internal.SessionFactoryRegistry.getSessionFactory(SessionFactoryRegistry.java:140)
    at org.hibernate.internal.SessionFactoryRegistry.getNamedSessionFactory(SessionFactoryRegistry.java:135)
    at org.hibernate.internal.SessionFactoryImpl.locateSessionFactoryOnDeserialization(SessionFactoryImpl.java:2000)
    at org.hibernate.internal.SessionFactoryImpl.deserialize(SessionFactoryImpl.java:2037)
....

Don’t you ever met with this error reports?

  • 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-06-06T23:27:06+00:00Added an answer on June 6, 2026 at 11:27 pm

    You don’t want instances of Session, SessionFactory or DaoSF to be serialized. They are transient and cannot be restored from a file. You better figure out where and why they are serialized to a file in the first place. That’s where you need to make a fix.

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

Sidebar

Related Questions

Continue solving this problem , i've found couple of 'org.hibernate.impl.SessionFactoryImpl' memory leaks using MAT
So continue from this: Linking how PHP/HTML Please check the answer i accepted, and
Continue solving this problem , I've replaced Mojarra by MyFaces and upgrade JDK and
I would like to continue the discussion from this post: GPX Schema validation problems
In continue of this topic I want to save expanded nodes in cookie. Is
i continue with this question.Its help and work. regex for special character .My regex
I continue to get this as I'm uploading my Android app information, screen shots,
I have a 'Continue Reading' function that looks like this: function twentyten_continue_reading_link() { global
I continue with a MVC Web App, and now I'm between the concepts of
Continue from this topic link text Hi guys. I am using codeigniter and want

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.