在GAE上用spring管理JPA之后,出现了一个莫名的错误
org.datanucleus.exceptions.NucleusUserException: Object Manager has been closed
也就是说这个东西自动关闭了,可是我已经使用Annotation声明过了呀
@Transactional
Problem accessing /admin/categories!find. Reason:
org.datanucleus.exceptions.NucleusUserException: Object Manager has been closed
Caused by:
org.apache.jasper.JasperException: org.datanucleus.exceptions.NucleusUserException: Object Manager has been closed
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at com.google.appengine.tools.development.PrivilegedJspServlet.access$101(PrivilegedJspServlet.java:23)
at com.google.appengine.tools.development.PrivilegedJspServlet$2.run(PrivilegedJspServlet.java:59)
at java.security.AccessController.doPrivileged(Native Method)
at com.google.appengine.tools.development.PrivilegedJspServlet.service(PrivilegedJspServlet.java:57)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
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.servlet.Dispatcher.forward(Dispatcher.java:327)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
后来搜到有位老兄也出现相同的错误,墙出去看看
http://wagagate.appspot.com/gIjurxsv/http/group/google-appengine-java/browse_thread/thread/945f6ca66c1c587e
Luca 写道
org.datanucleus.exceptions.NucleusUserException: Object Manager has been closed
Hi,
i'm still trying to develop a simple application that store some
entities (Person) information. Currently i have developed a PersonDao
using Spring JdoTemplate.
I have a method that return me all entries contained in the repository
(i have only few entries..). That i like this:
public Collection<Person> findPeople() {
jdoTemplate.executeFind(
new JdoCallback()
{
public Collection<Project> doInJdo( PersistenceManager
persistentManager ) throws JDOException
{
Query query = persistentManager.newQuery( Person.class );
return (Collection<Person>) query.execute();
}
};
}
}
function findPeople work well. The problem occour when i want iterate
over collection returned by findPeople:
Collection<Person> foundPeople = findPeople();
for(Person person: foundPeople) { // here was threw
org.datanucleus.exceptions.NucleusUserException: Object Manager has
been closed
askSomethingTo(person);
}
As described here
http://code.google.com/p/datanucleus-appengine/issues/detail?id=24
that failure is caused by a bug (Anyone can confirm please?)
In this situation, the workaround described above works for me:
Query query = persistentManager.newQuery( Person.class );
List result = query.execute();
result.size();
return result;
Hope that can be useful.
Luca
个人觉得应该是lazy-load之类的东西,解决方法是在返回结果之后对结果集执行一次操作,可以是size()
分享到:
相关推荐
资源分类:Python库 所属语言:Python 资源全名:gae_installer-1.9.17.4.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源分类:Python库 所属语言:Python 资源全名:gae_installer-1.9.7.2.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
word转PDF 工具jar包;word模板填充字段有点小脾气,字段 需要带前后空格,或者分号/回车符结尾;不然会替换不了(你将模板转为xml文件,打开就知道原因了,可能将你的字段拆开或者加%空格之类的,需要自己main方法...
GAE,全称Google App Engine,是一个由Google提供的平台,允许开发者构建和托管Web应用程序。该平台支持多种编程语言,包括Python和Java,并配备Google专有的数据库系统。GAE为用户提供免费的1GB存储空间和大约500万...
标题 "gae报错:javax.swing.tree.TreeNode is a restricted class的解决办法" 指出的是在Google App Engine (GAE) 平台上遇到的一个特定错误。GAE是一个基于Java或Python等语言的云服务平台,它对上传的代码有一些...
org.apache.poi.xwpf.converter.core-1.0.2.jar 之前找的都要分,来个不要分的,只能找到1.0.2以下的
标题中的"fr.opensagres.poi.xwpf.converter.7z"是一个压缩包文件,其中包含了两个与Apache POI相关的库,这些库主要用于处理WordprocessingML(.docx)文档,并将其转换为PDF格式。Apache POI是Java领域的一个著名...
资源分类:Python库 所属语言:Python 资源全名:gae_catnado-0.0.1.dev30-py2-none-any.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
在本例中,我们关注的是一个名为`gae_command`的库,其版本号为0.1.3,存储形式为`.tar.gz`压缩包。 `.tar.gz`是一种常见的文件打包格式,它结合了`tar`(归档)和`gzip`(压缩)两种工具的功能。`tar`用于将多个...
在IT行业中,Google App Engine(GAE)是一个非常流行的云平台,它允许开发者使用Java、Python、Go等语言构建和运行web应用。本篇将详细探讨在初用Google App Engine for Java时可能会遇到的问题,以及如何解决这些...
AppScale 是一个开源的云计算平台,设计用于托管和管理 Google App Engine (GAE) 应用程序。它为开发者提供了一种在本地、私有云或公共云上运行 GAE 应用的灵活性,而无需受制于 Google 平台的特定限制。AppScale ...
Google App Engine (GAE) 是 Google 提供的一个平台,用于构建和部署基于云端的 web 应用程序。这个平台提供了基础设施,包括服务器、数据库和各种服务,使得开发者无需关心底层硬件和系统维护,可以专注于编写应用...
maven-gae-plugin-0.9.4.jar
maven-gae-plugin-0.9.3.jar
maven-gae-plugin-0.9.2.jar
maven-gae-plugin-0.9.1.jar
maven-gae-plugin-0.9.0.jar
maven-gae-plugin-0.8.4.jar
maven-gae-plugin-0.8.3.jar