Announcement Announcement Module
Collapse
No announcement yet.
java.lang.IllegalStateException: No value for key [] Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • java.lang.IllegalStateException: No value for key []

    Hi,
    I've seen some threads here about this problem but I would like to rise the topic again since we have it unresolved for now.

    This problem occurs time-to-time on our production server while it's concurrently loaded for a long period of time (not so heavy loaded though). It usually happens once in a day or two.

    Unfortunately we cannot reproduce it for debugging or to understand the roots of a problem.
    As you can see we use OpenSessionInViewFilter in the filter chain. DAOs support, no annotations. Only one DataSource and single transaction manager. The Spring version is 3.1.2.RELEASE.

    I'll appreciate any ideas what could be the reason of this and how to fix this case.

    The web.xml filter chain definition:
    Code:
    	<filter>
    		<filter-name>hibernateFilter</filter-name>
    		<filter-class>com.havilog.baltic.cheetah.rf.core.CheetahOpenSessionViewFilter</filter-class>
    		<init-param>
    			<param-name>singleSession</param-name>
    			<param-value>true</param-value>
    		</init-param>		
    		<init-param>
    			<param-name>sessionFactoryBeanName</param-name>
    			<param-value>sessionFactory</param-value>
    		</init-param>
      		<init-param>
            	<param-name>flushMode</param-name>
            	<param-value>AUTO</param-value>
        	</init-param>
    	</filter>
    
    	<filter>
    		<filter-name>CheetahRF</filter-name>
    		<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
    		<init-param>
    			<param-name>applicationClassName</param-name>
    			<param-value>com.havilog.baltic.cheetah.rf.visual.WicketApplication</param-value>
    		</init-param>
    		<init-param>
    			<param-name>configuration</param-name>
    			<param-value>deployment</param-value>
    		</init-param>
    	</filter>
    	
    	<filter-mapping>
    		<filter-name>hibernateFilter</filter-name>
    		<url-pattern>/*</url-pattern>
    	</filter-mapping>
    
    	<filter-mapping>
    		<filter-name>CheetahRF</filter-name>
    		<url-pattern>/*</url-pattern>
    	</filter-mapping>
    Hibernate properties and the Transaction Manager:
    Code:
    		<property name="hibernateProperties">
    			<props>			
    				<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
    				<prop key="hibernate.jdbc.use_streams_for_binary">true</prop>
    				<prop key="hibernate.generate_statistics">true</prop>
    				<prop key="hibernate.order_updates">true</prop>
    				<prop key="hibernate.current_session_context_class">thread</prop>
    				<prop key="hibernate.connection.release_mode">auto</prop>
    				<prop key="hibernate.connection.autocommit">true</prop>
    				<prop key="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</prop>
    				
    				<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
    				<prop key="hibernate.cache.use_second_level_cache">true</prop> 
    				<prop key="hibernate.cache.use_query_cache">true</prop> 
    				<prop key="hibernate.cache.provider_configuration_file_resource_path">/ehcache.xml</prop> 
    			</props>
    		</property>
    	</bean>
    
        <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
            <property name="sessionFactory" ref="sessionFactory"/>
        </bean>
    Transaction definition in the Service methods are nothing special*:
    Code:
    DefaultTransactionDefinition td = new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_REQUIRED);
        td.setIsolationLevel(TransactionDefinition.ISOLATION_DEFAULT);
        TransactionStatus status = transactionManager.getTransaction(td);
    *But have to note that we have several transactions outside the Service methods inside DAOs. Also have to note that we have auto_commit set to true and I know this generally is bad and should be avoided.

    The stack is:
    Code:
    java.lang.IllegalStateException: No value for key [org.hibernate.impl.SessionFactoryImpl@1ff8c2a] bound to thread ["http-apr-83"-exec-3]
        at org.springframework.transaction.support.TransactionSynchronizationManager.unbindResource(TransactionSynchronizationManager.java:209)
        at org.springframework.orm.hibernate3.SpringSessionSynchronization.suspend(SpringSessionSynchronization.java:115)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.doSuspendSynchronization(AbstractPlatformTransactionManager.java:666)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.suspend(AbstractPlatformTransactionManager.java:569)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:363)
        at com.havilog.baltic.cheetah.services.RtMovementsServiceImpl.moveDone(RtMovementsServiceImpl.java:867)
        at sun.reflect.GeneratedMethodAccessor798.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:416)
        at org.apache.wicket.proxy.$Proxy8.moveDone(Unknown Source)
        at com.havilog.baltic.cheetah.rf.visual.pages.movements.refill.EnterQuantity.setLocationQty(EnterQuantity.java:378)
        at sun.reflect.GeneratedMethodAccessor820.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:1185)
        at org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:641)
        at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:143)
        at org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:186)
        at org.apache.wicket.Component.setDefaultModelObject(Component.java:3068)
        at org.apache.wicket.markup.html.form.FormComponent.setModelObject(FormComponent.java:1498)
        at org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1059)
        at org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:221)
        at org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:192)
        at org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:273)
        at org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:261)
        at org.apache.wicket.util.visit.Visits.visitPostOrder(Visits.java:244)
        at org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrder(FormComponent.java:388)
        at org.apache.wicket.markup.html.form.Form.internalUpdateFormComponentModels(Form.java:1763)
        at org.apache.wicket.markup.html.form.Form.updateFormComponentModels(Form.java:1728)
        at org.apache.wicket.markup.html.form.Form.process(Form.java:900)
        at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:757)
        at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:692)
        at sun.reflect.GeneratedMethodAccessor374.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:260)
        at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:216)
        at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:248)
        at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
        at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
        at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
        at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
        at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
        at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
        at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
        at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        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:240)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
    ......
        at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:322)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1714)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
    Last edited by jurma; Sep 14th, 2012, 05:13 AM.
Working...
X