GAE中使用JPA进行条件查询时,估计有bug
select o from User o where name=?
然后
query.setParameter(1, "xx");
报错信息如下
HTTP ERROR 500
Problem accessing /admin/install.action. Reason:
Numbered parameter syntax starting ? but isnt followed by numeric!
Caused by:
Numbered parameter syntax starting ? but isnt followed by numeric!
org.datanucleus.exceptions.NucleusUserException: Numbered parameter syntax starting ? but isnt followed by numeric!
at org.datanucleus.query.compiler.JPQLParser.processIdentifier(JPQLParser.java:1552)
at org.datanucleus.query.compiler.JPQLParser.processPrimary(JPQLParser.java:967)
at org.datanucleus.query.compiler.JPQLParser.processUnaryExpression(JPQLParser.java:908)
at org.datanucleus.query.compiler.JPQLParser.processMultiplicativeExpression(JPQLParser.java:841)
at org.datanucleus.query.compiler.JPQLParser.processAdditiveExpression(JPQLParser.java:812)
at org.datanucleus.query.compiler.JPQLParser.processRelationalExpression(JPQLParser.java:488)
at org.datanucleus.query.compiler.JPQLParser.processAndExpression(JPQLParser.java:465)
at org.datanucleus.query.compiler.JPQLParser.processOrExpression(JPQLParser.java:446)
at org.datanucleus.query.compiler.JPQLParser.processExpression(JPQLParser.java:435)
at org.datanucleus.query.compiler.JPQLParser.parse(JPQLParser.java:66)
at org.datanucleus.query.compiler.JavaQueryCompiler.compileFilter(JavaQueryCompiler.java:294)
at org.datanucleus.query.compiler.JPQLCompiler.compile(JPQLCompiler.java:75)
at org.datanucleus.store.query.AbstractJPQLQuery.compileInternal(AbstractJPQLQuery.java:246)
at org.datanucleus.store.query.Query.setImplicitParameter(Query.java:714)
at org.datanucleus.jpa.JPAQuery.setParameter(JPAQuery.java:449)
at cn.neilone.appspot.dao.impl.DaoSupport.setQueryParams(DaoSupport.java:100)
at cn.neilone.appspot.dao.impl.DaoSupport.getScrollData(DaoSupport.java:87)
at cn.neilone.appspot.dao.impl.DaoSupport.getScrollData(DaoSupport.java:66)
at cn.neilone.appspot.service.AdminService.addUser(AdminService.java:99)
at cn.neilone.appspot.service.AdminService$$FastClassByCGLIB$$38d0a0cf.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
at cn.neilone.appspot.service.AdminService$$EnhancerByCGLIB$$d4a1f6f5.addUser(<generated>)
at cn.neilone.appspot.struts2.TInstallAction.install(TInstallAction.java:42)
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 com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:100)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:349)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Powered by Jetty://
貌似是不能根据索引传入参数,我试了一下以下方法,可以解决此问题
name=?0 and pwd=?1
分享到:
相关推荐
GAE使用规则GAE使用规则GAE使用规则GAE使用规则GAE使用规则GAE使用规则GAE使用规则GAE使用规则GAE使用规则
标题 "spring3+springmvc+jpa2+gae" 指的是一个集成开发环境,它结合了Spring框架的三个核心组件以及Google App Engine (GAE)。这个项目旨在展示如何在GAE上运行一个基于Spring 3、Spring MVC和JPA 2.0的应用程序。...
总结起来,使用Django框架在GAE上构建Web应用需要对两者的特性有深入理解,包括Django的MVT架构、GAE的数据存储机制、以及如何在GAE的环境中配置和部署Django应用。通过阅读指定的博客文章和分析提供的源代码,你...
【基于GAE的Demo】是一个使用Eclipse集成开发环境构建的项目,主要展示了如何在Google App Engine(GAE)平台上整合Struts2、Spring和Tiles框架。GAE是Google提供的一个云计算平台,允许开发者在Google的基础设施上...
在Google App Engine (GAE) 平台上,开发人员经常需要执行一些定时任务,例如定期备份数据、发送通知或执行数据分析。在这个场景下,GAE提供了Timer模块来帮助实现这样的功能。本文将深入探讨如何在GAE框架下使用...
2. **数据存储**:Spring与GAE的数据存储API(如JDO或JPA)结合,可以提供一个统一的数据访问层,简化对Google Datastore的操作。 3. **调度任务**:Spring的TaskExecution和TaskScheduler模块可以与GAE的后台任务...
【标题】"gae-pytorch-master_pytorch_pytorchgae_GAE_自编码器_gaepytorchmaster_" 提供的信息表明,这是一个使用PyTorch实现的图自编码器(Graph Autoencoder, GAE)项目,其核心是将自编码器的概念应用于图数据。...
在PyTorch框架下实现GAE,首先需要理解PyTorch的基本操作,如张量运算、自动梯度计算以及优化器的使用。GAE的核心是构建图卷积网络(Graph Convolutional Network, GCN)作为编码器,将图的节点特征转换为低维向量,...
标题 "在GAE中使用django模板" 涉及到的知识点主要是在Google App Engine (GAE)上部署和使用Django模板系统。GAE是一个由Google提供的平台,允许开发者构建和运行web应用,而Django则是一个流行的Python web框架,它...
### GAE(Google App Engine)空间申请使用教程及 GAE域名捆绑方法 #### GAE简介与功能概述 GAE(Google App Engine)是由谷歌提供的一个强大的云服务平台,它允许开发者构建并托管各种类型的应用程序。从实用性...
pass之GAE入门教程, 学习GAE
标题“GAE blog安装”指的是在Google App Engine (GAE)上部署一个博客应用的过程。GAE是一个由Google提供的平台即服务(PaaS)云环境,允许开发者构建、运行和维护Web应用程序,无需管理和维护底层基础设施。在这个...
标题 "GAE包(以配置好,解压可用)" 提供的信息表明,这是一个已经预配置好的Google App Engine (GAE)开发环境的压缩包。GAE是Google提供的一项平台即服务(PaaS),允许开发者在Google的基础设施上运行自己的Web...
因此,我们需要确保选用的Struts2、JPA和Spring版本与GAE兼容。通常,GAE支持的Java版本会限制到Java 8,所以选择的框架版本也需要与之匹配。 1. **整合Struts2**:首先,我们需要在项目中引入Struts2的依赖库。在`...
- **集成性**:与GAE环境高度集成,易于使用GAE提供的各种服务。 - **灵活性**:支持多种Web开发模式,如MVC等。 #### 三、`webapp`框架核心组件 **1. RequestHandler 类** `RequestHandler` 是`webapp`框架中最...
**Google App Engine (GAE) 是一个云服务平台,允许开发者使用Java或Python语言构建和运行应用程序。本教程主要关注Java的使用。** 首先,创建一个App Engine应用程序非常快速且免费,您可以在几分钟内将应用上传并...