Ошибка фсс org hibernate hibernateexception collection is not associated with any session

Вернуться в основную статью

Для облегчения поиска ошибок был создан отдельный раздел для сбора ошибок из АРМ ЭЛН, читайте внимательнее подсказки ниже:


Для поиска по статье нажмите Ctrl+F и введите первые символы кода ошибки или вопроса

Поделиться статьей в:


:!: В случае возникновения ошибки «ERR_SIGN Некорректная подпись головной организации: Ошибка при проверке сертификата. VALID_SIGNATURE ЭП действительна; При проверке сертификата ЭП произошла ошибка. Не удалось найти/получить доступ к списки отозванных сертификатов УЦ. Обратитесь в службу поддержки ФСС

Скачать данный файл — https://disk.yandex.ru/d/HoOPJ5WPC097RQ

Кликнуть правой кнопкой мыши по нему — Установить список отзыва


:!: В случае возникновения ошибки при установке или обновлении программы «GostCryptography.dll Этому файлу не сопоставлена программа для выполнения этого действия»

Необходимо обновить систему и выполнить команды в командной строке от имени администратора:

sfc /scannow

и

DISM /Online /Cleanup-Image /RestoreHealth

После этого необходимо перезагрузиться

Подробнее вы можете прочитать здесь


:!: В случае возникновения «Internal Error COMCryptoAPIClient» :

В командной строке CMD выполнить (с правами администратора):

cd C:FssTools

— для 32 бита:

C:WindowsMicrosoft.NETFrameworkv4.0.30319RegAsm.exe /registered C:FssToolsGostCryptography.dll

— для 64 бита:

C:WindowsMicrosoft.NETFramework64v4.0.30319RegAsm.exe /registered C:FssToolsGostCryptography.dll

:!: В случае возникновения ошибки «Сообщение не соответствует формату XML Encryption»

В меню Администрирование – Настройки сервисов ФСС – Строка соединения укажите следующий адрес сервиса:

https://eln.fss.ru/WSLnCryptoV20/FileOperationsLnService?WSDL

Далее в меню Администрирование – Настройка подписей для сервисов установите галку «Шифровать сообщение». После этого Вам необходимо указать Имя сертификата ФСС и Тип контейнера.


:!: В случае возникновения ошибки «Software caused connection abort: recv failed»


Обычно данная ошибка возникает при бездействии. Когда сервер автоматически закрывает соединение через некоторое время, а клиент получает данную ошибку в ответ на запрос
В иных случаях соединение может прерываться из-за перезапуска СУБД на сервере, когда клиент пытается запрашивать данные по уже несуществующим соединениям

:!: В случае возникновения ошибки «HibernateException: Collection is not associated with any session

Данная ошибка обозначает, что в БД АРМ ЛПУ сохранены строки с одинаковым номером ЭЛН.
Необходимо войти в PGAdmin по пути: C:postgresqlbin
Исполняемый файлpgAdmin3.exe

Пароль для пользователя Postgres — Manager1
и на схеме public выполнить запрос:

WITH t AS (
SELECT ln_code, COUNT(1) FROM public.fc_eln_data_history
GROUP BY ln_code
HAVING COUNT(1) > 1)
SELECT * FROM public.fc_eln_data_history
WHERE ln_code IN (SELECT ln_code FROM t);

Этот запрос выведет строки с одинаковыми номерами ЭЛН. Затем необходимо будет удалить ошибочную строку:
delete from public.fc_eln_data_history where id = ‘ваш id неверной строки’;

Если данный способ не работает и после обновления ПО ошибка повторяется

Необходимо выполнить запрос:

ALTER TABLE public.fc_eln_data_history ADD CONSTRAINT unique_lncode UNIQUE (ln_code);

Это ограничение запрещает создавать в таблице public.fc_eln_data_history строки с одинаковым значением ln_code


:!: В случае возникновения ошибки «В базе данных АРМ ЛПУ имеется некорректная запись» (Transaction already active)

Данная ошибка возникает в случае, когда в какой либо таблице БД приложения сохранены некорректные записи

Для исправления нужно удалить из БД приложения неверную строку (такие записи можно удалить только вручную).

Необходимо подключиться к серверу базы данных PostgreSQL, найти и удалить из базы ошибочную строку. При установке АРМ ЛПУ, вместе с БД и компонентами PostgreSQL устанавливается клиент для подключения к БД. По умолчанию находится здесь: C:postgresqlbinpgAdmin3.exe

В интерфейсе клиента открывается сервер PostgreSQL 9.5. Затем открывается схема fss (пользователь fss, пароль fss) – Схемы – public – Таблицы.

Данные в АРМ ЛПУ хранятся в таблицах:
fc_eln_data_history — данные листков нетрудоспособнсти;

fc_eln_periods — сведения о периодах нетрудоспособности;

ref_ln_numbers — список запрошенных номеров ЭЛН.

Для просмотра таблицы необходимо выделить ее в дереве таблиц и нажать на значок «Просмотр данных в выбранном объекте»
Выделяете и удаляете (delete) строку, которая содержит пустое значение номера ЭЛН или другие ошибки.
Как вариант, для поиска и удаления ошибочных записей возможно использование SQL запроса типа:
select id from fc_eln_data_history where ln_code is null;
delete from fc_eln_data_history where id = ваш id;
Для открытия окна SQL запросов необходимо в главном меню нажать на значок «SQL».

Обратите внимание! При удалении строки ЭЛН, если в этом ЭЛН были созданы периоды нетрудоспособности, сначала необходимо удалить их. Периоды нетрудоспособности хранятся в отдельной таблице fc_eln_periods и связаны с fc_eln_data_history по номеру ЭЛН. Просмотр и удаление периодов аналогично, описанному выше.


:!: В случае возникновения ошибки «Unable to acquire JDBC Connection»

Проблема связана с неработоспособностью сервисов ФСС, необходимо ожидать восстановления


:!: В случае возникновения ошибки «Ошибка вызова сервиса передачи/получения данных. ЛПУ НЕ НАЙДЕН В СПРАВОЧНИКЕ»

Необходимо взять документы и лицензии МО, обратиться (подойти на приём) в территориальный орган Фонда по месту осуществления деятельности. Сотрудники ТОФ внесут МО в соответствующие справочники, после чего МО сможет формировать ЭЛН.


:!: В случае возникновения ошибки «Ошибка вызова сервиса передачи/получения данных. Unmarchalling error: cvc-complex-type.2.4.a: Invalid content was found starting with element»

Для устранения ошибки необходимо снять галочку с постановки на учёт в ранние сроки Также необходимо обновить программу.


:!: В случае возникновения ошибки «Ошибка при проверке сертификата. VALID_SIGNATURE ЭП действительна; При проверке сертификата ЭП произошла ошибка. Ошибка построения цепочки сертификатов. Не найден сертификат Удостоверяющего центра, указанный в сертификате пользователя

Необходимо переустановить ВСЮ цепочку сертификатов уполномоченного лица ФСС


:!: В случае возникновения ошибки «ЭЛН с номером, указанным в поле «Продолжение ЭЛН» не закрыт»

Необходимо
закрыть предыдущий ЭЛН – невозможно отправить на сервис ЭЛН-продолжение, не
закрыв при этом предыдущий ЭЛН


:!: В случае возникновения ошибки «Значение поля (групп полей) отличается от существующего значения»

Ошибка сообщает что невозможно внести изменения в ранее успешно отправленные данные ЭЛН. Понятие
«Группа полей» подразумевает некую неделимую целостность полей в ЭЛН,
например, если при открытии ЭЛН были успешно отправлены значения «Фамилия» и
«Имя», при продлении в эту группу полей невозможно будет добавить «Отчество».
Также невозможно исправить или дополнить ранее отправленные данные по периоду
нетрудоспособности, например, в ранее отправленный период добавить подпись
Председателя ВК;


:!: В случае возникновения ошибки «Направленные данные ЭЛН уже присутствуют в системе»

Вы пытаетесь отправить данные, которые уже присутствуют в системе


:!: В случае возникновения ошибки при запуске программы «Invalid Configuration Location» The configuration area at .. could not be created. Please choose a writable location using the ‘-configuration’ command line option

Пользователю недостаточно места для создания и хранения временных файлов, создаваемых программой.
Проверьте квотирование места на диске: уберите квотирование либо увеличьте доступное пользователю пространство,


:!: В случае возникновения ошибки «Количество новых периодов не должно превышать 1»

Ошибка говорит о том, что вы пытаетесь отправить несколько периодов. За один раз можно
отправить только один период нетрудоспособности


Всем, кому понравился или помог это проект — Вы можете помочь ему развиваться материально:
Donate (помощь проекту)

I have found several questions and answers with regard to this issue on SO, but they all seem to cover one major cause of the problem: fetching a collection outside of a transaction or within another transaction. But in my case, I am fetching within the same transaction when fetching a parent object and collection.

@Service
@Transactional
public class IntegrationServiceImpl implements IntegrationService {
@Override
    public Integration getIntegrationByIdFetchBackendParameters(Long integrationId) {
        Integration integration = integrationDao.get(integrationId);
        //not all integrations have to have backend.
        if (integration.getBackend() != null) {
            Hibernate.initialize(integration.getBackend().getBackendParameters());
        }
        return integration;
    }
...

But when it comes to Hibernate.initialize this branch in org.hibernate.collection.internal.AbstractPersistentCollection
is executed

if ( session == null ) {
                throw new HibernateException( "collection is not associated with any session" );
            }

I cant see why session is null. Would someone explain this and suggest a solution?

EDIT 1 — Full stack trace

org.hibernate.HibernateException: collection is not associated with any session
        at org.hibernate.collection.internal.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:676)
        at org.hibernate.Hibernate.initialize(Hibernate.java:77)
        at com.dhl.finFw.service.IntegrationServiceImpl.getIntegrationByIdFetchBackendParameters(IntegrationServiceImpl.java:169)
        at com.dhl.finFw.web.integration.IntegrationOverviewManagedBean.loadIntegration(IntegrationOverviewManagedBean.java:59)
        at com.dhl.finFw.web.integration.AbstractIntegrationManagedBean.initCommonFields(AbstractIntegrationManagedBean.java:69)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:344)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:295)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:130)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:399)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1481)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
        at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:333)
        at com.dhl.finFw.spring.scope.ViewScope.get(ViewScope.java:30)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:329)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117)
        at org.springframework.beans.factory.access.el.SpringBeanELResolver.getValue(SpringBeanELResolver.java:56)
        at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
        at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
        at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:72)
        at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:185)
        at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
        at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:68)
        at org.apache.el.parser.AstValue.getValue(AstValue.java:161)
        at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:185)
        at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
        at com.sun.faces.facelets.tag.jstl.core.ForEachHandler.apply(ForEachHandler.java:161)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
        at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:166)
        at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
        at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:320)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:379)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:358)
        at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
        at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:120)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
        at com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:106)
        at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:178)
        at com.sun.faces.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:395)
        at com.sun.faces.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:366)
        at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:111)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
        at com.sun.faces.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:179)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
        at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
        at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:320)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:379)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:358)
        at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
        at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:155)
        at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
        at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)
        at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:164)
        at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:870)
        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at com.dhl.finFw.web.filter.FileNotFoundFilter.doFilter(FileNotFoundFilter.java:40)
        at com.dhl.finFw.web.filter.FileNotFoundFilter.doFilter(FileNotFoundFilter.java:35)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:64)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)

