Playframework + Tomcat Deployment issue

后端 未结 2 1888
借酒劲吻你
借酒劲吻你 2021-01-13 18:27

I am trying to deploy a web app developed in play framework in Tomcat. The first few times I tried, I got the following message in the Tomcat console,

INFO:          


        
相关标签:
2条回答
  • 2021-01-13 18:53

    Have you tried an earlier version of Tomact? According to the deployment matrix, Play does not 'officially' support Tomact 7, so that may be part of the problem. See here http://www.playframework.org/documentation/1.2.1/deployment

    As for why the application works when you do play run appname and not when you deploy through tomcat, is that the deploment is completely different. Play is not a Java EE compliant framework. It chose not to go down the Servlet spec route, as it felt it was too complicated, bloated and restricted where they wanted to take Play. This is why you don't have things like the Session and other Java EE core functions.

    Therefore, to get Play to work in a Servlet container, it is required to wrap the Play application in a wrapper that exposes the application as a Servlet compliant application, and move it all into a WAR file. You do however lose some of the features of a standard Play application.

    The Play Devs, and I for that matter, would recommend always using the Play application server to get the most out of your application and to ease the deployment, if possible!

    0 讨论(0)
  • 2021-01-13 18:57

    First I had the same problem like you when I deployed a play webapp to Tomcat 7, but then I got it running:

    1. Yes, you have to manually remove the geronimo-servlet_2.5_spec-1.2.jar library
    2. The reason might be an additional error that has nothing to do with the first problem. Please look into the <tomcat>/logs/catalina.out log file and also into the <tomcat>/logs/localhost.<date>.log file! In my case it was a missing JDBC library. I added the missing library to the play applications /lib directory, recreated the war file, again removed the geronimo-servlet_2.5_spec-1.2.jar and after that my application worked under Tomcat 7.0.25
    0 讨论(0)
提交回复
热议问题