WAR issues with play 1.2.3

322 views
Skip to first unread message

Mark S

unread,
Oct 20, 2011, 9:15:57 PM10/20/11
to play-fr...@googlegroups.com
I have a couple of issues with the play war command (at least with Play! v1.2.3).


ISSUE #1

I understand that the war command creates an exploded war file.  This should be able to be deployed into an application server, such as Tomcat, which is what I'm using.  However, when I place the exploded war into the webapps directory for Tomcat, the Tomcat instance crashes, and I get the following messages in Tomcat's log:

Oct 20, 2011 6:52:53 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/Library/Tomcat/webapps/api/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
Oct 20, 2011 6:52:53 PM play.Logger fatal
SEVERE: Cannot read application.conf
Oct 20, 2011 6:52:53 PM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Oct 20, 2011 6:52:54 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina


I'm not sure what the issues is there with geronimo-servlet_2.5_spec-1.2.jar.  But it does look like it can't read application.conf.  When I then look in the exploded war, it seems more empty than it should.  For example, the application and classes directories are completely empty.  The application.conf file is nowhere to be found in the exploded war either.  The same thing happens when I zip the war file myself using "jar cvf api.war ." (I'll explain why I have to zip them myself in the next paragraph).  I place the .war file in the webapps directory, it then tries to deploy it, so it explodes the .war and then crashes again with the same messages.  I don't understand why this happens as Play! should be packaging everything correctly itself.


ISSUE #2 

If I try to use the --zip flag with play war to have play zip the file for me, I get a .war file that is all of about 20-30 bytes in size, depending on the application.  This is obviously not correct and completely useless.

Is everything dealing with war broken in v1.2.3?  I've had this same issue with a couple of applications.  It would be great to find a solution.  Any help would be so greatly appreciated.

Mathieu

unread,
Oct 21, 2011, 3:54:53 AM10/21/11
to play-framework
Same issue #1 here with v1.2.3

On 21 oct, 03:15, Mark S <schultz.m...@gmail.com> wrote:
> I have a couple of issues with the play war command (at least with Play!
> v1.2.3).
>
> *ISSUE #1*
> *ISSUE #2*

Mark S

unread,
Oct 21, 2011, 11:40:21 AM10/21/11
to play-fr...@googlegroups.com
And to clarify, I'm using Tomcat 6, which is explicitly stated as being supported by v1.2.3.  I tried it on Tomcat 7 first, to no avail, so I switched to 6 thinking that the issue was just that 7 was not yet supported.

Guillaume Bort

unread,
Oct 21, 2011, 12:19:05 PM10/21/11
to play-fr...@googlegroups.com
It should just work. The related problem seems to be:

SEVERE: Cannot read application.conf

You should have an application.conf in WEB-INF/application/conf/

Can you check?

> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/2HQiw2PhsewJ.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.
>

--
Guillaume Bort, http://guillaume.bort.fr

Mark S

unread,
Oct 21, 2011, 12:26:11 PM10/21/11
to play-fr...@googlegroups.com
Yes, as I said, the application directory is completely empty, as is the classes directory.  Perhaps I should have specified that I was referring to WEB-INF/application and WEB-INF/classes.  Both are empty.  There are no files or directories in either of those directories.  The application.conf file does exist in the project though.  And the project can be run using play run without issues.

Dominik Dorn

unread,
Oct 23, 2011, 3:01:30 PM10/23/11
to play-fr...@googlegroups.com
does the generated war file (just unzip it) contain the
application.conf file and libs?

> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/play-framework/-/0whSirKso4sJ.


> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.
>

--
Dominik Dorn
http://dominikdorn.com
http://twitter.com/domdorn

Skripten, Mitschriften, Lernunterlagen, etc. findest Du auf
http://www.studyguru.eu !

Mark Schultz

unread,
Oct 23, 2011, 3:13:30 PM10/23/11
to play-fr...@googlegroups.com
Doubtful since the .war file is only about 20 bytes. If it did, that would be all that it could contain. I'll check tomorrow though.

Sent from my iPhone

Dominik Dorn

unread,
Oct 23, 2011, 3:58:56 PM10/23/11
to play-fr...@googlegroups.com
if you run the war command, lets say

play war -o /tmp/test

does /tmp/test/WEB-INF/ contain any files?
how big is the generated folder?

du -skh /tmp/test

Mark Schultz

unread,
Oct 23, 2011, 5:30:41 PM10/23/11
to play-fr...@googlegroups.com
The generated exploded war is 29 mb. WEB-INF contains: application, framework, resources, classes, lib, web.xml. application and classes are both empty.

Sent from my iPhone

Mark S

unread,
Oct 24, 2011, 4:50:37 PM10/24/11
to play-fr...@googlegroups.com
It seems the issue is related to running the command inside of a Jenkins workspace.  If I copy the files from the workspace to a directory outside of the workspace, the command works just fine, even with the --zip flag.  I don't understand at all, but oh well!

sas

unread,
Oct 24, 2011, 11:22:08 PM10/24/11
to play-framework
the play war command just executes /play/framework/pym/play/utils.py -
> package_as_war

if you have courage, you may try debugging it (you know, just put some
good old print xxx stuff...) to find out what's going on

line 126 should do the trick

copy_directory(os.path.join(app.path, 'conf'), os.path.join(war_path,
'WEB-INF/classes'))

saludos

sas
Reply all
Reply to author
Forward
0 new messages