Problem with Playframework + Tomcat

I am trying to deploy a web application developed in the Tomcat gaming environment. The first few times when I tried, I received the following message in the Tomcat console,

INFO: validateJarFile(C:\Tomcat7\webapps\sandbox.war\WEB-INF\lib\geronimo-servlet_2.5_spec-1.2.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 

So, I manually deleted geronimo-servlet_2.5_spec-1.2.jar from the war game file. And once this is done, I see the following success message,

 13:56:43,571 INFO ~ Starting C:\Tomcat7\webapps\sandbox.war\WEB-INF\application 13:56:43,618 INFO ~ Application is precompiled 13:56:44,149 INFO ~ Connected to jdbc:mysql://localhost/db?useUnicode=yes&ch aracterEncoding=UTF-8&connectionCollation=utf8_general_ci 13:56:44,899 INFO ~ Application 'play-sandbox' is now started ! 

When I try to access the application from IE using the url http: // localhost: 8080 / play-sandbox , I get a 404 message saying: "The requested resource (/ play-sandbox /) is unavailable."

I run this on Tomcat 7 and the tomcat logs are clear. I use

  play war play-sandbox -o sandbox.war 

to create war

Questions:

  • How to prevent geronimo-servlet_2.5_spec-1.2.jar conflict?
  • Why can't I view the application through a browser in a Tomcat deployment? Where, as a game launcher, {app name} everything works fine.

    The same war file seems to work fine on the Glassfish server. I believe this has something to do with the contextual path of the playframework application or the isolation of the application. Any help would be appreciated.

Thanks Abi

+4
source share
2 answers

Have you tried an earlier version of Tomact? According to the deployment matrix, Play does not β€œofficially” support Tomact 7, so this 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 run the play run appname , and not when deployed via tomcat, the deployment is completely different. Play does not comply with Java EE. He decided not to go down the route of the special services of the servlets, because he thought that he was too complicated, bloated and limited where they want to play Play. That's why you don’t have things like Session and other core Java EE features.

Therefore, in order to get Play to work in the Servlet container, you need to wrap the Play application in a wrapper that provides the application as a Servlet-compatible application and move all this to a WAR file. However, you lose some of the features of the standard Play app.

Play Devs, and in this regard, I recommend always using the Play application server to maximize the use of your application and facilitate deployment, if possible!

+2
source

At first I had the same problem as you did when I deployed the playapp for Tomcat 7, but then I started working:

  • Yes, you need to manually remove the geronimo-servlet_2.5_spec-1.2.jar library.
  • The cause may be an additional error that has nothing to do with the first problem. Go to the log file <tomcat> /logs/catalina.out, as well as the file <tomcat> / logs / localhost. <date> .log! In my case, it was the missing JDBC library. I added the missing library to the / lib play directory, recreated the war file, deleted geronimo-servlet_2.5_spec-1.2.jar again, and after that my application worked under Tomcat 7.0.25
+1
source

All Articles