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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:38:08+00:00 2026-06-03T22:38:08+00:00

On initialisation of the web app, I am trying to inject some static data

  • 0

On initialisation of the web app, I am trying to inject some static data from the DB into the bean.

<bean id="CustomDriven" class="java.util.ArrayList">
        <constructor-arg>
            <value>#{FormCodeHibernateDAO.findAll()}</value>
        </constructor-arg>
    </bean>

I get an error

6:48:07,977 INFO [main] [UpdateTimestampsCache] starting update timestamps cache at region: org.hibernate.cache.UpdateTimestampsCache
16:48:07,981 INFO [main] [StandardQueryCache] starting query cache at region: org.hibernate.cache.StandardQueryCache
16:48:09,016 DEBUG [main] [GenericDaoJpa] findAll()
16:48:09,017 DEBUG [main] [GenericDaoJpa] getting HIBERNATE session…
16:48:09,196 ERROR [main] [GenericDaoJpa] Error when finding all
org.hibernate.SessionException: Session is closed!
at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:72)
at org.hibernate.impl.SessionImpl.setFlushMode(SessionImpl.java:1433)

Any reason why I am getting this?

  • 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-03T22:38:09+00:00Added an answer on June 3, 2026 at 10:38 pm

    I figured the problem, my CustomDriven bean was talking to the DAO Impl directly.

    I changed it to talk to the DAO using a service and the new configuration looks like

    <bean id="CustomDriven" class="java.util.ArrayList">
            <constructor-arg>
                <value>#{dataDrivenService.getDataList()}</value>
            </constructor-arg>
        </bean>
    

    And the DataDriverService class is

    public interface DataDrivenService<T> {
    
        public List<T> getDataList();
     }
    

    And the ServiceImpl is

    @Service( value = "dataDrivenService" )
    public class DataDrivenServiceImpl implements DataDrivenService {
    
        @Autowired
        @Qualifier( value = "formCodeDAO" )
        private FormCodeDAO dao;
    
        @Override
        @Transactional( readOnly = true )
        public List<FormCode> getDataList() {
            return dao.findAll();
        }
    }
    

    Where FormCodeDAO in interface that extends the GenericDAO implementation

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

Sidebar

Related Questions

I'm trying to use Spring to configure a web app deployed in JBoss. I've
I'm trying to deploy (Run as->Run on Server) a basic Roo web-app (MVC +
<?xml version=1.0 encoding=UTF-8?> <web-app xmlns=http://java.sun.com/xml/ns/j2ee xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd version=2.4> <servlet> <servlet-name>InitializationJSP</servlet-name> <jsp-file>/initialization.jsp</jsp-file> <init-param> <param-name>testParam</param-name>
I have a web app that uses Spring's Log4jConfigurer class to initialize my Log4J
I'm adding security to my spring-ws app. i have configured: <sws:interceptors> <bean class=org.springframework.ws.soap.security.xwss.XwsSecurityInterceptor> <property
I am looking into a web app that already uses Quartz. In the web.xml
I'm working on a Java based web app which will consist of a couple
I'm using SpringMVC for a web app as well as to inject my sessionFactory
I have some lisp initialisation code: (eval-when (:compile-toplevel :load-toplevel :execute) (require 'asdf)) (eval-when (:compile-toplevel
I am building a GWT app with Spring. I am having some issues to

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.