Edit 2 — configuration

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="
        http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">

    <bean id="environmentVariablesConfiguration"
          class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig">
        <property name="algorithm" value="PBEWithMD5AndDES" />
        <property name="passwordSysPropertyName" value="APP_ENCRYPTION" />
    </bean>

    <bean id="configurationEncryptor"
          class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
        <property name="config" ref="environmentVariablesConfiguration" />
    </bean>


    <bean id="propertyConfigurer"
          class="org.jasypt.spring31.properties.EncryptablePropertyPlaceholderConfigurer">
        <constructor-arg ref="configurationEncryptor" />
        <property name="locations">
            <list>
                <value>${finFw.config.location}finFwUI.properties</value>
                <value>classpath:application.properties</value>
                <value>classpath:dateTime.properties</value>
            </list>
        </property>
        <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
    </bean>

    <context:component-scan base-package="com.dhl.finFw"/>

    <context:annotation-config/>

    <tx:annotation-driven/>

    <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>

    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="persistenceUnitName" value="FINFW"/>
        <property name="jpaVendorAdapter">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                <property name="generateDdl" value="${finFwUI.orm.generateDdl:false}"/>
                <property name="showSql" value="${finFwUI.orm.showSql:false}"/>
                <property name="databasePlatform" value="${finFwUI.orm.dialect}"/>
            </bean>
        </property>
    </bean>

    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory"/>
    </bean>

    <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>

    <aop:aspectj-autoproxy/>

    <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
        <property name="scopes">
            <map>
                <entry key="view">
                    <bean class="com.dhl.finFw.spring.scope.ViewScope"/>
                </entry>
            </map>
        </property>
    </bean>

    <bean class="org.springframework.web.context.support.ServletContextAttributeExporter">
        <property name="attributes">
            <map>
                <entry key="finFwUIEnvironment" value="${finFwUI.environment}" />
            </map>
        </property>
    </bean>

    <bean id="eventListenerBean" class="com.dhl.finFw.spring.FinFwApplicationListener" />

