I'm using Spring 3.2.0 with the same version of Spring security and Oracle 10g. Recently, I have upgraded Hibernate from 3.2.5 to 4.2.0.CR1. With this update, the following warnings appear on the Tomcat console.
Quote:
WARN [http-apr-8080-exec-11] (JdbcServicesImpl.java:169) - HHH000342: Could not obtain connection to query metadata : invalid arguments in call
WARN [http-apr-8080-exec-23] (SqlExceptionHelper.java:143) - SQL Error: 17433, SQLState: null
ERROR [http-apr-8080-exec-23] (SqlExceptionHelper.java:144) - invalid arguments in call
When an attempt is made to run the application, it causes the following exception to be thrown (the full exception stack trace).
Code:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Could not open connection
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:927)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:811)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:796)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:152)
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.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
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.web.multipart.support.MultipartFilter.doFilterInternal(MultipartFilter.java:119)
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 filter.NoCacheFilter.doFilter(NoCacheFilter.java:102)
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: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:150)
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.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
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.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
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.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:144)
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:472)
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:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1822)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Could not open connection
at org.springframework.orm.hibernate4.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:428)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:371)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:334)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:105)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy373.getUserName(Unknown Source)
at controller.HomeController.showForm(HomeController.java:31)
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:601)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:746)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:687)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:915)
... 70 more
Caused by: org.hibernate.exception.GenericJDBCException: Could not open connection
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:221)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:157)
at org.hibernate.internal.SessionImpl.connection(SessionImpl.java:546)
at org.springframework.orm.hibernate4.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:342)
... 90 more
Caused by: java.sql.SQLException: invalid arguments in call
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:113)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:147)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:209)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:236)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:454)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:802)
at java.sql.DriverManager.getConnection(DriverManager.java:579)
at java.sql.DriverManager.getConnection(DriverManager.java:190)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:173)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:164)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:149)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:128)
at org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:141)
WARN [http-apr-8080-exec-37] (SqlExceptionHelper.java:143) - SQL Error: 17433, SQLState: null
ERROR [http-apr-8080-exec-37] (SqlExceptionHelper.java:144) - invalid arguments in call
at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:292)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:214)
... 93 more
My entire application-context.xml file is as follows.
Code:
<?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:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd">
<context:annotation-config/>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="oracle.jdbc.OracleDriver"
p:url="jdbc:oracle:thin:@localhost:1521:xe"
p:username="wagafashiondb"
p:password="root" />
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="annotatedClasses">
<list>
<value>model.Admin</value>
<value>model.BannerImages</value>
<value>model.Brand</value>
<value>model.BulkInquiry</value>
<value>model.Cart</value>
<value>model.Category</value>
<value>model.Cheque</value>
<value>model.City</value>
<value>model.Cms</value>
<value>model.Colour</value>
<value>model.Country</value>
<value>model.Discount</value>
<value>model.Fabric</value>
<value>model.Feedback</value>
<value>model.Inquiry</value>
<value>model.Measurement</value>
<value>model.News</value>
<value>model.OrderItem</value>
<value>model.OrderItemPK</value>
<value>model.OrderStatus</value>
<value>model.OrderTable</value>
<value>model.Product</value>
<value>model.ProductImage</value>
<value>model.Rating</value>
<value>model.SizeTable</value>
<value>model.StateTable</value>
<value>model.StitchingCharges</value>
<value>model.Subcategory</value>
<value>model.Transporter</value>
<value>model.UserRoles</value>
<value>model.UserTable</value>
<value>model.Weight</value>
<value>model.Wish</value>
<value>model.Zone</value>
<value>model.ZoneCharge</value>
<value>model.ZoneChargePK</value>
<value>model.TempTable</value>
</list>
</property>
<property name="hibernateProperties">
<value>
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
</value>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager"
p:sessionFactory-ref="sessionFactory" />
<tx:annotation-driven transaction-manager="transactionManager"/>
<bean id="countryService" class="dao.CountryDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="stateService" class="dao.StateDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="cityService" class="dao.CityDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="cmsIdService" class="dao.CmsIdDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="aboutProductsService" class="dao.AboutProductsDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="aboutUsService" class="dao.AboutUsDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="contactUsService" class="dao.ContactUsDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="disclaimerService" class="dao.DisclaimerDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="exchangeLinksService" class="dao.ExchangeLinksDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="privacyPolicyService" class="dao.PrivacyPolicyDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="purchasingTermService" class="dao.PurchasingTermsDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="returnPolicyService" class="dao.ReturnPolicyDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="shippingPolicyService" class="dao.ShippingPolicyDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="termsOfUseService" class="dao.TermsOfUseDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="transporterService" class="dao.TransporterDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="zoneService" class="dao.ZoneDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="zoneChargeService" class="dao.ZoneChargeDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="fabricService" class="dao.FabricDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="weightService" class="dao.WeightDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="discountService" class="dao.DiscountDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="colourService" class="dao.ColourDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="sizeService" class="dao.SizeDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="feedbackService" class="dao.FeedbackDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="faqService" class="dao.FaqDAQ" p:sessionFactory-ref="sessionFactory" />
<bean id="categoryService" class="dao.CategoryDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="productService" class="dao.ProductDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="productCommonService" class="dao.ProductCommonDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="productDescriptionService" class="dao.ProductDescriptionDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="productPriceService" class="dao.ProductPriceDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="productColourService" class="dao.ProductColourDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="productSizeService" class="dao.ProductSizeDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="subCategoryService" class="dao.SubCategoryDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="brandService" class="dao.BrandDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="productImageService" class="dao.ProductImageDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="homeService" class="dao.HomeDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="changePasswordService" class="dao.ChangePasswordDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="userService" class="dao.UserDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="bulkInquiryService" class="dao.BulkInquiryDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="stitchingService" class="dao.StitchingDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="inquiryService" class="dao.InquiryDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="bannerService" class="dao.BannerDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="userAuthorityService" class="dao.UserAuthorityDAO" p:sessionFactory-ref="sessionFactory" />
<bean id="filterMultipartResolver"
p:resolveLazily="true"
p:maxUploadSize="10000000000"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>
</beans>
Since I'm yet not using the EntityManager, I have listed all the entity classes currently in use in this file.
I have the Oracle thin-10.2.0.5.0 driver on the class-path.
Searching on Google, I have made the necessary changes to this file like,
Code:
org.springframework.orm.hibernate3.HibernateTransactionManager
has been replaced by
Code:
org.springframework.orm.hibernate4.HibernateTransactionManager
and
Code:
org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
has been replaced by
Code:
org.springframework.orm.hibernate4.LocalSessionFactoryBean
In my web.xml file,
Code:
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
has been replaced by
Code:
org.springframework.orm.hibernate4.support.OpenSessionInViewFilter
What I'm missing? What is the cause of this exception?