做了一个应用,用来尝试对常用的基本的框架的支持,其中使用了Struts2、Spring 3.0.3、Dwr 2.0.6。
其中采用了Spring配置数据源的方式,应用在本地运行没有任何问题,上传到GAE就无法正常启动,异常信息为:
Failed startup of context com.google.apphosting.utils.jetty.RuntimeAppEngineWebAppContext@169dd64{/,/base/data/home/apps/yourapp/1.343453889463088751}
java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:355)
at java.security.AccessController.checkPermission(AccessController.java:567)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at com.google.apphosting.runtime.security.CustomSecurityManager.checkPermission(CustomSecurityManager.java:45)
at com.google.apphosting.runtime.security.CustomSecurityManager.checkAccess(CustomSecurityManager.java:93)
at java.lang.ThreadGroup.checkAccess(Unknown Source)
at java.lang.Thread.init(Unknown Source)
at java.lang.Thread.<init>(Unknown Source)
at org.apache.log4j.helpers.FileWatchdog.<init>(FileWatchdog.java:54)
at org.apache.log4j.PropertyWatchdog.<init>(PropertyConfigurator.java:709)
at org.apache.log4j.PropertyConfigurator.configureAndWatch(PropertyConfigurator.java:400)
at org.springframework.util.Log4jConfigurer.initLogging(Log4jConfigurer.java:105)
at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:143)
at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:45)
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:191)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:168)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123)
at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:250)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:7115)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:7113)
at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:398)
at com.google.net.rpc.impl.Server$2.run(Server.java:852)
at com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56)
at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:576)
at com.google.net.rpc.impl.Server.startRpc(Server.java:807)
at com.google.net.rpc.impl.Server.processRequest(Server.java:369)
at com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:442)
at com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319)
at com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:290)
at com.google.net.async.Connection.handleReadEvent(Connection.java:474)
at com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:831)
at com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:207)
at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:103)
at com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:251)
at com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run(JavaRuntime.java:417)
at java.lang.Thread.run(Unknown Source)
C 07-18 08:17AM 45.951
Uncaught exception from servlet
javax.servlet.UnavailableException: Initialization failed.
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:200)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:168)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123)
at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:250)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:7115)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:7113)
at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:398)
at com.google.net.rpc.impl.Server$2.run(Server.java:852)
at com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56)
at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:576)
at com.google.net.rpc.impl.Server.startRpc(Server.java:807)
at com.google.net.rpc.impl.Server.processRequest(Server.java:369)
at com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:442)
at com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319)
at com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:290)
at com.google.net.async.Connection.handleReadEvent(Connection.java:474)
at com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:831)
at com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:207)
at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:103)
at com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:251)
at com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run(JavaRuntime.java:417)
at java.lang.Thread.run(Unknown Source)
问题原因:一个应用中不允许创建多个PersistenceManagerFactory对象实现数据库操作,而系统中默认的jdoconfig.xml文件中包含了JDO相关信息,由于我采用了Spring所以同时也配置了一个JDO,所以在应用启动过程中采用不同的方式创建了两个PersistenceManagerFactory对象,导致系统无法正常启动。
解决办法:只采用一种方式完成PersistenceManagerFactory对象的创建,我的方法是将jdoconfig.xml文件中包含的JDO配置信息删除。
结果:系统正常运行。
分享到:
相关推荐
当用户部署应用程序时,AppScale 会自动配置和管理这些虚拟实例,确保应用程序能够正常运行。AppScale 还提供了自己的 API 服务器,用于处理应用的生命周期管理,如实例的启动、停止、扩展等。 **使用 appscale-...
8. **配置**:正确配置`web.xml`和`appengine-web.xml`文件,以确保Spring应用在GAE上的正常启动和运行。 文件列表中的"spring-gae"可能是一个包含源代码、配置文件和文档的项目,展示了整个集成过程。通过深入研究...
- **定义与特性**:GAE(Google App Engine)是Google推出的一种基于云端的应用程序托管服务,它允许开发者在其上部署各种Web应用程序。GAE自2008年发布以来,已经成为了一个非常受欢迎的选择,特别是对于那些寻求...
6. **测试与调试**:在本地开发环境中使用GAE SDK进行测试是非常重要的,确保你的应用在部署到生产环境之前能够在模拟的GAE环境中正常工作。你还需要使用GAE的控制台来监控应用的性能和错误日志。 7. **源码分析**...
8. 测试和调试:确保所有功能在GAE环境中正常工作。 总的来说,gae strus2 spring 整合是一个复杂的工程,需要对三个框架有深入的理解,同时也需要熟悉GAE的特性和限制。通过这样的整合,开发者可以在GAE上构建出...
5. **本地测试**:在本地环境中运行应用,确保一切正常,可以使用`npm start`命令启动应用。 6. **部署到GAE**:通过Cloud SDK的gcloud命令行工具,使用`gcloud app deploy`命令将应用部署到GAE。这个过程会构建...
- **适应性强**:支持多种备用电源切换策略,可以根据不同的应用场景灵活配置。 - **操作简便**:用户界面友好,通过简单的设置即可完成复杂的控制逻辑配置。 - **维护方便**:提供详细的运行日志和故障记录,便于...