</beans>

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <display-name>FinFwUI</display-name>
    <description>Financial Framework Configuration</description>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
        <servlet-name>fileServlet</servlet-name>
        <servlet-class>com.dhl.finFw.web.FileServlet</servlet-class>
    </servlet>
    <!-- Location of the Log4J config file, for initialization and refresh checks.
        Applied by Log4jConfigListener. The variable is replaced with System property 
        at runtime. -->
    <context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>${finFw.config.location}log4j-finFwUI.properties</param-value>
    </context-param>
    <!-- Application version. The variable is replaced during Maven build. -->
    <context-param>
        <param-name>applicationVersion</param-name>
        <param-value>${applicationVersion}</param-value>
    </context-param>
    <context-param>
        <param-name>primefaces.THEME</param-name>
        <param-value>dhl</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
        <param-value>/WEB-INF/springsecurity.taglib.xml</param-value>
    </context-param>

    <!-- possible values: Development, Production, SystemTest, UnitTest The 
        variable is replaced during Maven build or set as System property during 
        development. -->
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>${finFwUI.jsf.stage}</param-value>
    </context-param>
    <!-- Spring application context config locations -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            classpath:com/dhl/finFw/finFwUI-core.xml
            classpath:com/dhl/finFw/finFwUI-dataSource.xml
            classpath:com/dhl/finFw/finFwUI-security.xml
            classpath:com/dhl/finFw/finFwUI-forms.xml
            classpath:com/dhl/finFw/finFwUI-audit.xml
        </param-value>
    </context-
    <context-param>
        <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
        <param-value>true</param-value>
    </context-param>
    <session-config>
        <session-timeout>60</session-timeout>
    </session-config>
    <!-- Configures Log4J for this web app. As this context specifies a context-param
        "log4jConfigLocation", its file path is used to load the Log4J configuration. -->
    <listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>
    <!-- Starts Spring application context. The parent one. The web context 
        is started by Dispatcher servlet. -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <listener>
        <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>
    <listener>
        <listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
    </listener>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.faces</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>fileServlet</servlet-name>
        <url-pattern>/file/*</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>/pages/protected/index.xhtml</welcome-file>
    </welcome-file-list>
    <filter>
        <filter-name>encoding-filter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
    <filter>
        <filter-name>fileNotFoundFilter</filter-name>
        <filter-class>com.dhl.finFw.web.filter.FileNotFoundFilter</filter-class>
    </filter>

    <filter>
        <filter-name>browserCacheControlFilter</filter-name>
        <filter-class>com.dhl.finFw.web.filter.BrowserCacheControlFilter</filter-class>
    </filter>
    <filter>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>

    <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>encoding-filter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>fileNotFoundFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>browserCacheControlFilter</filter-name>
        <url-pattern>/pages/protected/integration/subscriptionScheduler.xhtml</url-pattern>
    </filter-mapping>

    <error-page>
        <exception-type>org.springframework.security.access.AccessDeniedException</exception-type>
        <location>/pages/public/error/accessDenied.xhtml</location>
    </error-page>
    <error-page>
        <exception-type>java.lang.Throwable</exception-type>
        <location>/pages/public/error/internal.xhtml</location>
    </error-page>
    <error-page>
        <error-code>500</error-code>
        <location>/pages/public/error/internal.xhtml</location>
    </error-page>
    <error-page>
        <error-code>404</error-code>
        <location>/pages/public/error/notFound.xhtml</location>
    </error-page>
    <error-page>
        <error-code>403</error-code>
        <location>/pages/public/error/accessDenied.xhtml</location>
    </error-page>
</web-app>

ViewScope.java

public class ViewScope implements Scope {

    private Logger logger = LoggerFactory.getLogger(getClass());

    public static final String VIEW_SCOPE_CALLBACKS = "viewScope.callbacks";

    @Override
    public Object get(String name, ObjectFactory<?> objectFactory) {
        Map<String, Object> viewMap = getViewMap();
        Object instance = viewMap.get(name);
        if (instance == null) {
            instance = objectFactory.getObject();
            synchronized (viewMap) {
                viewMap.put(name, instance);
                logger.debug("Bean '{}' has been put to ViewScope.", instance);
            }
        } else {
            logger.debug("Going to return an existing bean '{}'", instance);
        }
        return instance;
    }


    @Override
    public Object remove(String name) {
        Object instance = getViewMap().remove(name);
        if (instance != null) {
            Map<String, Runnable> callbacks = (Map<String, Runnable>) getViewMap().get(VIEW_SCOPE_CALLBACKS);
            if (callbacks != null) {
                callbacks.remove(name);
                logger.debug("Bean '{}' has been removed.", instance);
            }
        }
        return instance;
    }

    @Override
    public void registerDestructionCallback(String name, Runnable runnable) {
        Map<String, Runnable> callbacks = (Map<String, Runnable>) getViewMap().get(VIEW_SCOPE_CALLBACKS);
        if (callbacks != null) {
            callbacks.put(name, runnable);
            logger.debug("Registered callback for '{}'", name);
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Object resolveContextualObject(String name) {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        FacesRequestAttributes facesRequestAttributes = new FacesRequestAttributes(facesContext);
        return facesRequestAttributes.resolveReference(name);
    }

    @Override
    public String getConversationId() {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        FacesRequestAttributes facesRequestAttributes = new FacesRequestAttributes(facesContext);
        return facesRequestAttributes.getSessionId() + "-" + facesContext.getViewRoot().getViewId();
    }

    private Map<String, Object> getViewMap() {
        return FacesContext.getCurrentInstance().getViewRoot().getViewMap();
    }

}

A friend of mine have got a peculiar problem in an open source software OscarMcmaster. He asked me to help and I am able to get to the code causing problem. The following is a method:

 public BillingService getBillingCodeByCode(String code){
    List list = billingServiceDao.findBillingCodesByCode( code,"BC");
    if(list == null || list.size() ==0 ){
        return null;
    }
    return (BillingService) list.get(0);
  }

The billingServiceDao is initialized by Spring container:

private static BillingServiceDao billingServiceDao = 
                  (BillingServiceDao) SpringUtils.getBean("billingServiceDao");

In BillingServiceDao class following code is executed:

public List<BillingService> findBillingCodesByCode(String code, String region) {
    Query query = entityManager.createQuery("select bs  from....");
    query.setParameter("code", code + "%");
    query.setParameter("region", region);

    @SuppressWarnings("unchecked")
    List<BillingService> list = query.getResultList();
    return list;
}

The culprit is query.getResultList(); but I’m from other universe (.Net) and don’t know the remedy for the problem.

Please help me help my friend solve this problem.

EDIT:- Stack Trace

SEVERE: Servlet.service() for servlet action threw exception
org.hibernate.HibernateException: collection is not associated with any session
    at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:449)
    at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:797)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:241)
    at org.hibernate.loader.Loader.doList(Loader.java:2220)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
    at org.hibernate.loader.Loader.list(Loader.java:2099)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
    at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
    at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:66)
    at org.oscarehr.common.dao.BillingServiceDao.findBillingCodesByCode(BillingServiceDao.java:47)
    at org.oscarehr.common.dao.BillingServiceDao$$FastClassByCGLIB$$f613fb7e.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)

I have found several questions and answers with regard to this issue on SO, but they all seem to cover one major cause of the problem: fetching a collection outside of a transaction or within another transaction. But in my case, I am fetching within the same transaction when fetching a parent object and collection.

@Service
@Transactional
public class IntegrationServiceImpl implements IntegrationService {
@Override
    public Integration getIntegrationByIdFetchBackendParameters(Long integrationId) {
        Integration integration = integrationDao.get(integrationId);
        //not all integrations have to have backend.
        if (integration.getBackend() != null) {
            Hibernate.initialize(integration.getBackend().getBackendParameters());
        }
        return integration;
    }
...

But when it comes to Hibernate.initialize this branch in org.hibernate.collection.internal.AbstractPersistentCollection
is executed

if ( session == null ) {
                throw new HibernateException( "collection is not associated with any session" );
            }

I cant see why session is null. Would someone explain this and suggest a solution?

EDIT 1 — Full stack trace

org.hibernate.HibernateException: collection is not associated with any session
at org.hibernate.collection.internal.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:676)
at org.hibernate.Hibernate.initialize(Hibernate.java:77)
at com.dhl.finFw.service.IntegrationServiceImpl.getIntegrationByIdFetchBackendParameters(IntegrationServiceImpl.java:169)
at com.dhl.finFw.web.integration.IntegrationOverviewManagedBean.loadIntegration(IntegrationOverviewManagedBean.java:59)
at com.dhl.finFw.web.integration.AbstractIntegrationManagedBean.initCommonFields(AbstractIntegrationManagedBean.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:344)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:295)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:130)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:399)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1481)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:333)
at com.dhl.finFw.spring.scope.ViewScope.get(ViewScope.java:30)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:329)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117)
at org.springframework.beans.factory.access.el.SpringBeanELResolver.getValue(SpringBeanELResolver.java:56)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:72)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:185)
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:68)
at org.apache.el.parser.AstValue.getValue(AstValue.java:161)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:185)
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
at com.sun.faces.facelets.tag.jstl.core.ForEachHandler.apply(ForEachHandler.java:161)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:166)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:320)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:379)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:358)
at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
at com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:106)
at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:178)
at com.sun.faces.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:395)
at com.sun.faces.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:366)
at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:111)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
at com.sun.faces.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:179)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:320)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:379)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:358)
at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:155)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)
at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:164)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:870)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.dhl.finFw.web.filter.FileNotFoundFilter.doFilter(FileNotFoundFilter.java:40)
at com.dhl.finFw.web.filter.FileNotFoundFilter.doFilter(FileNotFoundFilter.java:35)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:64)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

Edit 2 — configuration

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<bean id="environmentVariablesConfiguration"
class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig">
<property name="algorithm" value="PBEWithMD5AndDES" />
<property name="passwordSysPropertyName" value="APP_ENCRYPTION" />
</bean>
<bean id="configurationEncryptor"
class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
<property name="config" ref="environmentVariablesConfiguration" />
</bean>
<bean id="propertyConfigurer"
class="org.jasypt.spring31.properties.EncryptablePropertyPlaceholderConfigurer">
<constructor-arg ref="configurationEncryptor" />
<property name="locations">
<list>
<value>${finFw.config.location}finFwUI.properties</value>
<value>classpath:application.properties</value>
<value>classpath:dateTime.properties</value>
</list>
</property>
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
</bean>
<context:component-scan base-package="com.dhl.finFw"/>
<context:annotation-config/>
<tx:annotation-driven/>
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="persistenceUnitName" value="FINFW"/>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="generateDdl" value="${finFwUI.orm.generateDdl:false}"/>
<property name="showSql" value="${finFwUI.orm.showSql:false}"/>
<property name="databasePlatform" value="${finFwUI.orm.dialect}"/>
</bean>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>
<bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
<aop:aspectj-autoproxy/>
<bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
<property name="scopes">
<map>
<entry key="view">
<bean class="com.dhl.finFw.spring.scope.ViewScope"/>
</entry>
</map>
</property>
</bean>
<bean class="org.springframework.web.context.support.ServletContextAttributeExporter">
<property name="attributes">
<map>
<entry key="finFwUIEnvironment" value="${finFwUI.environment}" />
</map>
</property>
</bean>
<bean id="eventListenerBean" class="com.dhl.finFw.spring.FinFwApplicationListener" />
</beans>

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name>FinFwUI</display-name>
<description>Financial Framework Configuration</description>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>fileServlet</servlet-name>
<servlet-class>com.dhl.finFw.web.FileServlet</servlet-class>
</servlet>
<!-- Location of the Log4J config file, for initialization and refresh checks.
Applied by Log4jConfigListener. The variable is replaced with System property 
at runtime. -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>${finFw.config.location}log4j-finFwUI.properties</param-value>
</context-param>
<!-- Application version. The variable is replaced during Maven build. -->
<context-param>
<param-name>applicationVersion</param-name>
<param-value>${applicationVersion}</param-value>
</context-param>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>dhl</param-value>
</context-param>
<context-param>
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/springsecurity.taglib.xml</param-value>
</context-param>
<!-- possible values: Development, Production, SystemTest, UnitTest The 
variable is replaced during Maven build or set as System property during 
development. -->
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>${finFwUI.jsf.stage}</param-value>
</context-param>
<!-- Spring application context config locations -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:com/dhl/finFw/finFwUI-core.xml
classpath:com/dhl/finFw/finFwUI-dataSource.xml
classpath:com/dhl/finFw/finFwUI-security.xml
classpath:com/dhl/finFw/finFwUI-forms.xml
classpath:com/dhl/finFw/finFwUI-audit.xml
</param-value>
</context-
<context-param>
<param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
<param-value>true</param-value>
</context-param>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
<!-- Configures Log4J for this web app. As this context specifies a context-param
"log4jConfigLocation", its file path is used to load the Log4J configuration. -->
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<!-- Starts Spring application context. The parent one. The web context 
is started by Dispatcher servlet. -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
</listener>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>fileServlet</servlet-name>
<url-pattern>/file/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/pages/protected/index.xhtml</welcome-file>
</welcome-file-list>
<filter>
<filter-name>encoding-filter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter>
<filter-name>fileNotFoundFilter</filter-name>
<filter-class>com.dhl.finFw.web.filter.FileNotFoundFilter</filter-class>
</filter>
<filter>
<filter-name>browserCacheControlFilter</filter-name>
<filter-class>com.dhl.finFw.web.filter.BrowserCacheControlFilter</filter-class>
</filter>
<filter>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>encoding-filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>fileNotFoundFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>browserCacheControlFilter</filter-name>
<url-pattern>/pages/protected/integration/subscriptionScheduler.xhtml</url-pattern>
</filter-mapping>
<error-page>
<exception-type>org.springframework.security.access.AccessDeniedException</exception-type>
<location>/pages/public/error/accessDenied.xhtml</location>
</error-page>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/pages/public/error/internal.xhtml</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/pages/public/error/internal.xhtml</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/pages/public/error/notFound.xhtml</location>
</error-page>
<error-page>
<error-code>403</error-code>
<location>/pages/public/error/accessDenied.xhtml</location>
</error-page>
</web-app>

ViewScope.java

public class ViewScope implements Scope {
private Logger logger = LoggerFactory.getLogger(getClass());
public static final String VIEW_SCOPE_CALLBACKS = "viewScope.callbacks";
@Override
public Object get(String name, ObjectFactory<?> objectFactory) {
Map<String, Object> viewMap = getViewMap();
Object instance = viewMap.get(name);
if (instance == null) {
instance = objectFactory.getObject();
synchronized (viewMap) {
viewMap.put(name, instance);
logger.debug("Bean '{}' has been put to ViewScope.", instance);
}
} else {
logger.debug("Going to return an existing bean '{}'", instance);
}
return instance;
}
@Override
public Object remove(String name) {
Object instance = getViewMap().remove(name);
if (instance != null) {
Map<String, Runnable> callbacks = (Map<String, Runnable>) getViewMap().get(VIEW_SCOPE_CALLBACKS);
if (callbacks != null) {
callbacks.remove(name);
logger.debug("Bean '{}' has been removed.", instance);
}
}
return instance;
}
@Override
public void registerDestructionCallback(String name, Runnable runnable) {
Map<String, Runnable> callbacks = (Map<String, Runnable>) getViewMap().get(VIEW_SCOPE_CALLBACKS);
if (callbacks != null) {
callbacks.put(name, runnable);
logger.debug("Registered callback for '{}'", name);
}
}
/**
* {@inheritDoc}
*/
@Override
public Object resolveContextualObject(String name) {
FacesContext facesContext = FacesContext.getCurrentInstance();
FacesRequestAttributes facesRequestAttributes = new FacesRequestAttributes(facesContext);
return facesRequestAttributes.resolveReference(name);
}
@Override
public String getConversationId() {
FacesContext facesContext = FacesContext.getCurrentInstance();
FacesRequestAttributes facesRequestAttributes = new FacesRequestAttributes(facesContext);
return facesRequestAttributes.getSessionId() + "-" + facesContext.getViewRoot().getViewId();
}
private Map<String, Object> getViewMap() {
return FacesContext.getCurrentInstance().getViewRoot().getViewMap();
}
}

Вернуться в основную статью

Для облегчения поиска ошибок был создан отдельный раздел для сбора ошибок из АРМ ЭЛН, читайте внимательнее подсказки ниже:


Для поиска по статье нажмите Ctrl+F и введите первые символы кода ошибки или вопроса

Поделиться статьей в:

  • Telegram
  • Vk

:!: В случае возникновения ошибки «ERR_SIGN Некорректная подпись головной организации: Ошибка при проверке сертификата. VALID_SIGNATURE ЭП действительна; При проверке сертификата ЭП произошла ошибка. Не удалось найти/получить доступ к списки отозванных сертификатов УЦ. Обратитесь в службу поддержки ФСС

Скачать данный файл — https://disk.yandex.ru/d/HoOPJ5WPC097RQ

Кликнуть правой кнопкой мыши по нему — Установить список отзыва


:!: В случае возникновения ошибки при установке или обновлении программы «GostCryptography.dll Этому файлу не сопоставлена программа для выполнения этого действия»

Необходимо обновить систему и выполнить команды в командной строке от имени администратора:

sfc /scannow

и

DISM /Online /Cleanup-Image /RestoreHealth

После этого необходимо перезагрузиться

Подробнее вы можете прочитать здесь


:!: В случае возникновения «Internal Error COMCryptoAPIClient» :

В командной строке CMD выполнить (с правами администратора):

cd C:FssTools

— для 32 бита:

C:WindowsMicrosoft.NETFrameworkv4.0.30319RegAsm.exe /registered C:FssToolsGostCryptography.dll

— для 64 бита:

C:WindowsMicrosoft.NETFramework64v4.0.30319RegAsm.exe /registered C:FssToolsGostCryptography.dll

:!: В случае возникновения ошибки «Сообщение не соответствует формату XML Encryption»

В меню Администрирование – Настройки сервисов ФСС – Строка соединения укажите следующий адрес сервиса:

https://eln.fss.ru/WSLnCryptoV20/FileOperationsLnService?WSDL

Далее в меню Администрирование – Настройка подписей для сервисов установите галку «Шифровать сообщение». После этого Вам необходимо указать Имя сертификата ФСС и Тип контейнера.


:!: В случае возникновения ошибки «Software caused connection abort: recv failed»


