`
struts
  • 浏览: 76278 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

google appengine for java 做的BLOG

    博客分类:
  • java
阅读更多
google appengine支持java.闲来无事。就体验了一下google appengine.

简单的做了一个blog ,希望大家光临一下。准备慢慢完善。  只是简单的实现了一些功能。

里面用到了freemarker taglib  ,自己简单把servlet封装了一个。

地址: http://pythonfn.appspot.com/index.jsp

分享到:
评论
38 楼 popo123 2009-05-31  
fc6029585 写道
楼主..麻烦你帮我看一下.我找了一天了也不知道哪出了问题..
如果我将自带的jdoexample  copy到eclipse中就可以直接运行了..

@Entity
public class UserInfo {
	@Id
	@GeneratedValue(strategy = GenerationType.TABLE)
	private Long id;
	
	private String userName;  
 
	private String password; 
	
	@Transient
	private String phone;
 
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
}

保存这个类..eclipse 控制台打印
DataNucleus Enhancer (version 1.1.0) : Enhancement of classes

DataNucleus Enhancer completed with success for 1 classes. Timings : input=125 ms, enhance=47 ms, total=172 ms. Consult the log for full details

请问是不是意思就是 在gae的本地数据库dataNuclus就已经创建了这个类对应的表?


然后我写了个插入数据库的类
public class InsertDB {
	
	public static void main(String[] args) { 
		EntityManager em=EMF.getEntiryManager();
		for(int i=4;i<9;i++){
		UserInfo user1=new UserInfo();
		user1.setUserName("user"+i+i);
		user1.setPassword(i+i+i+i+i+i+i+i+"");
		user1.setPhone(i+i+"");
		em.merge(user1); 
		} 
	}
}

保存的时候打印 
DataNucleus Enhancer (version 1.1.0) : Enhancement of classes

DataNucleus Enhancer completed with success for 0 classes. Timings : input=32 ms, enhance=0 ms, total=32 ms. Consult the log for full details
DataNucleus Enhancer completed and no classes were enhanced. Consult the log for full details


我将   persistence.xml(google jpa 说明的xml直接copy过来的)  copy  到了  META-INFO 下(和jdoconfig.xml 同一个目录)


写了个main方法  和servlet 运行

    EntityManager em=EMF.getEntiryManager() ;
  Query query=em.createQuery("select u from UserInfo u");
  List list=(List)query.getResultList();
  System.out.println(list.size()+"  size");
  for(int i=0;i<list.size();i++){
  UserInfo user=(UserInfo)list.get(i);
  System.out.println(user.getUserName()+"  </br>");
  }
但是都要报错


HTTP ERROR: 500

UserInfo

RequestURI=/eat
Caused by:

javax.persistence.PersistenceException: UserInfo
	at org.datanucleus.jpa.NucleusJPAHelper.getJPAExceptionForNucleusException(NucleusJPAHelper.java:276)
	at org.datanucleus.jpa.JPAQuery.getResultList(JPAQuery.java:169)
	at fank.eatServlet.doGet(eatServlet.java:20)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
	at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
	at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:54)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:306)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at org.mortbay.jetty.Server.handle(Server.java:313)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396)
	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
Caused by: org.datanucleus.exceptions.ClassNotResolvedException: UserInfo
	at org.datanucleus.util.Imports.resolveClassDeclaration(Imports.java:194)
	at org.datanucleus.query.compiler.JavaQueryCompiler.compileFrom(JavaQueryCompiler.java:209)
	at org.datanucleus.query.compiler.JPQLCompiler.compile(JPQLCompiler.java:72)
	at org.datanucleus.store.query.AbstractJPQLQuery.compileInternal(AbstractJPQLQuery.java:242)
	at org.datanucleus.store.query.Query.executeQuery(Query.java:1430)
	at org.datanucleus.store.query.Query.executeWithMap(Query.java:1367)
	at org.datanucleus.jpa.JPAQuery.getResultList(JPAQuery.java:153)
	... 24 more

Caused by:

UserInfo
org.datanucleus.exceptions.ClassNotResolvedException: UserInfo
	at org.datanucleus.util.Imports.resolveClassDeclaration(Imports.java:194)
	at org.datanucleus.query.compiler.JavaQueryCompiler.compileFrom(JavaQueryCompiler.java:209)
	at org.datanucleus.query.compiler.JPQLCompiler.compile(JPQLCompiler.java:72)
	at org.datanucleus.store.query.AbstractJPQLQuery.compileInternal(AbstractJPQLQuery.java:242)
	at org.datanucleus.store.query.Query.executeQuery(Query.java:1430)
	at org.datanucleus.store.query.Query.executeWithMap(Query.java:1367)
	at org.datanucleus.jpa.JPAQuery.getResultList(JPAQuery.java:153)
	at fank.eatServlet.doGet(eatServlet.java:20)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
	at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
	at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:54)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:306)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at org.mortbay.jetty.Server.handle(Server.java:313)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396)
	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)

Powered by Jetty://

我的测试jpa项目附件发上来了

如果楼主有空请帮我看看..或者是把您的  简易博客 发给我参考下..哈哈







USERINFO那个前面要加包名
被搞死了,原来hib的项目到这很多都不能用
37 楼 fc6029585 2009-04-16  
谢谢!!!struts!!
36 楼 struts 2009-04-16  
fc6029585 写道
楼主..麻烦你帮我看一下.我找了一天了也不知道哪出了问题..
如果我将自带的jdoexample  copy到eclipse中就可以直接运行了..

@Entity
public class UserInfo {
	@Id
	@GeneratedValue(strategy = GenerationType.TABLE)
	private Long id;
	
	private String userName;  
 
	private String password; 
	
	@Transient
	private String phone;
 
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
}

保存这个类..eclipse 控制台打印
DataNucleus Enhancer (version 1.1.0) : Enhancement of classes

DataNucleus Enhancer completed with success for 1 classes. Timings : input=125 ms, enhance=47 ms, total=172 ms. Consult the log for full details

请问是不是意思就是 在gae的本地数据库dataNuclus就已经创建了这个类对应的表?


然后我写了个插入数据库的类
public class InsertDB {
	
	public static void main(String[] args) { 
		EntityManager em=EMF.getEntiryManager();
		for(int i=4;i<9;i++){
		UserInfo user1=new UserInfo();
		user1.setUserName("user"+i+i);
		user1.setPassword(i+i+i+i+i+i+i+i+"");
		user1.setPhone(i+i+"");
		em.merge(user1); 
		} 
	}
}

保存的时候打印 
DataNucleus Enhancer (version 1.1.0) : Enhancement of classes

DataNucleus Enhancer completed with success for 0 classes. Timings : input=32 ms, enhance=0 ms, total=32 ms. Consult the log for full details
DataNucleus Enhancer completed and no classes were enhanced. Consult the log for full details


我将   persistence.xml(google jpa 说明的xml直接copy过来的)  copy  到了  META-INFO 下(和jdoconfig.xml 同一个目录)


写了个main方法  和servlet 运行

    EntityManager em=EMF.getEntiryManager() ;
  Query query=em.createQuery("select u from UserInfo u");
  List list=(List)query.getResultList();
  System.out.println(list.size()+"  size");
  for(int i=0;i<list.size();i++){
  UserInfo user=(UserInfo)list.get(i);
  System.out.println(user.getUserName()+"  </br>");
  }
但是都要报错


HTTP ERROR: 500

UserInfo

RequestURI=/eat
Caused by:

javax.persistence.PersistenceException: UserInfo
	at org.datanucleus.jpa.NucleusJPAHelper.getJPAExceptionForNucleusException(NucleusJPAHelper.java:276)
	at org.datanucleus.jpa.JPAQuery.getResultList(JPAQuery.java:169)
	at fank.eatServlet.doGet(eatServlet.java:20)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
	at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
	at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:54)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:306)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at org.mortbay.jetty.Server.handle(Server.java:313)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396)
	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
Caused by: org.datanucleus.exceptions.ClassNotResolvedException: UserInfo
	at org.datanucleus.util.Imports.resolveClassDeclaration(Imports.java:194)
	at org.datanucleus.query.compiler.JavaQueryCompiler.compileFrom(JavaQueryCompiler.java:209)
	at org.datanucleus.query.compiler.JPQLCompiler.compile(JPQLCompiler.java:72)
	at org.datanucleus.store.query.AbstractJPQLQuery.compileInternal(AbstractJPQLQuery.java:242)
	at org.datanucleus.store.query.Query.executeQuery(Query.java:1430)
	at org.datanucleus.store.query.Query.executeWithMap(Query.java:1367)
	at org.datanucleus.jpa.JPAQuery.getResultList(JPAQuery.java:153)
	... 24 more

Caused by:

UserInfo
org.datanucleus.exceptions.ClassNotResolvedException: UserInfo
	at org.datanucleus.util.Imports.resolveClassDeclaration(Imports.java:194)
	at org.datanucleus.query.compiler.JavaQueryCompiler.compileFrom(JavaQueryCompiler.java:209)
	at org.datanucleus.query.compiler.JPQLCompiler.compile(JPQLCompiler.java:72)
	at org.datanucleus.store.query.AbstractJPQLQuery.compileInternal(AbstractJPQLQuery.java:242)
	at org.datanucleus.store.query.Query.executeQuery(Query.java:1430)
	at org.datanucleus.store.query.Query.executeWithMap(Query.java:1367)
	at org.datanucleus.jpa.JPAQuery.getResultList(JPAQuery.java:153)
	at fank.eatServlet.doGet(eatServlet.java:20)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
	at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
	at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:54)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:306)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at org.mortbay.jetty.Server.handle(Server.java:313)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396)
	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)

Powered by Jetty://

我的测试jpa项目附件发上来了

如果楼主有空请帮我看看..或者是把您的  简易博客 发给我参考下..哈哈







1,首先修改UserInfo主键的注释为
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)

2,删除web-inf下appengine-generated
3,查询语句写错了。应该是select from fank.table.create.UserInfo u

我现在在公司。没有那个博客的代码。如果需要的话。晚上传给你qq:256484
35 楼 fc6029585 2009-04-16  
楼主..麻烦你帮我看一下.我找了一天了也不知道哪出了问题..
如果我将自带的jdoexample  copy到eclipse中就可以直接运行了..

@Entity
public class UserInfo {
	@Id
	@GeneratedValue(strategy = GenerationType.TABLE)
	private Long id;
	
	private String userName;  
 
	private String password; 
	
	@Transient
	private String phone;
 
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
}

保存这个类..eclipse 控制台打印
DataNucleus Enhancer (version 1.1.0) : Enhancement of classes

DataNucleus Enhancer completed with success for 1 classes. Timings : input=125 ms, enhance=47 ms, total=172 ms. Consult the log for full details

请问是不是意思就是 在gae的本地数据库dataNuclus就已经创建了这个类对应的表?


然后我写了个插入数据库的类
public class InsertDB {
	
	public static void main(String[] args) { 
		EntityManager em=EMF.getEntiryManager();
		for(int i=4;i<9;i++){
		UserInfo user1=new UserInfo();
		user1.setUserName("user"+i+i);
		user1.setPassword(i+i+i+i+i+i+i+i+"");
		user1.setPhone(i+i+"");
		em.merge(user1); 
		} 
	}
}

保存的时候打印 
DataNucleus Enhancer (version 1.1.0) : Enhancement of classes

DataNucleus Enhancer completed with success for 0 classes. Timings : input=32 ms, enhance=0 ms, total=32 ms. Consult the log for full details
DataNucleus Enhancer completed and no classes were enhanced. Consult the log for full details


我将   persistence.xml(google jpa 说明的xml直接copy过来的)  copy  到了  META-INFO 下(和jdoconfig.xml 同一个目录)


写了个main方法  和servlet 运行

    EntityManager em=EMF.getEntiryManager() ;
  Query query=em.createQuery("select u from UserInfo u");
  List list=(List)query.getResultList();
  System.out.println(list.size()+"  size");
  for(int i=0;i<list.size();i++){
  UserInfo user=(UserInfo)list.get(i);
  System.out.println(user.getUserName()+"  </br>");
  }
但是都要报错


HTTP ERROR: 500

UserInfo

RequestURI=/eat
Caused by:

javax.persistence.PersistenceException: UserInfo
	at org.datanucleus.jpa.NucleusJPAHelper.getJPAExceptionForNucleusException(NucleusJPAHelper.java:276)
	at org.datanucleus.jpa.JPAQuery.getResultList(JPAQuery.java:169)
	at fank.eatServlet.doGet(eatServlet.java:20)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
	at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
	at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:54)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:306)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at org.mortbay.jetty.Server.handle(Server.java:313)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396)
	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
Caused by: org.datanucleus.exceptions.ClassNotResolvedException: UserInfo
	at org.datanucleus.util.Imports.resolveClassDeclaration(Imports.java:194)
	at org.datanucleus.query.compiler.JavaQueryCompiler.compileFrom(JavaQueryCompiler.java:209)
	at org.datanucleus.query.compiler.JPQLCompiler.compile(JPQLCompiler.java:72)
	at org.datanucleus.store.query.AbstractJPQLQuery.compileInternal(AbstractJPQLQuery.java:242)
	at org.datanucleus.store.query.Query.executeQuery(Query.java:1430)
	at org.datanucleus.store.query.Query.executeWithMap(Query.java:1367)
	at org.datanucleus.jpa.JPAQuery.getResultList(JPAQuery.java:153)
	... 24 more

Caused by:

UserInfo
org.datanucleus.exceptions.ClassNotResolvedException: UserInfo
	at org.datanucleus.util.Imports.resolveClassDeclaration(Imports.java:194)
	at org.datanucleus.query.compiler.JavaQueryCompiler.compileFrom(JavaQueryCompiler.java:209)
	at org.datanucleus.query.compiler.JPQLCompiler.compile(JPQLCompiler.java:72)
	at org.datanucleus.store.query.AbstractJPQLQuery.compileInternal(AbstractJPQLQuery.java:242)
	at org.datanucleus.store.query.Query.executeQuery(Query.java:1430)
	at org.datanucleus.store.query.Query.executeWithMap(Query.java:1367)
	at org.datanucleus.jpa.JPAQuery.getResultList(JPAQuery.java:153)
	at fank.eatServlet.doGet(eatServlet.java:20)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
	at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
	at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:54)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:306)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at org.mortbay.jetty.Server.handle(Server.java:313)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396)
	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)

Powered by Jetty://

我的测试jpa项目附件发上来了

如果楼主有空请帮我看看..或者是把您的  简易博客 发给我参考下..哈哈





34 楼 fc6029585 2009-04-15  
struts 写道
fc6029585 写道
我试着写了个JPA注解类,,
本地  run as  gae application 的时候报错..

大家帮忙指点下

Missing required argument 'module[s]'
Google Web Toolkit 1.6.4
HostedMode [-noserver] [-port port-number | "auto"] [-whitelist whitelist-string] [-blacklist blacklist-string] [-logLevel level] [-gen dir] [-style style] [-ea] [-server servletContainerLauncher] [-startupUrl url] [-war dir] [-extra dir] [-workDir dir] [-localWorkers count] module[s]

where
  -noserver      Prevents the embedded web server from running
  -port          Specifies the TCP port for the embedded web server (defaults to 8888)
  -whitelist     Allows the user to browse URLs that match the specified regexes (comma or space separated)
  -blacklist     Prevents the user browsing URLs that match the specified regexes (comma or space separated)
  -logLevel      The level of logging detail: ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL
  -gen           The directory into which generated files will be written for review
  -style         Script output style: OBF[USCATED], PRETTY, or DETAILED (defaults to OBF)
  -ea            Debugging: causes the compiled output to check assert statements.
  -server        Specifies a different embedded web server to run (must implement ServletContainerLauncher)
  -startupUrl    Automatically launches the specified URL
  -war           The war directory to write output files into (defaults to war)
  -extra         The directory into which extra, non-deployed files will be written
  -workDir       The compiler work directory (must be writeable; defaults to a system temp dir)
  -localWorkers  Specifies the number of local workers to use when compiling permutations
and
  module[s]      Specifies the name(s) of the module(s) to host



他会在项目的web-inf下生成appengine-generated目录。里面存的数据信息。
使用jpa需要把meta-inf下的xml文件换成persistence.xml


谢谢帮助...我还是自己先慢慢测试一下算了!
33 楼 struts 2009-04-15  
fc6029585 写道
我试着写了个JPA注解类,,
本地  run as  gae application 的时候报错..

大家帮忙指点下

Missing required argument 'module[s]'
Google Web Toolkit 1.6.4
HostedMode [-noserver] [-port port-number | "auto"] [-whitelist whitelist-string] [-blacklist blacklist-string] [-logLevel level] [-gen dir] [-style style] [-ea] [-server servletContainerLauncher] [-startupUrl url] [-war dir] [-extra dir] [-workDir dir] [-localWorkers count] module[s]

where
  -noserver      Prevents the embedded web server from running
  -port          Specifies the TCP port for the embedded web server (defaults to 8888)
  -whitelist     Allows the user to browse URLs that match the specified regexes (comma or space separated)
  -blacklist     Prevents the user browsing URLs that match the specified regexes (comma or space separated)
  -logLevel      The level of logging detail: ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL
  -gen           The directory into which generated files will be written for review
  -style         Script output style: OBF[USCATED], PRETTY, or DETAILED (defaults to OBF)
  -ea            Debugging: causes the compiled output to check assert statements.
  -server        Specifies a different embedded web server to run (must implement ServletContainerLauncher)
  -startupUrl    Automatically launches the specified URL
  -war           The war directory to write output files into (defaults to war)
  -extra         The directory into which extra, non-deployed files will be written
  -workDir       The compiler work directory (must be writeable; defaults to a system temp dir)
  -localWorkers  Specifies the number of local workers to use when compiling permutations
and
  module[s]      Specifies the name(s) of the module(s) to host



他会在项目的web-inf下生成appengine-generated目录。里面存的数据信息。
使用jpa需要把meta-inf下的xml文件换成persistence.xml
32 楼 fc6029585 2009-04-15  
我试着写了个JPA注解类,,
本地  run as  gae application 的时候报错..

大家帮忙指点下

Missing required argument 'module[s]'
Google Web Toolkit 1.6.4
HostedMode [-noserver] [-port port-number | "auto"] [-whitelist whitelist-string] [-blacklist blacklist-string] [-logLevel level] [-gen dir] [-style style] [-ea] [-server servletContainerLauncher] [-startupUrl url] [-war dir] [-extra dir] [-workDir dir] [-localWorkers count] module[s]

where
  -noserver      Prevents the embedded web server from running
  -port          Specifies the TCP port for the embedded web server (defaults to 8888)
  -whitelist     Allows the user to browse URLs that match the specified regexes (comma or space separated)
  -blacklist     Prevents the user browsing URLs that match the specified regexes (comma or space separated)
  -logLevel      The level of logging detail: ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL
  -gen           The directory into which generated files will be written for review
  -style         Script output style: OBF[USCATED], PRETTY, or DETAILED (defaults to OBF)
  -ea            Debugging: causes the compiled output to check assert statements.
  -server        Specifies a different embedded web server to run (must implement ServletContainerLauncher)
  -startupUrl    Automatically launches the specified URL
  -war           The war directory to write output files into (defaults to war)
  -extra         The directory into which extra, non-deployed files will be written
  -workDir       The compiler work directory (must be writeable; defaults to a system temp dir)
  -localWorkers  Specifies the number of local workers to use when compiling permutations
and
  module[s]      Specifies the name(s) of the module(s) to host

31 楼 fc6029585 2009-04-15  
struts 写道
fc6029585 写道
请教一下..
gae有关数据库的建立(数据库建立,表的创建)?是怎么弄啊??
有没有相关的地址啊?
我google了很久也没找到方法!!


你写好实现类加上注释。他会自动根据annotation生成数据库表的

http://code.google.com/intl/zh-CN/appengine/docs/java/gettingstarted/



我看了下JPA的注解..但是都没有看到那个注解和自动建库,建表有关系.>!!!
30 楼 lw223 2009-04-14  
hateeyes 写道
下一站,火星 写道
http://123tizi.appspot.com/  早八年就搞了个blog,没啥意思


早点共享嘛

ls的ls,lz是java 不是python。 早八年可没有这个
29 楼 hateeyes 2009-04-14  
下一站,火星 写道
http://123tizi.appspot.com/  早八年就搞了个blog,没啥意思


早点共享嘛
28 楼 lupingui 2009-04-14  
[url]http://www.xiangsou.net.cn/[url]
最近学习lucene,做了一个项目外包搜索网站。有兴趣的兄弟可以去看看。。。
27 楼 struts 2009-04-14  
fc6029585 写道
请教一下..
gae有关数据库的建立(数据库建立,表的创建)?是怎么弄啊??
有没有相关的地址啊?
我google了很久也没找到方法!!


你写好实现类加上注释。他会自动根据annotation生成数据库表的

http://code.google.com/intl/zh-CN/appengine/docs/java/gettingstarted/
26 楼 fc6029585 2009-04-14  
请教一下..
gae有关数据库的建立(数据库建立,表的创建)?是怎么弄啊??
有没有相关的地址啊?
我google了很久也没找到方法!!
25 楼 struts 2009-04-14  
blueion 写道
上面能不能放广告?


可以放广告。。呵呵。
24 楼 struts 2009-04-14  
chenlb 写道
注册了 gae ,但不是在10000个之前, 发布不了 java


我也是后来注册的。不过隔了一天。就开通了。慢慢等一下吧。
23 楼 struts 2009-04-14  
ywbanm 写道
struts 写道
google appengine支持java.闲来无事。就体验了一下google appengine.

简单的做了一个blog ,希望大家光临一下。准备慢慢完善。  只是简单的实现了一些功能。

里面用到了freemarker taglib  ,自己简单把servlet封装了一个。

地址: http://pythonfn.appspot.com/index.jsp



功能是简单了点。。。。
楼主用啥做的?
我准备用Spring+JPA。



servlet那层。自己仿struts2框架。利用filter简单的封装了一个。适合自己就可以了。view层是用的freemarker   持久层用的jdo  感觉不太好用。。呵呵。
22 楼 lw223 2009-04-14  
天机老人 写道
ywbanm 写道
struts 写道
google appengine支持java.闲来无事。就体验了一下google appengine.

简单的做了一个blog ,希望大家光临一下。准备慢慢完善。  只是简单的实现了一些功能。

里面用到了freemarker taglib  ,自己简单把servlet封装了一个。

地址: http://pythonfn.appspot.com/index.jsp



功能是简单了点。。。。
楼主用啥做的?
我准备用Spring+JPA。

我还在研究他的JPA呢!

我在研究spring mvc呢,这玩意可以用spring 
21 楼 lw223 2009-04-14  
chenlb 写道
注册了 gae ,但不是在10000个之前, 发布不了 java

之前注册的是python的,你需要重新申请就可以了。
20 楼 chenlb 2009-04-13  
注册了 gae ,但不是在10000个之前, 发布不了 java
19 楼 汪兆铭 2009-04-13  
貌似java的支持比python要好,真不爽

相关推荐

    google app Engine for java中文api

    ### Google App Engine for Java中文API知识点详解 #### 一、Google App Engine for Java概览 - **背景介绍**: - Google App Engine最初是专为Python开发者设计的平台,但随着时间的发展,为了满足更广泛开发者...

    Google App Engine for Java 中文指南

    Google App Engine for Java 是一个平台,允许开发者使用Java语言构建并托管网络应用程序,该平台运行在Google的强大可扩展基础设施上。这个平台的核心特性是它的Java运行时环境,它基于Java 6虚拟机(JVM),并且...

    google appengine sdk for java

    The App Engine SDK for Java includes a local development server as well as the tooling for deploying and managing your applications in App Engine. By downloading, you agree to be bound by the Terms ...

    Google App Engine for Java快速入门指南v1.2.0

    ### Google App Engine for Java 快速入门指南 v1.2.0 #### 1. AppEngine简介 **1.1 什么是Google App Engine?** Google App Engine (GAE) 是一款由Google提供的平台即服务(PaaS),允许开发者在其基础设施上...

    Google App Engine for Java 快速使用指南 - 中国科学技术大学

    ### Google App Engine for Java 快速使用指南 #### 1. App Engine 简介 ##### 1.1 什么是 Google App Engine? Google App Engine 是一项由 Google 提供的云计算平台服务,允许开发者在其基础设施上运行网络应用...

    初用Google App Engine for Java (org.apache.jasper.JasperExceptio; org.datanucleun)

    标题中的“初用Google App Engine for Java”表明我们要探讨的是如何使用Google的App Engine平台来开发Java应用程序。Google App Engine是一个基于云计算的平台,它允许开发者构建和运行Web应用程序,无需管理和维护...

    appengine-java-sdk-1.5.0.1.zip_JDK1.5.0.1_appengine-java-s_appen

    标题中的"appengine-java-sdk-1.5.0.1.zip"表明这是一个关于Google App Engine Java SDK的压缩包,版本号为1.5.0.1。App Engine是由Google提供的一个平台,允许开发者使用Java或Python等语言创建并运行web应用程序。...

    Google App Engine plugin(JAVA) for Eclipse part1

    Google App Engine用于Eclipse的插件

    Google App Engine 开发包(part1,共2部分)

    Eclipse Google 插件 Google App Engine SDK for Java Google App Engine文档 按钮 Google App Engine 开发包

    Apress - Beginning Java Google App Engine(Java)(Dec 2009).pdf

    ### Apress - Beginning Java Google App Engine(Java)(Dec 2009) 关键知识点解析 #### 一、概述 本书由 Kyle Roche 和 Jeff Douglas 合著,旨在为使用 Java 技术的 Web 开发者提供关于 Google App Engine 的核心...

    Beginning Java Google App Engine

    Beginning Java Google App Engine - Kyle Roche and Jeff Douglas.pdf Google App Engine is one of the key technologies to emerge in recent years to help you build scalable web applications even if you ...

    appengine-java-sdk-1.9.24

    在本例中,我们关注的是专为 Java 开发者设计的 SDK 版本——"appengine-java-sdk-1.9.24"。 **1. GAE 平台** Google App Engine 平台支持多种编程语言,包括 Python、Java 和 Go。它提供了动态扩展性,能够根据...

    Google App Engine 开发包(part2,共2部分)

    Eclipse Google 插件 Google App Engine SDK for Java Google App Engine文档 按钮 Google App Engine 开发包

    Google_App_Engine开发环境搭建

    Google App Engine for Java 是一个由 Google 提供的云计算平台,专为 Java 开发人员设计,让他们能够构建可伸缩的Web应用程序。自2009年4月起,这个平台开始支持Java,为开发者提供了丰富的服务和工具。本文将深入...

    基于Google.App.Engine(GAE)的Java和GWT应用开发.pdf

    However, building and deploying scalable web applications using Google Web Toolkit and Google App Engine for Java can be challenging even to developers. The start to finish approach of this book ...

    [云端包]Google App Engine SDK for Python v1.5.2

    Google App Engine可让您在Google的基础架构上运行您的网络应用程序。App Engine应用程序易于构建和维护,并可根据您的访问量和数据存储需要的增长轻松扩展。使用Google App Engine,将不再需要维护服务器:您只需...

    Apress - Beginning Java Google App Engine (December 2009) (ATTiCA).pdf

    ### Apress - Beginning Java Google App Engine (December 2009) (ATTiCA).pdf 知识点解析 #### 书籍基本信息 - **书名**:《Beginning Java Google App Engine》 - **作者**:Kyle Roche 和 Jeff Douglas - **...

Global site tag (gtag.js) - Google Analytics