Issue 1:
Michael Pilone opened SPR-8013 and commented

I've been debugging an issue while using the Jetty ProxyServlet to proxy all requests to a backend server which uses the mvc:resources namespace element. I finally tracked the issue down to Jetty's ProxyServlet hanging while waiting for content from the backend server. Originally I thought this was a Jetty issue, but as I look at the HTTP headers, I think it is an issue with ResourceHttpRequestHandler.

ResourceHttpRequestHandler, at line 124 always sets the HTTP headers of Content-Length and Content-Type. Immediately after this call, at line 125, the response is returned if it is found that the resource hasn't changed and a 304 can be returned. What this means is that a "304 Not Modified" status is returned but the Content-Length header is also set.

I've found conflicting reports as to who is in the wrong here, but RFC 2616 section 10.3.5 says,

"If the conditional GET used a strong cache validator (see section 13.3.3), the response SHOULD NOT include other entity-headers. Otherwise (i.e., the conditional GET used a weak validator), the response MUST NOT include other entity-headers; this prevents inconsistencies between cached entity-bodies and updated headers."

of course, RFC 2616 section 4.4 says,

"Any response message which "MUST NOT" include a message-body (such as the 1xx, 204, and 304 responses and any response to a HEAD request) is always terminated by the first empty line after the header fields, regardless of the entity-header fields present in the message."

So, in either case (strong or weak validators), it seems like the ResourceHttpRequestHandler should not be setting a Content-Length header because clients could hang waiting for the content. However, clients should be smart enough to ignore content-length header on a 304. This is probably something that should be fixed on both sides!

The forum thread contains a simple workaround where the content length is reset to 0 if a 304 status is set.

Affects: 3.0.5

Reference URL: http://forum.springsource.org/showthread.php?t=104505

Issue Links:

#12362 304 responses should not have non-0 Content-Length ("duplicates")

Issue 2:
Jansie Merlin opened SPR-4118 and commented

My Issue is same as the one explained in the below link.

http://opensource.atlassian.com/projects/spring/browse/SPR-4077

But my use gets resolved after adding the below param to the Spring Config file

<property name="useTransactionAwareDataSource" value="true"/>

<prop key="hibernate.connection.release_mode">after_statement</prop>

and

<property name="transactionSynchronization">

<bean id="org.springframework.transaction.jta.JtaTransactionManager.SYNCHRONIZATION_NEVER"

class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean"/>

</property>

to transactionManager bean.

If SYNCHRONIZATION_NEVER is used the below exception is thrown which getCurrentSession is invoked.

INFO [HibernateUtil] getCurrentSession in data DS..

2007-11-17 03:05:08,231 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Returning cached instance of singleton bean 'LoadDataSessionFactory'

2007-11-17 03:05:08,231 DEBUG [org.springframework.orm.hibernate3.SessionFactoryUtils] Opening Hibernate Session

2007-11-17 03:05:08,231 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 11952867082

2007-11-17 03:05:08,231 DEBUG [org.springframework.orm.hibernate3.SessionFactoryUtils] Closing Hibernate Session

2007-11-17 03:05:08,231 ERROR [HibernateUtil] Error in getCurrentSession:

org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here

at org.springframework.orm.hibernate3.AbstractSessionFactoryBean$TransactionAwareInvocationHandler.invoke(AbstractSessionFactoryBean.java:296)

at $Proxy61.getCurrentSession(Unknown Source)

at HibernateUtil.getCurrentSession(LoadDataHibernateUtil.java:74)

.................

Please Helpout......

Thanks in Advance for Springs Support

Is this the only solution for this issue? Or do we have any fix versions that spring is going to release?.

We are using Spring.jar 2.0.2

Issue Links:

#8755 PROPAGATION_REQUIRES_NEW fails on JBoss 4.2.1 when using Hibernate connection release mode "on_close" ("duplicates")

#8801 Propagation REQUIRES_NEW fails on JBoss Application Server 4.2.1 when keeping a JDBC Connection handle