Обычно данная ошибка возникает при бездействии. Когда сервер автоматически закрывает соединение через некоторое время, а клиент получает данную ошибку в ответ на запрос
В иных случаях соединение может прерываться из-за перезапуска СУБД на сервере, когда клиент пытается запрашивать данные по уже несуществующим соединениям

:!: В случае возникновения ошибки «HibernateException: Collection is not associated with any session

Данная ошибка обозначает, что в БД АРМ ЛПУ сохранены строки с одинаковым номером ЭЛН.
Необходимо войти в PGAdmin по пути: C:postgresqlbin
Исполняемый файлpgAdmin3.exe

Пароль для пользователя Postgres — Manager1
и на схеме public выполнить запрос:

WITH t AS (
SELECT ln_code, COUNT(1) FROM public.fc_eln_data_history
GROUP BY ln_code
HAVING COUNT(1) > 1)
SELECT * FROM public.fc_eln_data_history
WHERE ln_code IN (SELECT ln_code FROM t);

Этот запрос выведет строки с одинаковыми номерами ЭЛН. Затем необходимо будет удалить ошибочную строку:
delete from public.fc_eln_data_history where id = ‘ваш id неверной строки’;

Если данный способ не работает и после обновления ПО ошибка повторяется

Необходимо выполнить запрос:

ALTER TABLE public.fc_eln_data_history ADD CONSTRAINT unique_lncode UNIQUE (ln_code);

Это ограничение запрещает создавать в таблице public.fc_eln_data_history строки с одинаковым значением ln_code


:!: В случае возникновения ошибки «В базе данных АРМ ЛПУ имеется некорректная запись» (Transaction already active)

Данная ошибка возникает в случае, когда в какой либо таблице БД приложения сохранены некорректные записи

Для исправления нужно удалить из БД приложения неверную строку (такие записи можно удалить только вручную).

Необходимо подключиться к серверу базы данных PostgreSQL, найти и удалить из базы ошибочную строку. При установке АРМ ЛПУ, вместе с БД и компонентами PostgreSQL устанавливается клиент для подключения к БД. По умолчанию находится здесь: C:postgresqlbinpgAdmin3.exe

В интерфейсе клиента открывается сервер PostgreSQL 9.5. Затем открывается схема fss (пользователь fss, пароль fss) – Схемы – public – Таблицы.

Данные в АРМ ЛПУ хранятся в таблицах:
fc_eln_data_history — данные листков нетрудоспособнсти;

fc_eln_periods — сведения о периодах нетрудоспособности;

ref_ln_numbers — список запрошенных номеров ЭЛН.

Для просмотра таблицы необходимо выделить ее в дереве таблиц и нажать на значок «Просмотр данных в выбранном объекте»
Выделяете и удаляете (delete) строку, которая содержит пустое значение номера ЭЛН или другие ошибки.
Как вариант, для поиска и удаления ошибочных записей возможно использование SQL запроса типа:
select id from fc_eln_data_history where ln_code is null;
delete from fc_eln_data_history where id = ваш id;
Для открытия окна SQL запросов необходимо в главном меню нажать на значок «SQL».

Обратите внимание! При удалении строки ЭЛН, если в этом ЭЛН были созданы периоды нетрудоспособности, сначала необходимо удалить их. Периоды нетрудоспособности хранятся в отдельной таблице fc_eln_periods и связаны с fc_eln_data_history по номеру ЭЛН. Просмотр и удаление периодов аналогично, описанному выше.


:!: В случае возникновения ошибки «Unable to acquire JDBC Connection»

Проблема связана с неработоспособностью сервисов ФСС, необходимо ожидать восстановления


:!: В случае возникновения ошибки «Ошибка вызова сервиса передачи/получения данных. ЛПУ НЕ НАЙДЕН В СПРАВОЧНИКЕ»

Необходимо взять документы и лицензии МО, обратиться (подойти на приём) в территориальный орган Фонда по месту осуществления деятельности. Сотрудники ТОФ внесут МО в соответствующие справочники, после чего МО сможет формировать ЭЛН.


:!: В случае возникновения ошибки «Ошибка вызова сервиса передачи/получения данных. Unmarchalling error: cvc-complex-type.2.4.a: Invalid content was found starting with element»

Для устранения ошибки необходимо снять галочку с постановки на учёт в ранние сроки Также необходимо обновить программу.


:!: В случае возникновения ошибки «Ошибка при проверке сертификата. VALID_SIGNATURE ЭП действительна; При проверке сертификата ЭП произошла ошибка. Ошибка построения цепочки сертификатов. Не найден сертификат Удостоверяющего центра, указанный в сертификате пользователя

Необходимо переустановить ВСЮ цепочку сертификатов уполномоченного лица ФСС


:!: В случае возникновения ошибки «ЭЛН с номером, указанным в поле «Продолжение ЭЛН» не закрыт»

Необходимо
закрыть предыдущий ЭЛН – невозможно отправить на сервис ЭЛН-продолжение, не
закрыв при этом предыдущий ЭЛН


:!: В случае возникновения ошибки «Значение поля (групп полей) отличается от существующего значения»

Ошибка сообщает что невозможно внести изменения в ранее успешно отправленные данные ЭЛН. Понятие
«Группа полей» подразумевает некую неделимую целостность полей в ЭЛН,
например, если при открытии ЭЛН были успешно отправлены значения «Фамилия» и
«Имя», при продлении в эту группу полей невозможно будет добавить «Отчество».
Также невозможно исправить или дополнить ранее отправленные данные по периоду
нетрудоспособности, например, в ранее отправленный период добавить подпись
Председателя ВК;


:!: В случае возникновения ошибки «Направленные данные ЭЛН уже присутствуют в системе»

Вы пытаетесь отправить данные, которые уже присутствуют в системе


:!: В случае возникновения ошибки при запуске программы «Invalid Configuration Location» The configuration area at .. could not be created. Please choose a writable location using the ‘-configuration’ command line option

Пользователю недостаточно места для создания и хранения временных файлов, создаваемых программой.
Проверьте квотирование места на диске: уберите квотирование либо увеличьте доступное пользователю пространство,


:!: В случае возникновения ошибки «Количество новых периодов не должно превышать 1»

Ошибка говорит о том, что вы пытаетесь отправить несколько периодов. За один раз можно
отправить только один период нетрудоспособности


Всем, кому понравился или помог это проект — Вы можете помочь ему развиваться материально:
Donate (помощь проекту)

У моего друга особая проблема с программным обеспечением с открытым исходным кодом. OscarMcmaster. Он попросил меня помочь, и я смог добраться до кода, вызывающего проблему. Ниже приводится метод:

 public BillingService getBillingCodeByCode(String code){
List list = billingServiceDao.findBillingCodesByCode( code,"BC");
if(list == null || list.size() ==0 ){
return null;
}
return (BillingService) list.get(0);
}

Компания billingServiceDao инициализируется Spring контейнер:

private static BillingServiceDao billingServiceDao = 
(BillingServiceDao) SpringUtils.getBean("billingServiceDao");

In BillingServiceDao выполняется следующий код класса:

public List<BillingService> findBillingCodesByCode(String code, String region) {
Query query = entityManager.createQuery("select bs  from....");
query.setParameter("code", code + "%");
query.setParameter("region", region);
@SuppressWarnings("unchecked")
List<BillingService> list = query.getResultList();
return list;
}

Виновник query.getResultList(); но я из другой вселенной (.Net) и не знаю решения проблемы.

Помогите, пожалуйста, помочь моему другу решить эту проблему.

РЕДАКТИРОВАТЬ: — Трассировка стека

SEVERE: Servlet.service() for servlet action threw exception
org.hibernate.HibernateException: collection is not associated with any session
at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:449)
at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:797)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:241)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:66)
at org.oscarehr.common.dao.BillingServiceDao.findBillingCodesByCode(BillingServiceDao.java:47)
at org.oscarehr.common.dao.BillingServiceDao$$FastClassByCGLIB$$f613fb7e.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)

Hibernate version: 3.0

Mapping documents:

Code:

<hibernate-mapping>
   <class name=»org.gbif.hibernate.tcn.Taxa» table=»taxa»>
      <id name=»recordId» column=»record_id» type=»long»>
         <generator class=»native»>
         </generator>
      </id>
      <property name=»name» type=»java.lang.String» update=»true» insert=»true»
         column=»name»/>
      <property name=»nameCode» type=»java.lang.String» update=»true»
         insert=»true» column=»name_code»/>
      <property name=»taxon» type=»java.lang.String» update=»true» insert=»true»
         column=»taxon»/>
      <set name=»commonNames» lazy=»false»>
         <key column=»name_code» property-ref=»nameCode»/>
         <one-to-many class=»org.gbif.hibernate.tcn.CommonName»/>
      </set>
   </class>
</hibernate-mapping>

Has a set of (note that the join is NOT on the primary key — it’s on a name_code that is on both tables)

Code:

<hibernate-mapping>
   <class name=»org.gbif.hibernate.tcn.CommonName» table=»common_names»>
      <id name=»recordId» column=»record_id» type=»long»>
         <generator class=»native»>
         </generator>
      </id>      
      <property name=»commonName» type=»java.lang.String» update=»true»
         insert=»true» column=»common_name»/>
      <property name=»nameCode» type=»java.lang.String» update=»true»
         insert=»true» column=»name_code»/>      
   </class>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():

Code:

List<Taxa> results = (List<Taxa>) session.createQuery(«from Taxa where name like(‘%a%’) and taxon=’Kingdom’»).list();

Full stack trace of any exception that occurs:

Code:

org.hibernate.HibernateException: collection is not associated with any session
   at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:449)
   at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:791)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:228)
   at org.hibernate.loader.Loader.doList(Loader.java:2147)
   at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2026)
   at org.hibernate.loader.Loader.list(Loader.java:2021)
   at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
   at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:298)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1020)
   at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
   at org.gbif.hibernate.tcn.Test.listTaxaByNameAndRank(Test.java:45)
   at org.gbif.hibernate.tcn.Test.run(Test.java:27)
   at org.gbif.hibernate.tcn.Test.main(Test.java:66)

Name and version of the database you are using:
MySQL 4.1

The generated SQL (show_sql=true):

Code:

Hibernate: select taxa0_.record_id as record1_0_, taxa0_.name as name0_, taxa0_.name_code as name3_0_, taxa0_.taxon as taxon0_ from taxa taxa0_ where (taxa0_.name like ‘%a%’) and taxa0_.taxon=’Kingdom’
Hibernate: select commonname0_.name_code as name3_1_, commonname0_.record_id as record1_1_, commonname0_.record_id as record1_1_0_, commonname0_.common_name as common2_1_0_, commonname0_.name_code as name3_1_0_ from common_names commonname0_ where commonname0_.name_code=?

