我已经尝试了4天让app-engine和grails在我的Mac上一起工作无济于事。我正在使用最新的groovy / grails和appengine sdk版本。我在grails网站上一步一步地关注app-engine插件。
http://grails.org/plugin/app-engine
Groovy版本:1.7.1 JVM:1.5.0_22
Grails 1.3.0.RC1
echo $ APPENGINE_HOME显示
/Users/markstim/appengine-java-sdk-1.3.2
我执行以下步骤
1. grails create-app myapp
2. cd myapp; grails list-plugins
显示了
hibernate 1.3.0.RC1 -- Hibernate for Grails
tomcat 1.3.0.RC1 -- Apache Tomcat plugin for Grails
将以下行添加到Config.groovy
google.appengine.application="myapp"
安装app-engine grails install-plugin app-engine
的插件,并在被问到时(无错误)回答'jpa'
安装的插件列表现在看起来像是
app-engine 0.8.9 - Grails AppEngine插件
gorm-jpa 0.7.1 - GORM-JPA插件
然后grails run-app
并在服务器即将出现时收到此错误...
[java] WARNING: Nested in org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'pluginManager' defined in ServletContext
resource [/WEB-INF/applicationContext.xml]:
Invocation of init method failed; nested exception is
org.codehaus.groovy.grails.exceptions.NewInstanceCreationException:
Could not create a new instance of class [GormJpaGrailsPlugin]!: [java] java.lang.NoClassDefFoundError: org.grails.jpa.JpaPluginSupport
然后如果我导航到localhost:8080我得到
HTTP错误:503
访问/ myapp时遇到问题。原因:
SERVICE_UNAVAILABLE
由Jetty提供支持://
答案 0 :(得分:1)
Localhost:8080是您的应用程序。您无需在路径中添加“myapp”。
答案 1 :(得分:0)
根据Will it play in app engine,您必须使用grails app-engine run
答案 2 :(得分:0)
同意tgd25 - 您将需要删除/ myapp,这就是您获得404的原因。
奇怪的是,在与Mac上的Grails 1.3RC1达到相同的异常之后,我设法通过DataNucleus增强器和一(1)个域类来启动'grails app-engine run'来测试
但是,在保存时,webapp会发出以下异常。请参阅随附的JIRA:
[java] 2010-04-17 21:48:05,675 [13387359@qtp-10769461-4] ERROR errors.GrailsExceptionResolver - This operation requires a transaction yet it is not active [java] javax.persistence.TransactionRequiredException: This operation requires a transaction yet it is not active [java] at org.datanucleus.jpa.EntityManagerImpl.assertIsActive(EntityManagerImpl.java:846) [java] at org.datanucleus.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:545) [java] at org.springframework.orm.jpa.JpaTemplate$8.doInJpa(JpaTemplate.java:290) [java] at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:183) [java] at org.springframework.orm.jpa.JpaTemplate.flush(JpaTemplate.java:288) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at java.lang.reflect.Method.invoke(Method.java:592) [java] at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:100) [java] at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229) [java] at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52) [java] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40) [java] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) [java] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:121) [java] at org.grails.jpa.JpaPluginSupport$__clinit__closure3_closure7_closure14.doCall(JpaPluginSupport.groovy:471) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at java.lang.reflect.Method.invoke(Method.java:592) [java] at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:100) [java] at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88) [java] at org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod.invoke(ClosureMetaMethod.java:80) [java] at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoMetaMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:307) [java] at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:63) [java] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40) [java] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) [java] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) [java] at pollster.BookController$_closure4.doCall(script12715407593811946448835.groovy:24) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at java.lang.reflect.Method.invoke(Method.java:592) [java] at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:100) [java] at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:225) [java] at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51) [java] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44) [java] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143) [java] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:151) [java] at pollster.BookController$_closure4.doCall(script12715407593811946448835.groovy) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at java.lang.reflect.Method.invoke(Method.java:592) [java] at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:100) [java] at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88) [java] at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) [java] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058) [java] at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:915) [java] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886) [java] at groovy.lang.Closure.call(Closure.java:276) [java] at groovy.lang.Closure.call(Closure.java:271) [java] at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleAction(SimpleGrailsControllerHelper.java:378) [java] at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.executeAction(SimpleGrailsControllerHelper.java:245) [java] at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:200) [java] at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:137) [java] at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.handleRequest(SimpleGrailsController.java:88) [java] at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) [java] at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:256) [java] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716) [java] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647) [java] at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:563) [java] at javax.servlet.http.HttpServlet.service(HttpServlet.java:713) [java] at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) [java] at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) [java] at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) [java] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70) [java] at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) [java] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70) [java] at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) [java] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70) [java] at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) [java] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70) [java] at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) [java] at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) [java] at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) [java] at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) [java] at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) [java] at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) [java] at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70) [java] at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327) [java] at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) [java] at org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:283) [java] at org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:259) [java] at org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:252) [java] at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:187) [java] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [java] at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) [java] at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.obtainContent(GrailsPageFilter.java:245) [java] at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:136) [java] at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) [java] at org.codehaus.groovy.grails.web.servlet.filter.GrailsReloadServletFilter.doFilterInternal(GrailsReloadServletFilter.java:101) [java] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [java] at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) [java] at org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:67) [java] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [java] at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) [java] at org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:63) [java] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [java] at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) [java] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) [java] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [java] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) [java] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) [java] at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) [java] at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:51) [java] at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) [java] at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43) [java] at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) [java] at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122) [java] at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) [java] at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) [java] at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) [java] at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) [java] at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) [java] at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) [java] at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70) [java] at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) [java] at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:349) [java] at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) [java] at org.mortbay.jetty.Server.handle(Server.java:326) [java] at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) [java] at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938) [java] at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755) [java] at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) [java] at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) [java] at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) [java] at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
答案 3 :(得分:0)
我必须在我的工作之前删除tomcat插件。我认为这就是混乱的地方 - tomcat在localhost:8080 / appname上提供应用程序,而app engine插件则从root用户服务。
在我的Mac上使用最新的grails / appengine我无法使用当前的app-engine插件[0.8.9]来工作;我使用的是0.8.8版本。
要运行它,我只使用了“grails run-app”。
希望这有帮助。