`
struts
  • 浏览: 76044 次
  • 性别: 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要好,真不爽

相关推荐

Global site tag (gtag.js) - Google Analytics