Debug level Hibernate log excerpt:

Code:

DEBUG [SessionImpl]  opened session at timestamp: 4657754688446464
DEBUG [SessionImpl]  find: from Taxa where name like(‘%a%’) and taxon=’Kingdom’
DEBUG [QueryParameters]  named parameters: {}
DEBUG [QueryTranslatorImpl]  parse() — HQL: from org.gbif.hibernate.tcn.Taxa where name like(‘%a%’) and taxon=’Kingdom’
DEBUG [AST]  — HQL AST —
-[QUERY] ‘query’
    +-[SELECT_FROM] ‘SELECT_FROM’
    |  -[FROM] ‘from’
    |     -[RANGE] ‘RANGE’
    |        -[DOT] ‘.’
    |           +-[DOT] ‘.’
    |           |  +-[DOT] ‘.’
    |           |  |  +-[DOT] ‘.’
    |           |  |  |  +-[IDENT] ‘org’
    |           |  |  |  -[IDENT] ‘gbif’
    |           |  |  -[IDENT] ‘hibernate’
    |           |  -[IDENT] ‘tcn’
    |           -[IDENT] ‘Taxa’
    -[WHERE] ‘where’
       -[AND] ‘and’
          +-[LIKE] ‘like’
          |  +-[IDENT] ‘name’
          |  -[QUOTED_STRING] »%a%»
          -[EQ] ‘=’
             +-[IDENT] ‘taxon’
             -[QUOTED_STRING] »Kingdom»

DEBUG [ErrorCounter]  throwQueryException() : no errors
DEBUG [HqlSqlBaseWalker]  select << begin [level=1, statement=select]
DEBUG [FromElement]  FromClause{level=1} :  org.gbif.hibernate.tcn.Taxa (no alias) -> taxa0_
DEBUG [FromReferenceNode]  Resolved :  name -> taxa0_.name
DEBUG [FromReferenceNode]  Resolved :  taxon -> taxa0_.taxon
DEBUG [HqlSqlBaseWalker]  select : finishing up [level=1, statement=select]
DEBUG [HqlSqlWalker]  processQuery() :  ( SELECT ( FromClause{level=1} taxa taxa0_ ) ( where ( and ( like taxa0_.name ‘%a%’ ) ( = taxa0_.taxon ‘Kingdom’ ) ) ) )
DEBUG [HqlSqlWalker]  Derived SELECT clause created.
DEBUG [JoinProcessor]  Using FROM fragment [taxa taxa0_]
DEBUG [HqlSqlBaseWalker]  select >> end [level=1, statement=select]
DEBUG [AST]  — SQL AST —
-[SELECT] QueryNode: ‘SELECT’  querySpaces (taxa)
    +-[SELECT_CLAUSE] SelectClause: ‘{derived select clause}’
    |  +-[SELECT_EXPR] SelectExpressionImpl: ‘taxa0_.record_id as record1_0_’ {FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=taxa,tableAlias=taxa0_,origin=null,colums={,className=org.gbif.hibernate.tcn.Taxa}}}
    |  -[SQL_TOKEN] SqlFragment: ‘taxa0_.name as name0_, taxa0_.name_code as name3_0_, taxa0_.taxon as taxon0_’
    +-[FROM] FromClause: ‘from’ FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[], fromElementByTableAlias=[taxa0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
    |  -[FROM_FRAGMENT] FromElement: ‘taxa taxa0_’ FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=taxa,tableAlias=taxa0_,origin=null,colums={,className=org.gbif.hibernate.tcn.Taxa}}
    -[WHERE] SqlNode: ‘where’
       -[AND] SqlNode: ‘and’
          +-[LIKE] BinaryLogicOperatorNode: ‘like’
          |  +-[SQL_TOKEN] IdentNode: ‘taxa0_.name’ {originalText=name}
          |  -[QUOTED_STRING] LiteralNode: »%a%»
          -[EQ] BinaryLogicOperatorNode: ‘=’
             +-[SQL_TOKEN] IdentNode: ‘taxa0_.taxon’ {originalText=taxon}
             -[QUOTED_STRING] LiteralNode: »Kingdom»

