Is it possible to deploy Java Servlet for GAE?

Is it possible to deploy a Java servlet in GAE, or should the server be located elsewhere?

+2
source share
2 answers

Short answer: Yes

Slightly long answer:

App Engine uses the Jetty servlet container to host applications and supports the Java Servlet 2.4 API. Keep in mind that there are quite a few restrictions that you must observe ( source ):

  • App Engine launches Java 6, but does not provide all Java classes; for example, Swing and most AWT classes are not supported.
  • You cannot use Threads or frameworks that use Threads.
  • You cannot write to the file system.
  • You can only read files that are part of your application.
  • The specific actions of "java.lang.System", for example. gc () or exit () will not do anything.
  • You cannot call JNI code.
  • Reflection is possible for your own classes and standard Java classes, but you cannot use reflection to access other classes outside of your application.
  • The servlet should respond within 30 seconds or com.google.apphosting.api.DeadlineExceededException .
  • See here for the Java classes listed in the whitelist.

Be sure to read The Sandbox to see examples of what will and will not work.

+9
source

You can deploy the base servlet to GAE, but there are additional things you need to do for GAE to accept it.

I would highly recommend a quick web search on this topic. You will find that there are tons of resources for this, including documentation on the GAE website itself.

+1
source

Source: https://habr.com/ru/post/908272/


All Articles