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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:57:35+00:00 2026-06-06T10:57:35+00:00

I have a configuration listener that creates a Hibernate session when a user hits

  • 0

I have a configuration listener that creates a Hibernate session when a user hits the application. I’m getting an error from the contextDestroyed method. Can anyone help me with this? Here is the method that’s causing the problem.

public void contextDestroyed(ServletContextEvent arg0) {
    this.sessionFactory.close();
}

Here are the error messages on my console.

SEVERE: Exception sending context initialized event to listener instance of class com.configuration.ConfigurationListener
java.lang.NoClassDefFoundError: org/apache/commons/collections/SequencedHashMap
    at org.hibernate.mapping.Table.<init>(Table.java:32)
    at org.hibernate.cfg.Mappings.addTable(Mappings.java:120)
    at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:251)
    at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:236)
    at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:152)
    at org.hibernate.cfg.Configuration.add(Configuration.java:362)
    at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:400)
    at org.hibernate.cfg.Configuration.addResource(Configuration.java:449)
    at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1263)
    at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1235)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1217)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1184)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1098)
    at com.configuration.ConfigurationListener.contextInitialized(ConfigurationListener.java:19)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.SequencedHashMap
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
    ... 30 more
Jun 25, 2012 5:21:59 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Jun 25, 2012 5:21:59 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/ghs1986] startup failed due to previous errors
Jun 25, 2012 5:21:59 PM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class com.configuration.ConfigurationListener
java.lang.NullPointerException
    at com.configuration.ConfigurationListener.contextDestroyed(ConfigurationListener.java:25)
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3869)
    at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4503)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4367)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
  • 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-06T10:57:36+00:00Added an answer on June 6, 2026 at 10:57 am

    The main problem isn’t in the contextDestroy method. The problem is in your classpath. You’re missing the apache commons collections jar in the classpath. Hibernate depends on it and fails with

    java.lang.ClassNotFoundException: org.apache.commons.collections.SequencedHashMap.

    This causes later the listener’s contextDestoryed method to be invoked. That methods, tries to close() its sessionFactory. But sessionFactory was never initialized since Hibernate never made it up because of the aforementioned ClassNotFoundException.

    It’s all written in the pasted console log.

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

Sidebar

Related Questions

I have some configuration data in a config file that I read off disk
I have a configuration file that I consider to be my base configuration. I'd
I'm writing a Java application that will have an on-screen number pad available for
I have a custom event listener being added (fluently) to my configuration using: .ExposeConfiguration(c
I have an application that runs inside of Websphere, and I am having an
I'm trying to write a web application using Spring MVC. I have a configuration
I have implemented a custom trace listener (derived from TextWriteTraceListener ) and now I
I have a web application that use Sring IoC framework. I use the Java
I have a DefaultMessageListenerContainer setup with the following configuration: threadServiceListenerContainer(org.springframework.jms.listener.DefaultMessageListenerContainer) { maxConcurrentConsumers = 10
A. Simple question. I have 3 instances of Repository that depends on the Configuration.

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.