quarks
quarks

Reputation: 35276

Spring Boot on Google App Engine

After trying out this Spring Boot web app for Google App Engine:

However I get this error when running:

[INFO] java.lang.NoClassDefFoundError: java.io.FileOutputStream is a restricted class. Please see the Google  App Engine developer's guide for more details.
[INFO]  at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51)
[INFO]  at ch.qos.logback.core.recovery.ResilientFileOutputStream.<init>(ResilientFileOutputStream.java:28)
[INFO]  at ch.qos.logback.core.FileAppender.openFile(FileAppender.java:150)
[INFO]  at ch.qos.logback.core.FileAppender.start(FileAppender.java:108)
[INFO]  at ch.qos.logback.core.rolling.RollingFileAppender.start(RollingFileAppender.java:86)
[INFO]  at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:96)
[INFO]  at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317)
[INFO]  at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196)
[INFO]  at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182)
[INFO]  at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
[INFO]  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
[INFO]  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
[INFO]  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
[INFO]  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
[INFO]  at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
[INFO]  at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:100)
[INFO]  at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:58)
[INFO]  at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:181)
[INFO]  at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:122)
[INFO]  at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:98)
[INFO]  at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:92)
[INFO]  at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:58)
[INFO]  at org.springframework.boot.SpringApplication.run(SpringApplication.java:275)
[INFO]  at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:130)
[INFO]  at org.springframework.boot.legacy.context.web.SpringBootContextLoaderListener.initWebApplicationContext(SpringBootContextLoaderListener.java:60)
[INFO]  at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
[INFO]  at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
[INFO]  at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
[INFO]  at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
[INFO]  at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
[INFO]  at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
[INFO]  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
[INFO]  at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
[INFO]  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
[INFO]  at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
[INFO]  at org.mortbay.jetty.Server.doStart(Server.java:224)
[INFO]  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
[INFO]  at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:254)
[INFO]  at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:305)
[INFO]  at com.google.appengine.tools.development.AutomaticInstanceHolder.startUp(AutomaticInstanceHolder.java:26)
[INFO]  at com.google.appengine.tools.development.AbstractModule.startup(AbstractModule.java:79)
[INFO]  at com.google.appengine.tools.development.Modules.startup(Modules.java:97)
[INFO]  at com.google.appengine.tools.development.DevAppServerImpl.doStart(DevAppServerImpl.java:255)
[INFO]  at com.google.appengine.tools.development.DevAppServerImpl.access$000(DevAppServerImpl.java:47)
[INFO]  at com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:213)
[INFO]  at com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:211)
[INFO]  at java.security.AccessController.doPrivileged(Native Method)
[INFO]  at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:211)
[INFO]  at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:277)
[INFO]  at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
[INFO]  at com.google.appengine.tools.development.DevAppServerMain.run(DevAppServerMain.java:219)
[INFO]  at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:210)

Does this mean that its not possible to run Spring Boot within the GAE environment?

Upvotes: 2

Views: 5834

Answers (4)

Rey Pader
Rey Pader

Reputation: 83

Do a custom configuration that forces a Console Logging. See the sample logback.xml file here. Anyway, that's for the question. However, the latest version of GAE (1.9.19 as of writing) has another problem with Spring:

[INFO] java.lang.NoClassDefFoundError: java.lang.reflect.Parameter is a restricted class. Please see the Google  App Engine developer's guide for more details.
[INFO]  at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:52)
[INFO]  at org.springframework.core.StandardReflectionParameterNameDiscoverer.getParameterNames(StandardReflectionParameterNameDiscoverer.java:53)
[INFO]  at org.springframework.core.PrioritizedParameterNameDiscoverer.getParameterNames(PrioritizedParameterNameDiscoverer.java:65)
[INFO]  at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:182)
[INFO]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1115)
[INFO]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)
[INFO]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
[INFO]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
[INFO]  at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
[INFO]  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
[INFO]  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
[INFO]  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
[INFO]  at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:706)
[INFO]  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:762)
[INFO]  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
[INFO]  at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
[INFO]  at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)

Upvotes: 0

qgicup
qgicup

Reputation: 2239

Why would you use Spring Boot on Gae? For security purpose, Rest features, dependency management etc.?

I found that GAE + Guice (dependency management by Google) + Shiro (security) + Objectify play really nice together. See this http://hackersv.blogspot.de/2014/02/shiro-guice-maven-and-google-app-engine.html for a nice introduction to this stack.

Upvotes: 0

Zig Mandel
Zig Mandel

Reputation: 19835

You cannot write to the filesystem in appengine. So no you can't run it unless you modify it. Some frameworks do have options to write somewhere else like blobstore/cloud storage.

Upvotes: 3

Related Questions