0

I am running Magnolia CMS on a tomcat 7, I would like to leverage Googles App Engine(GAE). From googles documentations i understand that it is enough to include the GAE plugin to my root pom.xml within the build tags, see below:

<plugin>
    <groupId>com.google.appengine</groupId>
    <artifactId>appengine-maven-plugin</artifactId>
    <version>1.9.31</version>
</plugin>

In Googles documentation it states that I also have to add appengine-web.xml in my WEB-INF folder which i did - not sure if its even getting picked up...

Google states that to start the application you need to execute mvn appengine:devserver and to upload it to google mvn appengine:update.

When i atempted to use these commands mvn appengine:devserver and mvn appengine:update i get failures .....also im not sure im supposed to run them considering my existing setup

[INFO] Initializing Log4J
[INFO] Initializing Log4J from [WEB-INF/config/default/log4j.xml]
[INFO] 2016-02-07 21:08:47,159 ERROR info.magnolia.init.MagnoliaServletContextListener : Oops, Magnolia could not be started
[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:52)
[INFO]  at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
[INFO]  at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:207)
[INFO]  at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
[INFO]  at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
[INFO]  at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:295)
[INFO]  at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)

Some points to note, project has many maven modules, only one module needs GAE. Project is running Java 8. Feature in GAE needed is Task Queue API. Eclipse version is Luna 4.4.1. Magnolia version 5.4.3. Tomcat is started from within eclipse in server configuration

Question: what is the right approach to making these two systems talk to each-other, so i can leverage GAE capabilities in my already existing project running on tomcat?

zalis
  • 1,191
  • 1
  • 11
  • 20
  • you probably forgot to include text of this failures – Igor Artamonov Feb 07 '16 at 13:05
  • Thanks Igor, updated now! – zalis Feb 07 '16 at 13:13
  • it's says that `FileOutputStream is a restricted class`. you cannot access filesystem on app engine in any way. seems that your log4j is configured to write logs to fs, you should use stdout instead. or also you could switch to mangedvm – Igor Artamonov Feb 07 '16 at 13:17
  • Thanks Igor, my application is actually using slf4j logger by default, i believe app engine is introducing apache.log4j. Please note that the above steps are the only things that i have done so far in regards to importing GAE – zalis Feb 07 '16 at 13:22
  • app engine is using jdk logger (it also means that it's better for you to use slf4j-jdk14 bridge) – Igor Artamonov Feb 07 '16 at 13:34
  • From the [docs](https://cloud.google.com/appengine/docs/java/gettingstarted/setup): *"If you have Java 8, you must specify Java 7 as the source and the target...This will result in an application you can deploy and run on production App Engine, since the production instances are Java 7"*. You could star [this issue](https://code.google.com/p/googleappengine/issues/detail?id=9537). – tx802 Feb 07 '16 at 17:47
  • Thanks tx802 :) What if i can't my application on app engine? My application needs to be deployed on tomcat 7 – zalis Feb 08 '16 at 00:51
  • You could look into a Managed VM [custom runtime](https://cloud.google.com/appengine/docs/managed-vms/custom-runtimes) as a way to run Java 8. I've not tried it but it may help you. – tx802 Feb 08 '16 at 15:41

0 Answers0