DEBUG [ErrorCounter]  throwQueryException() : no errors
DEBUG [QueryTranslatorImpl]  HQL: from org.gbif.hibernate.tcn.Taxa where name like(‘%a%’) and taxon=’Kingdom’
DEBUG [QueryTranslatorImpl]  SQL: select taxa0_.record_id as record1_0_, taxa0_.name as name0_, taxa0_.name_code as name3_0_, taxa0_.taxon as taxon0_ from taxa taxa0_ where (taxa0_.name like ‘%a%’) and taxa0_.taxon=’Kingdom’
DEBUG [ErrorCounter]  throwQueryException() : no errors
DEBUG [AbstractBatcher]  about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
DEBUG [ConnectionManager]  opening JDBC connection
DEBUG [DriverManagerConnectionProvider]  total checked-out connections: 0
DEBUG [DriverManagerConnectionProvider]  using pooled JDBC connection, pool size: 0
DEBUG [SQL]  select taxa0_.record_id as record1_0_, taxa0_.name as name0_, taxa0_.name_code as name3_0_, taxa0_.taxon as taxon0_ from taxa taxa0_ where (taxa0_.name like ‘%a%’) and taxa0_.taxon=’Kingdom’
Hibernate: select taxa0_.record_id as record1_0_, taxa0_.name as name0_, taxa0_.name_code as name3_0_, taxa0_.taxon as taxon0_ from taxa taxa0_ where (taxa0_.name like ‘%a%’) and taxa0_.taxon=’Kingdom’
DEBUG [AbstractBatcher]  preparing statement
DEBUG [AbstractBatcher]  about to open ResultSet (open ResultSets: 0, globally: 0)
DEBUG [Loader]  processing result set
DEBUG [Loader]  result set row: 0
DEBUG [LongType]  returning ‘1241647’ as column: record1_0_
DEBUG [Loader]  result row: EntityKey[org.gbif.hibernate.tcn.Taxa#1241647]
DEBUG [Loader]  Initializing object from ResultSet: [org.gbif.hibernate.tcn.Taxa#1241647]
DEBUG [AbstractEntityPersister]  Hydrating entity: [org.gbif.hibernate.tcn.Taxa#1241647]
DEBUG [StringType]  returning ‘Animalia’ as column: name0_
DEBUG [StringType]  returning » as column: name3_0_
DEBUG [StringType]  returning ‘Kingdom’ as column: taxon0_
DEBUG [Loader]  result set row: 1
DEBUG [LongType]  returning ‘1246353’ as column: record1_0_
DEBUG [Loader]  result row: EntityKey[org.gbif.hibernate.tcn.Taxa#1246353]
DEBUG [Loader]  Initializing object from ResultSet: [org.gbif.hibernate.tcn.Taxa#1246353]
DEBUG [AbstractEntityPersister]  Hydrating entity: [org.gbif.hibernate.tcn.Taxa#1246353]
DEBUG [StringType]  returning ‘Archaea’ as column: name0_
DEBUG [StringType]  returning » as column: name3_0_
DEBUG [StringType]  returning ‘Kingdom’ as column: taxon0_
DEBUG [Loader]  result set row: 2
DEBUG [LongType]  returning ‘1246388’ as column: record1_0_
DEBUG [Loader]  result row: EntityKey[org.gbif.hibernate.tcn.Taxa#1246388]
DEBUG [Loader]  Initializing object from ResultSet: [org.gbif.hibernate.tcn.Taxa#1246388]
DEBUG [AbstractEntityPersister]  Hydrating entity: [org.gbif.hibernate.tcn.Taxa#1246388]
DEBUG [StringType]  returning ‘Bacteria’ as column: name0_
DEBUG [StringType]  returning » as column: name3_0_
DEBUG [StringType]  returning ‘Kingdom’ as column: taxon0_
DEBUG [Loader]  result set row: 3
DEBUG [LongType]  returning ‘1246650’ as column: record1_0_
DEBUG [Loader]  result row: EntityKey[org.gbif.hibernate.tcn.Taxa#1246650]
DEBUG [Loader]  Initializing object from ResultSet: [org.gbif.hibernate.tcn.Taxa#1246650]
DEBUG [AbstractEntityPersister]  Hydrating entity: [org.gbif.hibernate.tcn.Taxa#1246650]
DEBUG [StringType]  returning ‘Chromista’ as column: name0_
DEBUG [StringType]  returning » as column: name3_0_
DEBUG [StringType]  returning ‘Kingdom’ as column: taxon0_
DEBUG [Loader]  result set row: 4
DEBUG [LongType]  returning ‘1247696’ as column: record1_0_
DEBUG [Loader]  result row: EntityKey[org.gbif.hibernate.tcn.Taxa#1247696]
DEBUG [Loader]  Initializing object from ResultSet: [org.gbif.hibernate.tcn.Taxa#1247696]
DEBUG [AbstractEntityPersister]  Hydrating entity: [org.gbif.hibernate.tcn.Taxa#1247696]
DEBUG [StringType]  returning ‘Plantae’ as column: name0_
DEBUG [StringType]  returning » as column: name3_0_
DEBUG [StringType]  returning ‘Kingdom’ as column: taxon0_
DEBUG [Loader]  result set row: 5
DEBUG [LongType]  returning ‘1248864’ as column: record1_0_
DEBUG [Loader]  result row: EntityKey[org.gbif.hibernate.tcn.Taxa#1248864]
DEBUG [Loader]  Initializing object from ResultSet: [org.gbif.hibernate.tcn.Taxa#1248864]
DEBUG [AbstractEntityPersister]  Hydrating entity: [org.gbif.hibernate.tcn.Taxa#1248864]
DEBUG [StringType]  returning ‘Protozoa’ as column: name0_
DEBUG [StringType]  returning » as column: name3_0_
DEBUG [StringType]  returning ‘Kingdom’ as column: taxon0_
DEBUG [Loader]  done processing result set (6 rows)
DEBUG [AbstractBatcher]  about to close ResultSet (open ResultSets: 1, globally: 1)
DEBUG [AbstractBatcher]  about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG [AbstractBatcher]  closing statement
DEBUG [Loader]  total objects hydrated: 6
DEBUG [TwoPhaseLoad]  resolving associations for [org.gbif.hibernate.tcn.Taxa#1241647]
DEBUG [CollectionLoadContext]  creating collection wrapper:[org.gbif.hibernate.tcn.Taxa.commonNames#]
DEBUG [TwoPhaseLoad]  done materializing entity [org.gbif.hibernate.tcn.Taxa#1241647]
DEBUG [TwoPhaseLoad]  resolving associations for [org.gbif.hibernate.tcn.Taxa#1246353]
DEBUG [CollectionLoadContext]  creating collection wrapper:[org.gbif.hibernate.tcn.Taxa.commonNames#]
DEBUG [TwoPhaseLoad]  done materializing entity [org.gbif.hibernate.tcn.Taxa#1246353]
DEBUG [TwoPhaseLoad]  resolving associations for [org.gbif.hibernate.tcn.Taxa#1246388]
DEBUG [CollectionLoadContext]  creating collection wrapper:[org.gbif.hibernate.tcn.Taxa.commonNames#]
DEBUG [TwoPhaseLoad]  done materializing entity [org.gbif.hibernate.tcn.Taxa#1246388]
DEBUG [TwoPhaseLoad]  resolving associations for [org.gbif.hibernate.tcn.Taxa#1246650]
DEBUG [CollectionLoadContext]  creating collection wrapper:[org.gbif.hibernate.tcn.Taxa.commonNames#]
DEBUG [TwoPhaseLoad]  done materializing entity [org.gbif.hibernate.tcn.Taxa#1246650]
DEBUG [TwoPhaseLoad]  resolving associations for [org.gbif.hibernate.tcn.Taxa#1247696]
DEBUG [CollectionLoadContext]  creating collection wrapper:[org.gbif.hibernate.tcn.Taxa.commonNames#]
DEBUG [TwoPhaseLoad]  done materializing entity [org.gbif.hibernate.tcn.Taxa#1247696]
DEBUG [TwoPhaseLoad]  resolving associations for [org.gbif.hibernate.tcn.Taxa#1248864]
DEBUG [CollectionLoadContext]  creating collection wrapper:[org.gbif.hibernate.tcn.Taxa.commonNames#]
DEBUG [TwoPhaseLoad]  done materializing entity [org.gbif.hibernate.tcn.Taxa#1248864]
DEBUG [StatefulPersistenceContext]  initializing non-lazy collections
DEBUG [DefaultInitializeCollectionEventListener]  initializing collection [org.gbif.hibernate.tcn.Taxa.commonNames#]
DEBUG [DefaultInitializeCollectionEventListener]  checking second-level cache
DEBUG [DefaultInitializeCollectionEventListener]  collection not cached
DEBUG [Loader]  loading collection: [org.gbif.hibernate.tcn.Taxa.commonNames#]
DEBUG [AbstractBatcher]  about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
DEBUG [SQL]  select commonname0_.name_code as name3_1_, commonname0_.record_id as record1_1_, commonname0_.record_id as record1_1_0_, commonname0_.common_name as common2_1_0_, commonname0_.name_code as name3_1_0_ from common_names commonname0_ where commonname0_.name_code=?
Hibernate: select commonname0_.name_code as name3_1_, commonname0_.record_id as record1_1_, commonname0_.record_id as record1_1_0_, commonname0_.common_name as common2_1_0_, commonname0_.name_code as name3_1_0_ from common_names commonname0_ where commonname0_.name_code=?
DEBUG [AbstractBatcher]  preparing statement
DEBUG [StringType]  binding » to parameter: 1
DEBUG [AbstractBatcher]  about to open ResultSet (open ResultSets: 0, globally: 0)
DEBUG [Loader]  result set contains (possibly empty) collection: [org.gbif.hibernate.tcn.Taxa.commonNames#]
DEBUG [CollectionLoadContext]  uninitialized collection: initializing
DEBUG [Loader]  processing result set
DEBUG [Loader]  done processing result set (0 rows)
DEBUG [AbstractBatcher]  about to close ResultSet (open ResultSets: 1, globally: 1)
DEBUG [AbstractBatcher]  about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG [AbstractBatcher]  closing statement
DEBUG [Loader]  total objects hydrated: 0
DEBUG [CollectionLoadContext]  1 collections were found in result set for role: org.gbif.hibernate.tcn.Taxa.commonNames
DEBUG [CollectionLoadContext]  collection fully initialized: [org.gbif.hibernate.tcn.Taxa.commonNames#]
DEBUG [CollectionLoadContext]  1 collections initialized for role: org.gbif.hibernate.tcn.Taxa.commonNames
DEBUG [Loader]  done loading collection
DEBUG [DefaultInitializeCollectionEventListener]  collection initialized
DEBUG [JDBCContext]  after autocommit
DEBUG [ConnectionManager]  aggressively releasing JDBC connection
DEBUG [ConnectionManager]  closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
DEBUG [DriverManagerConnectionProvider]  returning connection to pool, pool size: 1
org.hibernate.HibernateException: collection is not associated with any session
   at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:449)
   at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:791)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:228)
   at org.hibernate.loader.Loader.doList(Loader.java:2147)
   at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2026)
   at org.hibernate.loader.Loader.list(Loader.java:2021)
   at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
   at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:298)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1020)
   at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
   at org.gbif.hibernate.tcn.Test.listTaxaByNameAndRank(Test.java:45)
   at org.gbif.hibernate.tcn.Test.run(Test.java:27)
   at org.gbif.hibernate.tcn.Test.main(Test.java:66)

Thanks for looking.


Version 6

    OK, I’m getting this a lot now, and I don’t know what I am doing wrong.

    I am fetching a «parent» object with the following joins:

    {code}@OneToMany(mappedBy="report",fetch=FetchType.EAGER)

    @Fetch(FetchMode.SUBSELECT)
    @OrderBy(value="lineNumber")
    private List<AccountSummaryDetail> details;

    @OneToMany(mappedBy="report",fetch=FetchType.EAGER)

    @Fetch(FetchMode.SUBSELECT)

    private  Set<AccountSummaryLightCount> counts;


    @ManyToMany(fetch=FetchType.EAGER)
    @JoinTable(
         name = "AREA_TO_ACCOUNT",
         joinColumns=@JoinColumn(name="ACCOUNT_NUMBER",  referencedColumnName="ACCOUNT_NUMBER"),
         inverseJoinColumns=@JoinColumn(name="AREA_ID")
    )
    @Fetch(FetchMode.SUBSELECT)
    private Set<Area> areas;{code}

    When I do a basic Criteria search,

    {code}Criteria c = session.createCriteria(AccountSummaryReport.class);

    List rawResults = c.list();{code}

    I get the following exception:

    {code}Caused by: org.hibernate.HibernateException: collection is not associated with any session

        at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:449)

        at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:844)

        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:241)

        at org.hibernate.loader.Loader.doList(Loader.java:2213)

        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)

        at org.hibernate.loader.Loader.list(Loader.java:2099)

        at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)

        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)

        at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283){code}

    I don’t see what I am doing wrong!!  Help?

    I have application that is using JPA 2.0 and Hibernate as the persistence provider. I am using EntityManager to build my queries.

    I am expericing the classic org.hibernate.HibernateException: collection is not associated with any session error on the big set of data. When I am trying to extract just a few Datapoints it is working correctly, but once I am extracting 30+ results I am getting org.hibernate.HibernateException: collection is not associated with any session error. I thought I should not get it since I am using fetch = FetchType.EAGER.

    Any help will be greatly appreciated!

    Here are two of my entities.
    DatapointView:

    @Entity
    @Table(name = "DATAPOINT_VIEW")
    public class DatapointView implements Serializable {
    ...many fields...
    @OneToMany(fetch = FetchType.EAGER )
    @JoinColumn(name = "EXPERIMENT_ID",  referencedColumnName = "EXPERIMENT_ID")
    private List<ExperimentViewEntity> experiments= new ArrayList<ExperimentViewEntity>();
    ...
    }
    

    ExperimentViewEntity:

    @Entity
    @javax.persistence.Table(name = "EXPERIMENT_VIEW")
    public class ExperimentViewEntity {
    ...many fields...
    @Column(name = "EXPERIMENT_ID", nullable = false, insertable = true, updatable = true, length = 36)
    private String experimentId;
    ...
    }
    

    I have application that is using JPA 2.0 and Hibernate as the persistence provider. I am using EntityManager to build my queries.

    I am expericing the classic org.hibernate.HibernateException: collection is not associated with any session error on the big set of data. When I am trying to extract just a few Datapoints it is working correctly, but once I am extracting 30+ results I am getting org.hibernate.HibernateException: collection is not associated with any session error. I thought I should not get it since I am using fetch = FetchType.EAGER.

    Any help will be greatly appreciated!

    Here are two of my entities.
    DatapointView:

    @Entity
    @Table(name = "DATAPOINT_VIEW")
    public class DatapointView implements Serializable {
    ...many fields...
    @OneToMany(fetch = FetchType.EAGER )
    @JoinColumn(name = "EXPERIMENT_ID",  referencedColumnName = "EXPERIMENT_ID")
    private List<ExperimentViewEntity> experiments= new ArrayList<ExperimentViewEntity>();
    ...
    }
    

    ExperimentViewEntity:

    @Entity
    @javax.persistence.Table(name = "EXPERIMENT_VIEW")
    public class ExperimentViewEntity {
    ...many fields...
    @Column(name = "EXPERIMENT_ID", nullable = false, insertable = true, updatable = true, length = 36)
    private String experimentId;
    ...
    }
    

    Fabrizio Gennari created an issue — 28th November 2012, 17:35:17:

    This program

     namespace NhibernateExperiments { using System.Collections.Generic; using System.Reflection; using log4net.Config; using NHibernate; using NHibernate.Cfg; public class Program { public static void Main(string[] args) { BasicConfigurator.Configure(); Configuration configuration = new Configuration().SetProperties(new Dictionary<string, string> { {Environment.ConnectionDriver, "NHibernate.Driver.SQLite20Driver"}, {Environment.ConnectionString, "Data Source=h:testdb;Version=3"}, {Environment.Dialect, "NHibernate.Dialect.SQLiteDialect"}, {Environment.QuerySubstitutions, "true=1;false=0"}, {Environment.ShowSql, "true"}, }).AddAssembly(Assembly.GetExecutingAssembly()); ISessionFactory buildSessionFactory = configuration.BuildSessionFactory(); ISession session = buildSessionFactory.OpenSession(); IEnumerable<CarDealer> carDealers = session.QueryOver<CarDealer>().Future(); foreach (CarDealer carDealer in carDealers) { session.Refresh(carDealer); } } } } 

    is causing a HibernateException «collection is not associated with any session».
    Mapping file

     <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="nhibernateExperiments" namespace="NhibernateExperiments"> <class name="CarDealer" lazy="false"> <id name="id" column="id" access="field"> <generator class="native"/> </id> <property name="Name" /> <set name="models" table="ModelInStock" lazy="false" access="field"> <key column="dealerid"/> <many-to-many class="CarModel" column="modelid"/> </set> </class> <class name="CarModel" lazy="false"> <id name="id" column="id" access="field"> <generator class="native"/> </id> <property name="Name" /> <property name="Year" /> <set name="dealers" table="ModelInStock" lazy="false" access="field"> <key column="modelid"/> <many-to-many class="CarDealer" column="dealerid"/> </set> </class> </hibernate-mapping> 

    Objects

     namespace NhibernateExperiments { using System.Collections.Generic; using Iesi.Collections.Generic; public class CarModel { private readonly Iesi.Collections.Generic.ISet<CarDealer> dealers = new HashedSet<CarDealer>(); private int id; public CarModel(string name, int year) { Year = year; Name = name; } private CarModel() { } public string Name { get; private set; } public int Year{ get; private set; } } public class CarDealer { private readonly Iesi.Collections.Generic.ISet<CarModel> models; private int id; public CarDealer(string name) { this.Name = name; this.models = new HashedSet<CarModel>(); } private CarDealer() { } public string Name { get; private set; } public IEnumerable<CarModel> Models { get { return this.models; } } public void AddModel(CarModel model) { this.models.Add(model); } } } 

    DB schema

     CREATE TABLE CarDealer ( id integer primary key autoincrement, Name varchar(50) ) CREATE TABLE CarModel ( id integer primary key autoincrement, Name varchar(50), Year int ) CREATE TABLE ModelInStock ( modelid integer, dealerid integer, foreign key (dealerid) references CarDealer(id), foreign key (modelid) references CarModel(id) ) 

    Fabrizio Gennari added a comment — 28th November 2012, 17:37:16:

    Sorry, type should be «bug», not «patch»


    Fabrizio Gennari added a comment — 29th November 2012, 10:57:42:

    Workaround is to change the foreach loop

     foreach (CarDealer carDealer in carDealers) { IPersistentCollection collection = carDealer.Models as IPersistentCollection; if (collection != null) { collection.ForceInitialization(); } session.Refresh(carDealer); } 

    Hibernate version: 3.0

    Mapping documents:

    Code:

    <hibernate-mapping>
       <class name=»org.gbif.hibernate.tcn.Taxa» table=»taxa»>
          <id name=»recordId» column=»record_id» type=»long»>
             <generator class=»native»>
             </generator>
          </id>
          <property name=»name» type=»java.lang.String» update=»true» insert=»true»
             column=»name»/>
          <property name=»nameCode» type=»java.lang.String» update=»true»
             insert=»true» column=»name_code»/>
          <property name=»taxon» type=»java.lang.String» update=»true» insert=»true»
             column=»taxon»/>
          <set name=»commonNames» lazy=»false»>
             <key column=»name_code» property-ref=»nameCode»/>
             <one-to-many class=»org.gbif.hibernate.tcn.CommonName»/>
          </set>
       </class>
    </hibernate-mapping>

    Has a set of (note that the join is NOT on the primary key — it’s on a name_code that is on both tables)

    Code:

    <hibernate-mapping>
       <class name=»org.gbif.hibernate.tcn.CommonName» table=»common_names»>
          <id name=»recordId» column=»record_id» type=»long»>
             <generator class=»native»>
             </generator>
          </id>      
          <property name=»commonName» type=»java.lang.String» update=»true»
             insert=»true» column=»common_name»/>
          <property name=»nameCode» type=»java.lang.String» update=»true»
             insert=»true» column=»name_code»/>      
       </class>
    </hibernate-mapping>

    Code between sessionFactory.openSession() and session.close():

    Code:

    List<Taxa> results = (List<Taxa>) session.createQuery(«from Taxa where name like(‘%a%’) and taxon=’Kingdom'»).list();

    Full stack trace of any exception that occurs:

    Code:

    org.hibernate.HibernateException: collection is not associated with any session
       at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:449)
       at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:791)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:228)
       at org.hibernate.loader.Loader.doList(Loader.java:2147)
       at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2026)
       at org.hibernate.loader.Loader.list(Loader.java:2021)
       at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
       at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:298)
       at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1020)
       at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
       at org.gbif.hibernate.tcn.Test.listTaxaByNameAndRank(Test.java:45)
       at org.gbif.hibernate.tcn.Test.run(Test.java:27)
       at org.gbif.hibernate.tcn.Test.main(Test.java:66)

    Name and version of the database you are using:
    MySQL 4.1

    The generated SQL (show_sql=true):

    Code:

    Hibernate: select taxa0_.record_id as record1_0_, taxa0_.name as name0_, taxa0_.name_code as name3_0_, taxa0_.taxon as taxon0_ from taxa taxa0_ where (taxa0_.name like ‘%a%’) and taxa0_.taxon=’Kingdom’
    Hibernate: select commonname0_.name_code as name3_1_, commonname0_.record_id as record1_1_, commonname0_.record_id as record1_1_0_, commonname0_.common_name as common2_1_0_, commonname0_.name_code as name3_1_0_ from common_names commonname0_ where commonname0_.name_code=?

    Debug level Hibernate log excerpt:

    Code:

    DEBUG [SessionImpl]  opened session at timestamp: 4657754688446464
    DEBUG [SessionImpl]  find: from Taxa where name like(‘%a%’) and taxon=’Kingdom’
    DEBUG [QueryParameters]  named parameters: {}
    DEBUG [QueryTranslatorImpl]  parse() — HQL: from org.gbif.hibernate.tcn.Taxa where name like(‘%a%’) and taxon=’Kingdom’
    DEBUG [AST]  — HQL AST —
    -[QUERY] ‘query’
        +-[SELECT_FROM] ‘SELECT_FROM’
        |  -[FROM] ‘from’
        |     -[RANGE] ‘RANGE’
        |        -[DOT] ‘.’
        |           +-[DOT] ‘.’
        |           |  +-[DOT] ‘.’
        |           |  |  +-[DOT] ‘.’
        |           |  |  |  +-[IDENT] ‘org’
        |           |  |  |  -[IDENT] ‘gbif’
        |           |  |  -[IDENT] ‘hibernate’
        |           |  -[IDENT] ‘tcn’
        |           -[IDENT] ‘Taxa’
        -[WHERE] ‘where’
           -[AND] ‘and’
              +-[LIKE] ‘like’
              |  +-[IDENT] ‘name’
              |  -[QUOTED_STRING] »%a%»
              -[EQ] ‘=’
                 +-[IDENT] ‘taxon’
                 -[QUOTED_STRING] »Kingdom»

    DEBUG [ErrorCounter]  throwQueryException() : no errors
    DEBUG [HqlSqlBaseWalker]  select << begin [level=1, statement=select]
    DEBUG [FromElement]  FromClause{level=1} :  org.gbif.hibernate.tcn.Taxa (no alias) -> taxa0_
    DEBUG [FromReferenceNode]  Resolved :  name -> taxa0_.name
    DEBUG [FromReferenceNode]  Resolved :  taxon -> taxa0_.taxon
    DEBUG [HqlSqlBaseWalker]  select : finishing up [level=1, statement=select]
    DEBUG [HqlSqlWalker]  processQuery() :  ( SELECT ( FromClause{level=1} taxa taxa0_ ) ( where ( and ( like taxa0_.name ‘%a%’ ) ( = taxa0_.taxon ‘Kingdom’ ) ) ) )
    DEBUG [HqlSqlWalker]  Derived SELECT clause created.
    DEBUG [JoinProcessor]  Using FROM fragment [taxa taxa0_]
    DEBUG [HqlSqlBaseWalker]  select >> end [level=1, statement=select]
    DEBUG [AST]  — SQL AST —
    -[SELECT] QueryNode: ‘SELECT’  querySpaces (taxa)
        +-[SELECT_CLAUSE] SelectClause: ‘{derived select clause}’
        |  +-[SELECT_EXPR] SelectExpressionImpl: ‘taxa0_.record_id as record1_0_’ {FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=taxa,tableAlias=taxa0_,origin=null,colums={,className=org.gbif.hibernate.tcn.Taxa}}}
        |  -[SQL_TOKEN] SqlFragment: ‘taxa0_.name as name0_, taxa0_.name_code as name3_0_, taxa0_.taxon as taxon0_’
        +-[FROM] FromClause: ‘from’ FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[], fromElementByTableAlias=[taxa0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
        |  -[FROM_FRAGMENT] FromElement: ‘taxa taxa0_’ FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=taxa,tableAlias=taxa0_,origin=null,colums={,className=org.gbif.hibernate.tcn.Taxa}}
        -[WHERE] SqlNode: ‘where’
           -[AND] SqlNode: ‘and’
              +-[LIKE] BinaryLogicOperatorNode: ‘like’
              |  +-[SQL_TOKEN] IdentNode: ‘taxa0_.name’ {originalText=name}
              |  -[QUOTED_STRING] LiteralNode: »%a%»
              -[EQ] BinaryLogicOperatorNode: ‘=’
                 +-[SQL_TOKEN] IdentNode: ‘taxa0_.taxon’ {originalText=taxon}
                 -[QUOTED_STRING] LiteralNode: »Kingdom»

    DEBUG [ErrorCounter]  throwQueryException() : no errors
    DEBUG [QueryTranslatorImpl]  HQL: from org.gbif.hibernate.tcn.Taxa where name like(‘%a%’) and taxon=’Kingdom’
    DEBUG [QueryTranslatorImpl]  SQL: select taxa0_.record_id as record1_0_, taxa0_.name as name0_, taxa0_.name_code as name3_0_, taxa0_.taxon as taxon0_ from taxa taxa0_ where (taxa0_.name like ‘%a%’) and taxa0_.taxon=’Kingdom’
    DEBUG [ErrorCounter]  throwQueryException() : no errors
    DEBUG [AbstractBatcher]  about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
    DEBUG [ConnectionManager]  opening JDBC connection
    DEBUG [DriverManagerConnectionProvider]  total checked-out connections: 0
    DEBUG [DriverManagerConnectionProvider]  using pooled JDBC connection, pool size: 0
    DEBUG [SQL]  select taxa0_.record_id as record1_0_, taxa0_.name as name0_, taxa0_.name_code as name3_0_, taxa0_.taxon as taxon0_ from taxa taxa0_ where (taxa0_.name like ‘%a%’) and taxa0_.taxon=’Kingdom’
    Hibernate: select taxa0_.record_id as record1_0_, taxa0_.name as name0_, taxa0_.name_code as name3_0_, taxa0_.taxon as taxon0_ from taxa taxa0_ where (taxa0_.name like ‘%a%’) and taxa0_.taxon=’Kingdom’
    DEBUG [AbstractBatcher]  preparing statement
    DEBUG [AbstractBatcher]  about to open ResultSet (open ResultSets: 0, globally: 0)
    DEBUG [Loader]  processing result set
    DEBUG [Loader]  result set row: 0
    DEBUG [LongType]  returning ‘1241647’ as column: record1_0_
    DEBUG [Loader]  result row: EntityKey[org.gbif.hibernate.tcn.Taxa#1241647]
    DEBUG [Loader]  Initializing object from ResultSet: [org.gbif.hibernate.tcn.Taxa#1241647]
    DEBUG [AbstractEntityPersister]  Hydrating entity: [org.gbif.hibernate.tcn.Taxa#1241647]
    DEBUG [StringType]  returning ‘Animalia’ as column: name0_
    DEBUG [StringType]  returning » as column: name3_0_
    DEBUG [StringType]  returning ‘Kingdom’ as column: taxon0_
    DEBUG [Loader]  result set row: 1
    DEBUG [LongType]  returning ‘1246353’ as column: record1_0_
    DEBUG [Loader]  result row: EntityKey[org.gbif.hibernate.tcn.Taxa#1246353]
    DEBUG [Loader]  Initializing object from ResultSet: [org.gbif.hibernate.tcn.Taxa#1246353]
    DEBUG [AbstractEntityPersister]  Hydrating entity: [org.gbif.hibernate.tcn.Taxa#1246353]
    DEBUG [StringType]  returning ‘Archaea’ as column: name0_
    DEBUG [StringType]  returning » as column: name3_0_
    DEBUG [StringType]  returning ‘Kingdom’ as column: taxon0_
    DEBUG [Loader]  result set row: 2
    DEBUG [LongType]  returning ‘1246388’ as column: record1_0_
    DEBUG [Loader]  result row: EntityKey[org.gbif.hibernate.tcn.Taxa#1246388]
    DEBUG [Loader]  Initializing object from ResultSet: [org.gbif.hibernate.tcn.Taxa#1246388]
    DEBUG [AbstractEntityPersister]  Hydrating entity: [org.gbif.hibernate.tcn.Taxa#1246388]
    DEBUG [StringType]  returning ‘Bacteria’ as column: name0_
    DEBUG [StringType]  returning » as column: name3_0_
    DEBUG [StringType]  returning ‘Kingdom’ as column: taxon0_
    DEBUG [Loader]  result set row: 3
    DEBUG [LongType]  returning ‘1246650’ as column: record1_0_
    DEBUG [Loader]  result row: EntityKey[org.gbif.hibernate.tcn.Taxa#1246650]
    DEBUG [Loader]  Initializing object from ResultSet: [org.gbif.hibernate.tcn.Taxa#1246650]
    DEBUG [AbstractEntityPersister]  Hydrating entity: [org.gbif.hibernate.tcn.Taxa#1246650]
    DEBUG [StringType]  returning ‘Chromista’ as column: name0_
    DEBUG [StringType]  returning » as column: name3_0_
    DEBUG [StringType]  returning ‘Kingdom’ as column: taxon0_
    DEBUG [Loader]  result set row: 4
    DEBUG [LongType]  returning ‘1247696’ as column: record1_0_
    DEBUG [Loader]  result row: EntityKey[org.gbif.hibernate.tcn.Taxa#1247696]
    DEBUG [Loader]  Initializing object from ResultSet: [org.gbif.hibernate.tcn.Taxa#1247696]
    DEBUG [AbstractEntityPersister]  Hydrating entity: [org.gbif.hibernate.tcn.Taxa#1247696]
    DEBUG [StringType]  returning ‘Plantae’ as column: name0_
    DEBUG [StringType]  returning » as column: name3_0_
    DEBUG [StringType]  returning ‘Kingdom’ as column: taxon0_
    DEBUG [Loader]  result set row: 5
    DEBUG [LongType]  returning ‘1248864’ as column: record1_0_
    DEBUG [Loader]  result row: EntityKey[org.gbif.hibernate.tcn.Taxa#1248864]
    DEBUG [Loader]  Initializing object from ResultSet: [org.gbif.hibernate.tcn.Taxa#1248864]
    DEBUG [AbstractEntityPersister]  Hydrating entity: [org.gbif.hibernate.tcn.Taxa#1248864]
    DEBUG [StringType]  returning ‘Protozoa’ as column: name0_
    DEBUG [StringType]  returning » as column: name3_0_
    DEBUG [StringType]  returning ‘Kingdom’ as column: taxon0_
    DEBUG [Loader]  done processing result set (6 rows)
    DEBUG [AbstractBatcher]  about to close ResultSet (open ResultSets: 1, globally: 1)
    DEBUG [AbstractBatcher]  about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
    DEBUG [AbstractBatcher]  closing statement
    DEBUG [Loader]  total objects hydrated: 6
    DEBUG [TwoPhaseLoad]  resolving associations for [org.gbif.hibernate.tcn.Taxa#1241647]
    DEBUG [CollectionLoadContext]  creating collection wrapper:[org.gbif.hibernate.tcn.Taxa.commonNames#]
    DEBUG [TwoPhaseLoad]  done materializing entity [org.gbif.hibernate.tcn.Taxa#1241647]
    DEBUG [TwoPhaseLoad]  resolving associations for [org.gbif.hibernate.tcn.Taxa#1246353]
    DEBUG [CollectionLoadContext]  creating collection wrapper:[org.gbif.hibernate.tcn.Taxa.commonNames#]
    DEBUG [TwoPhaseLoad]  done materializing entity [org.gbif.hibernate.tcn.Taxa#1246353]
    DEBUG [TwoPhaseLoad]  resolving associations for [org.gbif.hibernate.tcn.Taxa#1246388]
    DEBUG [CollectionLoadContext]  creating collection wrapper:[org.gbif.hibernate.tcn.Taxa.commonNames#]
    DEBUG [TwoPhaseLoad]  done materializing entity [org.gbif.hibernate.tcn.Taxa#1246388]
    DEBUG [TwoPhaseLoad]  resolving associations for [org.gbif.hibernate.tcn.Taxa#1246650]
    DEBUG [CollectionLoadContext]  creating collection wrapper:[org.gbif.hibernate.tcn.Taxa.commonNames#]
    DEBUG [TwoPhaseLoad]  done materializing entity [org.gbif.hibernate.tcn.Taxa#1246650]
    DEBUG [TwoPhaseLoad]  resolving associations for [org.gbif.hibernate.tcn.Taxa#1247696]
    DEBUG [CollectionLoadContext]  creating collection wrapper:[org.gbif.hibernate.tcn.Taxa.commonNames#]
    DEBUG [TwoPhaseLoad]  done materializing entity [org.gbif.hibernate.tcn.Taxa#1247696]
    DEBUG [TwoPhaseLoad]  resolving associations for [org.gbif.hibernate.tcn.Taxa#1248864]
    DEBUG [CollectionLoadContext]  creating collection wrapper:[org.gbif.hibernate.tcn.Taxa.commonNames#]
    DEBUG [TwoPhaseLoad]  done materializing entity [org.gbif.hibernate.tcn.Taxa#1248864]
    DEBUG [StatefulPersistenceContext]  initializing non-lazy collections
    DEBUG [DefaultInitializeCollectionEventListener]  initializing collection [org.gbif.hibernate.tcn.Taxa.commonNames#]
    DEBUG [DefaultInitializeCollectionEventListener]  checking second-level cache
    DEBUG [DefaultInitializeCollectionEventListener]  collection not cached
    DEBUG [Loader]  loading collection: [org.gbif.hibernate.tcn.Taxa.commonNames#]
    DEBUG [AbstractBatcher]  about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
    DEBUG [SQL]  select commonname0_.name_code as name3_1_, commonname0_.record_id as record1_1_, commonname0_.record_id as record1_1_0_, commonname0_.common_name as common2_1_0_, commonname0_.name_code as name3_1_0_ from common_names commonname0_ where commonname0_.name_code=?
    Hibernate: select commonname0_.name_code as name3_1_, commonname0_.record_id as record1_1_, commonname0_.record_id as record1_1_0_, commonname0_.common_name as common2_1_0_, commonname0_.name_code as name3_1_0_ from common_names commonname0_ where commonname0_.name_code=?
    DEBUG [AbstractBatcher]  preparing statement
    DEBUG [StringType]  binding » to parameter: 1
    DEBUG [AbstractBatcher]  about to open ResultSet (open ResultSets: 0, globally: 0)
    DEBUG [Loader]  result set contains (possibly empty) collection: [org.gbif.hibernate.tcn.Taxa.commonNames#]
    DEBUG [CollectionLoadContext]  uninitialized collection: initializing
    DEBUG [Loader]  processing result set
    DEBUG [Loader]  done processing result set (0 rows)
    DEBUG [AbstractBatcher]  about to close ResultSet (open ResultSets: 1, globally: 1)
    DEBUG [AbstractBatcher]  about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
    DEBUG [AbstractBatcher]  closing statement
    DEBUG [Loader]  total objects hydrated: 0
    DEBUG [CollectionLoadContext]  1 collections were found in result set for role: org.gbif.hibernate.tcn.Taxa.commonNames
    DEBUG [CollectionLoadContext]  collection fully initialized: [org.gbif.hibernate.tcn.Taxa.commonNames#]
    DEBUG [CollectionLoadContext]  1 collections initialized for role: org.gbif.hibernate.tcn.Taxa.commonNames
    DEBUG [Loader]  done loading collection
    DEBUG [DefaultInitializeCollectionEventListener]  collection initialized
    DEBUG [JDBCContext]  after autocommit
    DEBUG [ConnectionManager]  aggressively releasing JDBC connection
    DEBUG [ConnectionManager]  closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
    DEBUG [DriverManagerConnectionProvider]  returning connection to pool, pool size: 1
    org.hibernate.HibernateException: collection is not associated with any session
       at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:449)
       at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:791)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:228)
       at org.hibernate.loader.Loader.doList(Loader.java:2147)
       at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2026)
       at org.hibernate.loader.Loader.list(Loader.java:2021)
       at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
       at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:298)
       at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1020)
       at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
       at org.gbif.hibernate.tcn.Test.listTaxaByNameAndRank(Test.java:45)
       at org.gbif.hibernate.tcn.Test.run(Test.java:27)
       at org.gbif.hibernate.tcn.Test.main(Test.java:66)

    Thanks for looking.

    Возможно, вам также будет интересно:

  • Ошибка фронтальной камеры xiaomi redmi note 8 pro
  • Ошибка фотошоп error at loading of ippsp library
  • Ошибка фотобарабана brother hl l2300dr
  • Ошибка фрисби введенный номер не найден
  • Ошибка фотобарабана brother dcp 7057r как исправить

  • Понравилась статья? Поделить с друзьями:
    0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии