nested exception is java.lang.IllegalArgumentException: Parameter with that position [1] did not exi
2016-12-16 16:29
921 查看
java.lang.IllegalArgumentException: Parameter with that position [1] did not exist org.hibernate.jpa.spi.BaseQueryImpl.findParameterRegistration(BaseQueryImpl.java:502) org.hibernate.jpa.spi.BaseQueryImpl.setParameter(BaseQueryImpl.java:692) org.hibernate.jpa.spi.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:181) org.hibernate.jpa.spi.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:32) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:497) org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:372) com.sun.proxy.$Proxy55.setParameter(Unknown Source) com.*.report.dao.logistics.impl.LogiEvaluationDao.logisticsEvaluationDownload(LogiEvaluationDao.java:27) com.*.report.web.controller.sales.SalesReportController.logisticsEvaluationDownload(SalesReportController.java:61) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:497) org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:114) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) javax.servlet.http.HttpServlet.service(HttpServlet.java:648) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)这个是由于传入日期类型的时候加了双引号导致的。
WHERE A.DISPATCH_DATE>='?1' AND A.DISPATCH_DATE<='?2'
修改后
WHERE A.DISPATCH_DATE>=?1 AND A.DISPATCH_DATE<=?2
javax.persistence.query setparameter
Query query = getEm().createNativeQuery(sql.toString());
query.setParameter(1, CalendarUtils.getFormatDate(CalendarUtils.Y_M_D_LONG, dispatchDateStart));
相关文章推荐
- 记录 Parameter with that position [1] did not exist; nested exception is java.lang.IllegalArgumentExce
- jpa语句报 org.springframework.dao.InvalidDataAccessApiUsageException: Parameter with that position [2] did not exist; nested exception is java.lang.IllegalArgumentException: Parameter with that position
- 【异常-java- java.lang.IllegalArgumentException: Parameter with that position [1] did not exist】
- spring3.2.0与mybatis3.2.7整合出错--Failed to read candidate component class--nested exception is java.lang.IllegalArgumentException
- nested exception is java.lang.IllegalArgumentException: object is not an instance of declaring class
- Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a mana
- MyBatis与Spring MVC结合时,使用DAO注入出现:Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
- nested exception is java.lang.RuntimeException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for
- IDEA报错: Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.datasource.url' in value "${spring.datasource.url}"
- java.lang.IllegalArgumentException: host parameter is null
- Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: 'sessionFa
- nested exception is java.lang.IllegalArgumentException: Expected MultipartHttpServletRequest: is a M
- BottomSheetBehavior 之 java.lang.IllegalArgumentException: The view is not associated with BottomSheetBehavior
- nested exception is java.lang.IllegalArgumentException: 'sessionFactory' or 'hibernateTemplate'
- HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException:
- 异常:Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentExceptio
- java.lang.IllegalArgumentException: host parameter is null
- nested exception is java.lang.IllegalArgumentException
- Caused by: java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting ')' at character position 11
- java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting '(' at character position