[Hibernate-JIRA] Created: (HHH-5915) Bug with MSSQL Paging released in 3.6.1
by Noel Trout (JIRA)
Bug with MSSQL Paging released in 3.6.1
---------------------------------------
Key: HHH-5915
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5915
Project: Hibernate Core
Issue Type: Bug
Components: core, entity-manager
Affects Versions: 3.6.1
Environment: Hibernate 3.6.1, MSSSQL 2008 R2, JPA 2
Reporter: Noel Trout
This is related to all the changes in 3.6.1 for MSSQL (specifically paging).
http://opensource.atlassian.com/projects/hibernate/secure/IssueNavigator....
When using the new paging, it is no longer possible to create an entity manager criteria query (javax.persistence.criteria) that takes parameters in the ORDER BY portion of the statement at the same time as the WHERE portion has parameters. Hibernate does not throw an exception, but the parameters are bound incorrectly so that when the query is sent to MSSQL a grammar exception is thrown. This is related in some way to how the dialect is transforming the query for the MSSQL Common Table Expression (CTE).
Literal values still work in the ORDER BY portion.
To reproduce, just create query an entity, ensuring there are parameters in both the ORDER BY and WHERE portions.
Example WHERE from Our Code:
criteriaQuery.where(builder.or(
criteriaBuilder.equal(aircraftRoot.get(AircraftEntityImpl_.status), AircraftStatus.PAX_ACTIVE),
criteriaBuilder.equal(aircraftRoot.get(AircraftEntityImpl_.status), AircraftStatus.PAX_CARGO_ACTIVE)
));
Example ORDER BY from our code:
// Broken as of 3.6.1, parameter bound - enum class with EnhancedUserType
final Case<Object> wyvernCase = builder.selectCase();
wyvernCase.when(builder.isNull(wyvernStatusPath), WyvernOperatorStatus.NONE);
wyvernCase.otherwise(wyvernStatusPath);
criteriaQuery.orderBy(criteriaBuilder.desc(wyvernCase));
// Working with 3.6.1, integer literal constant
final Case<Object> wyvernCase = builder.selectCase();
wyvernCase.when(builder.isNull(wyvernStatusPath), builder.literal(WyvernOperatorStatus.NONE.getCode()));
wyvernCase.otherwise(wyvernStatusPath);
criteriaQuery.orderBy(criteriaBuilder.desc(wyvernCase));
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[Hibernate-JIRA] Created: (HHH-4559) Envers AuditMetadata Generator causes java.lang.ClassCastException: org.hibernate.mapping.Formula cannot be cast to org.hibernate.mapping.Column
by Kevin Schmidt (JIRA)
Envers AuditMetadata Generator causes java.lang.ClassCastException: org.hibernate.mapping.Formula cannot be cast to org.hibernate.mapping.Column
------------------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-4559
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4559
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.5.0-Beta-2
Environment: Hibernate 3.5.0-Beta-2
RDBMS: Microsoft SQL Server, version: 09.00.4230
JDBC driver: jTDS Type 4 JDBC Driver for MS SQL Server and Sybase, version: 1.2.4
Reporter: Kevin Schmidt
Priority: Blocker
Dear Hibernate Team,
I attempted to enable Envers for a Legacy Hibernate Application which uses hbm.xml based mapping files. The building of the SessionFactory fails due to a class cast exception in the Envers code base. It appears that while generating mapping data in the AuditMetadataGenerator it is assumed that a discriminator is a Column, but it can also be a Formula. This causes a class cast exception to be thrown as is shown below (see the last cause in the exception stack trace). I know the response is going to be attach a test case, but I am not even sure how to create a good test case. Are there instructions on the wiki some where? Some starting project I could use to create the test case? In order to reproduce this issue I think it is as simple as enabling auditing for an entity which has a discriminator based on a formula instead of a column.
[2009.11.10 09:33:32.302 XYZ] Failed to initialize due to exception.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.sessionFactory' defined in class path resource [com/xyz/data/spring-config-data.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: could not init listeners
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:302)
at com.XYZ.services.springscope.AbstractXYZSpringScopeStrategy.get(AbstractXYZSpringScopeStrategy.java:87)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:33)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:184)
at $Proxy6.openSession(Unknown Source)
at com.XYZ.data.hibernate.conversation.Conversation.<init>(Conversation.java:59)
at com.XYZ.data.hibernate.conversation.ConversationManagerImpl.startConversation(ConversationManagerImpl.java:128)
at com.XYZ.data.hibernate.conversation.ConversationManagerImpl.beginConversation(ConversationManagerImpl.java:110)
at com.XYZ.core.initialization.AbstractInitializationThread.run(AbstractInitializationThread.java:145)
at com.XYZ.services.thread.ThreadsManager$ThreadWrapper.run(ThreadsManager.java:147)
at java.lang.Thread.run(Unknown Source)
Caused by: org.hibernate.HibernateException: could not init listeners
at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:205)
at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1378)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1367)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:858)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 18 more
Caused by: java.lang.ClassCastException: org.hibernate.mapping.Formula cannot be cast to org.hibernate.mapping.Column
at org.hibernate.envers.configuration.metadata.MetadataTools.addColumns(MetadataTools.java:154)
at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateMappingData(AuditMetadataGenerator.java:252)
at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateFirstPass(AuditMetadataGenerator.java:327)
at org.hibernate.envers.configuration.EntitiesConfigurator.configure(EntitiesConfigurator.java:87)
at org.hibernate.envers.configuration.AuditConfiguration.<init>(AuditConfiguration.java:86)
at org.hibernate.envers.configuration.AuditConfiguration.getFor(AuditConfiguration.java:99)
at org.hibernate.envers.event.AuditEventListener.initialize(AuditEventListener.java:259)
at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198)
at org.hibernate.event.EventListeners.processListeners(EventListeners.java:181)
at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:194)
... 26 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[Hibernate-JIRA] Created: (HHH-5846) the setFirstResult and setMaxResults methods of criteria don't work properly
by Ryan Zhang (JIRA)
the setFirstResult and setMaxResults methods of criteria don't work properly
----------------------------------------------------------------------------
Key: HHH-5846
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5846
Project: Hibernate Core
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.6.1
Environment: hibernate3.6.0-Final
PostgreSQL 8.4.6 on x86_64-pc-linux-gnu
Reporter: Ryan Zhang
Priority: Critical
when I use setFirstResult and setMaxResults methods in my DAO, I always get the following exception:
<code>
WARN : org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 42601
ERROR: org.hibernate.util.JDBCExceptionReporter - ERROR: syntax error at or near "$1"
Position: 12
org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; SQL [select this_.id as id9_3_, this_.createdby_id as createdby13_9_3_, this_.creation_date as creation2_9_3_, this_.description as descript3_9_3_, this_.modification_date as modifica4_9_3_, this_.modifiedby_id as modifiedby14_9_3_, this_.version as version9_3_, this_.corporation_id as corpora15_9_3_, this_.e_mail as e6_9_3_, this_.enabled as enabled9_3_, this_.first_name as first8_9_3_, this_.language as language9_3_, this_.last_name as last10_9_3_, this_.name as name9_3_, this_.password as password9_3_, this_.primary_warehouse_id as primary16_9_3_, this_.secondary_warehouse_id as secondary17_9_3_, corporatio2_.id as id7_0_, corporatio2_.createdby_id as createdby8_7_0_, corporatio2_.creation_date as creation2_7_0_, corporatio2_.description as descript3_7_0_, corporatio2_.modification_date as modifica4_7_0_, corporatio2_.modifiedby_id as modifiedby9_7_0_, corporatio2_.version as version7_0_, corporatio2_.code as code7_0_, corporatio2_.name as name7_0_, abswarehou3_.id as id12_1_, abswarehou3_.createdby_id as createdby23_12_1_, abswarehou3_.creation_date as creation3_12_1_, abswarehou3_.description as descript4_12_1_, abswarehou3_.modification_date as modifica5_12_1_, abswarehou3_.modifiedby_id as modifiedby24_12_1_, abswarehou3_.version as version12_1_, abswarehou3_.code as code12_1_, abswarehou3_.name as name12_1_, abswarehou3_.address1 as address9_12_1_, abswarehou3_.address2 as address10_12_1_, abswarehou3_.city as city12_1_, abswarehou3_.country as country12_1_, abswarehou3_.postal_code as postal13_12_1_, abswarehou3_.province as province12_1_, abswarehou3_.color as color12_1_, abswarehou3_.corporation_id as corpora25_12_1_, abswarehou3_.default_production_consumption_loc_id as default26_12_1_, abswarehou3_.default_production_output_loc_id as default27_12_1_, abswarehou3_.default_receipt_loc_id as default28_12_1_, abswarehou3_.default_shipment_loc_id as default29_12_1_, abswarehou3_.input_blocked as input16_12_1_, abswarehou3_.local_freight_zone_id as local30_12_1_, abswarehou3_.output_blocked as output17_12_1_, abswarehou3_.shipping_lead_time as shipping18_12_1_, abswarehou3_.zone_to_id as zone31_12_1_, abswarehou3_.contact as contact12_1_, abswarehou3_.first_phone_number as first20_12_1_, abswarehou3_.in_transit_warehouse_id as in32_12_1_, abswarehou3_.is_job_lot as is21_12_1_, abswarehou3_.job_lot_warehouse_id as job33_12_1_, abswarehou3_.on_water_warehouse_id as on34_12_1_, abswarehou3_.quarantine_warehouse_id as quarantine35_12_1_, abswarehou3_.second_phone_number as second22_12_1_, abswarehou3_.discriminator as discrimi1_12_1_, abswarehou4_.id as id12_2_, abswarehou4_.createdby_id as createdby23_12_2_, abswarehou4_.creation_date as creation3_12_2_, abswarehou4_.description as descript4_12_2_, abswarehou4_.modification_date as modifica5_12_2_, abswarehou4_.modifiedby_id as modifiedby24_12_2_, abswarehou4_.version as version12_2_, abswarehou4_.code as code12_2_, abswarehou4_.name as name12_2_, abswarehou4_.address1 as address9_12_2_, abswarehou4_.address2 as address10_12_2_, abswarehou4_.city as city12_2_, abswarehou4_.country as country12_2_, abswarehou4_.postal_code as postal13_12_2_, abswarehou4_.province as province12_2_, abswarehou4_.color as color12_2_, abswarehou4_.corporation_id as corpora25_12_2_, abswarehou4_.default_production_consumption_loc_id as default26_12_2_, abswarehou4_.default_production_output_loc_id as default27_12_2_, abswarehou4_.default_receipt_loc_id as default28_12_2_, abswarehou4_.default_shipment_loc_id as default29_12_2_, abswarehou4_.input_blocked as input16_12_2_, abswarehou4_.local_freight_zone_id as local30_12_2_, abswarehou4_.output_blocked as output17_12_2_, abswarehou4_.shipping_lead_time as shipping18_12_2_, abswarehou4_.zone_to_id as zone31_12_2_, abswarehou4_.contact as contact12_2_, abswarehou4_.first_phone_number as first20_12_2_, abswarehou4_.in_transit_warehouse_id as in32_12_2_, abswarehou4_.is_job_lot as is21_12_2_, abswarehou4_.job_lot_warehouse_id as job33_12_2_, abswarehou4_.on_water_warehouse_id as on34_12_2_, abswarehou4_.quarantine_warehouse_id as quarantine35_12_2_, abswarehou4_.second_phone_number as second22_12_2_, abswarehou4_.discriminator as discrimi1_12_2_ from users this_ left outer join corporation corporatio2_ on this_.corporation_id=corporatio2_.id left outer join warehouse abswarehou3_ on this_.primary_warehouse_id=abswarehou3_.id left outer join warehouse abswarehou4_ on this_.secondary_warehouse_id=abswarehou4_.id order by this_.name asc]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:629)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.convertHibernateAccessException(AbstractSessionFactoryBean.java:303)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.translateExceptionIfPossible(AbstractSessionFactoryBean.java:282)
at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:58)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:163)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at com.abc.core.security.dao.UserDAO$$EnhancerByCGLIB$$8ac39f0.findByFilters(<generated>)
at com.abc.core.security.service.UserManagerImpl.findUsers(UserManagerImpl.java:43)
at com.abc.core.security.service.UserManagerImpl$$FastClassByCGLIB$$c604a90e.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at com.abc.core.security.service.UserManagerImpl$$EnhancerByCGLIB$$55fa90fa.findUsers(<generated>)
at com.abc.web.security.controller.UserPagedListController.json(UserPagedListController.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.abc.web.filter.ThreadLocalInitFilter.doFilterInternal(ThreadLocalInitFilter.java:152)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:99)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:119)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
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:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2536)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
at org.hibernate.loader.Loader.list(Loader.java:2271)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:119)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
at com.abc.core.entity.dao.DefaultEntityDAO.findByCriteria(DefaultEntityDAO.java:206)
at com.abc.core.entity.dao.DefaultEntityDAO.findByCriterions(DefaultEntityDAO.java:222)
at com.abc.core.entity.dao.DefaultEntityDAO.findByFilters(DefaultEntityDAO.java:231)
at com.abc.core.entity.dao.DefaultEntityDAO$$FastClassByCGLIB$$d0fddf42.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
... 84 more
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "$1"
Position: 12
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:273)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
at org.hibernate.loader.Loader.doQuery(Loader.java:802)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
at org.hibernate.loader.Loader.doList(Loader.java:2533)
... 97 more
</code>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[Hibernate-JIRA] Created: (HV-469) ClassCast exception when creating Combined constraint
by David J. M. Karlsen (JIRA)
ClassCast exception when creating Combined constraint
-----------------------------------------------------
Key: HV-469
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-469
Project: Hibernate Validator
Issue Type: Bug
Components: validators
Affects Versions: 4.2.0.Beta2
Reporter: David J. M. Karlsen
See https://github.com/davidkarlsen/hibernate-validator/tree/HV-448 (never mind the naming of the branch - it was an old one - but changed to fit this issue).
I get
{noformat}
javax.validation.ValidationException: Unable to initialize org.hibernate.validator.constraints.impl.SizeValidatorForString
at org.hibernate.validator.engine.ConstraintTree.initializeConstraint(ConstraintTree.java:444)
at org.hibernate.validator.engine.ConstraintTree.createAndInitializeValidator(ConstraintTree.java:346)
at org.hibernate.validator.engine.ConstraintTree.getInitializedValidator(ConstraintTree.java:317)
at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:144)
at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:117)
at org.hibernate.validator.metadata.MetaConstraint.validateConstraint(MetaConstraint.java:84)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:473)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:395)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:376)
at org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:315)
at org.hibernate.validator.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:634)
at org.hibernate.validator.engine.ValidatorImpl.validateCascadedMethodConstraints(ValidatorImpl.java:532)
at org.hibernate.validator.engine.ValidatorImpl.validateReturnValueForGroup(ValidatorImpl.java:1156)
at org.hibernate.validator.engine.ValidatorImpl.validateReturnValueInContext(ValidatorImpl.java:1074)
at org.hibernate.validator.engine.ValidatorImpl.validateReturnValue(ValidatorImpl.java:247)
at org.hibernate.hv448.ValidationAspect.validateReturnedValue(ValidationAspect.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:603)
at org.springframework.aop.aspectj.AspectJAfterReturningAdvice.afterReturning(AspectJAfterReturningAdvice.java:58)
at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:51)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy16.proceedOkWithDefinedArg(Unknown Source)
at org.hibernate.hv448.ValidationAspectTest.proceedOkWithDefinedArg(ValidationAspectTest.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassCastException: $Proxy22 cannot be cast to javax.validation.constraints.Size
at org.hibernate.validator.constraints.impl.SizeValidatorForString.initialize(SizeValidatorForString.java:30)
at org.hibernate.validator.engine.ConstraintTree.initializeConstraint(ConstraintTree.java:441)
... 59 more
{noformat}
when validating with a composed constraint.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months