Creating WAR File

1,074 views
Skip to first unread message

Juan Sequeda

unread,
Sep 7, 2007, 5:34:40 PM9/7/07
to Google Web Toolkit
Hi

I know this has been talked about, but I just don't seem to be able to
do this. I followed all the steps in http://www.charisacademy.com/GWT/CreateWar.htm

What I don't know if I am doing right or wrong is "Add contents to a
zip file named {Project}.war" Does that mean that I should just zip it
and then change the extension to war? Or how then? I did that and
deployed it in Tomcat and it doesn't work.

Thanks for your help.

Chad Bourque

unread,
Sep 7, 2007, 5:40:51 PM9/7/07
to Google-We...@googlegroups.com
Juan,
 
When I do it, I create a zip file with max compression named with a .war extension and it works fine. I use WinRAR, but that shouldn't make a difference since it creates standard zip files.
 
Can be a little clearer as to how it doesn't work? What exactly isn't working? Are you redeploying an existing web app? If so, did you do a redeploy from the Tomcat manager?
 
Chad

 

Juan Sequeda

unread,
Sep 7, 2007, 5:51:09 PM9/7/07
to Google Web Toolkit
I did my app and ran it in the hosted mode and it works. This is my
first time trying to deploy it to Tomcat

So I followed the steps in your tutorial. I also used WinRAR, with
best compression and saved it as PROJECT_NAME.war

In the Tomcat manager I deployed the war file without a problem. When
I start it, I get an error:

FAIL - Application at context path /PROJECT_NAME could no be started

On Sep 7, 4:40 pm, "Chad Bourque" <chad...@gmail.com> wrote:
> Juan,
>
> When I do it, I create a zip file with max compression named with a .war
> extension and it works fine. I use WinRAR, but that shouldn't make a
> difference since it creates standard zip files.
>
> Can be a little clearer as to how it doesn't work? What exactly isn't
> working? Are you redeploying an existing web app? If so, did you do a
> redeploy from the Tomcat manager?
>
> Chad
>

> On 9/7/07, Juan Sequeda <juanfeder...@gmail.com> wrote:
>
>
>
>
>
> > Hi
>
> > I know this has been talked about, but I just don't seem to be able to
> > do this. I followed all the steps in
> >http://www.charisacademy.com/GWT/CreateWar.htm
>
> > What I don't know if I am doing right or wrong is "Add contents to a
> > zip file named {Project}.war" Does that mean that I should just zip it
> > and then change the extension to war? Or how then? I did that and
> > deployed it in Tomcat and it doesn't work.
>
> > Thanks for your help.
>

> --
> There are two types of people in the world:
> * Those who need closure

Chad Bourque

unread,
Sep 7, 2007, 6:10:01 PM9/7/07
to Google-We...@googlegroups.com
Juan,
 
Well, it could be various problems. When you created the war with WinRAR, did you set it to use the zip format or did you leave it at the default of rar format? I don't know if you can use the rar format or not as I've always used the zip format since it is my understanding that a war file is just a zip file under a different extension with a certain file/folder structure in it. Also, since you are trying to deploy a war file, I assume you are doing some RPC, right? Perhaps you can post the contents of your web.xml file so we can verify that it is correct.
 
HTH,
Chad

 

Jon Brisbin

unread,
Sep 7, 2007, 6:15:03 PM9/7/07
to Google-We...@googlegroups.com
Those instructions are definitely not how I deploy my GWT apps into
JBoss. I would think you'd need the WEB-INF folder to exist directly
under www/ though if your script src is relative and starts in the
same directory as your host html file (mine does not), then I suppose
it doesn't matter as much.

I finally got my GWT/JBoss integration worked out and I plan to post
on that when I get a chance to write it up.

Jon Brisbin
Portal Webmaster
NPC International, Inc.

Chad Bourque

unread,
Sep 7, 2007, 6:34:05 PM9/7/07
to Google-We...@googlegroups.com
Jon,
 
Those instructions are useful when deploying to Tomcat. I don't know if they work or fail on other web servers. Maybe I need to add a note to that effect.
 
Thanks,
Chad

 

Juan Sequeda

unread,
Sep 7, 2007, 6:47:28 PM9/7/07
to Google Web Toolkit
Hi

I was reading and another way to deploy the app is to create the
PROJECT_NAME folder in the Tomcat 5.5\webapps folder. And in the
PROJECT_NAME folder copy-paste all the compiled html and js. And in
the PROJECT_NAME folder, create WEB-INF. Inside WEB-INF I have

web.xml which is:

<?xml version="1.0" encoding="UTF-8"?>
<web-app>
<display-name>Ontobrowser</display-name>

<servlet>
<servlet-name>TreeServiceImpl</servlet-name>
<servlet-class>com.morphster.server.TreeServiceImpl</servlet-
class>
</servlet>

<servlet-mapping>
<servlet-name>TreeServiceImpl</servlet-name>
<url-pattern>/service</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>Ontobrowser.html</welcome-file>
</welcome-file-list>
<web-app>

And also I have 2 folders... lib which only has gwt-servlet.jar and
classes folder which has all my class files.

In conclusion.. the structure is

Tomcat
webapps
PROJECT_NAME
WEB-INF
web.xml
lib
gwt-servlet.jar
classes
com
project
client
server

When I do all of that, now PROJECT_NAME appears in the tomcat
applicatio manager. But when I click on start to deploy it, I get the
error:
FAIL - Application at context path /ontobrowser could not be started

And there I am

thanks for your help!!!!!!!!

On Sep 7, 5:34 pm, "Chad Bourque" <chad...@gmail.com> wrote:
> Jon,
>
> Those instructions are useful when deploying to Tomcat. I don't know if they
> work or fail on other web servers. Maybe I need to add a note to that
> effect.
>
> Thanks,
> Chad
>

> On 9/7/07, Jon Brisbin <jon.bris...@gmail.com> wrote:
>
>
>
>
>
> > Those instructions are definitely not how I deploy my GWT apps into
> > JBoss. I would think you'd need the WEB-INF folder to exist directly
> > under www/ though if your script src is relative and starts in the
> > same directory as your host html file (mine does not), then I suppose
> > it doesn't matter as much.
>
> > I finally got my GWT/JBoss integration worked out and I plan to post
> > on that when I get a chance to write it up.
>
> > Jon Brisbin
> > Portal Webmaster
> > NPC International, Inc.
>
> > On Sep 7, 2007, at 4:34 PM, Juan Sequeda wrote:
>
> > > Hi
>
> > > I know this has been talked about, but I just don't seem to be able to

> > > do this. I followed all the steps inhttp://www.charisacademy.com/


> > > GWT/CreateWar.htm
>
> > > What I don't know if I am doing right or wrong is "Add contents to a
> > > zip file named {Project}.war" Does that mean that I should just zip it
> > > and then change the extension to war? Or how then? I did that and
> > > deployed it in Tomcat and it doesn't work.
>
> > > Thanks for your help.
>

Chad Bourque

unread,
Sep 7, 2007, 6:57:40 PM9/7/07
to Google-We...@googlegroups.com
Juan,
 
I'm no expert in Java or web development, so I have to stick with what I know works. :) It appears that you did not export your project as a jar file. I believe if you follow all the steps on the website, it should work.
 
HTH,
Chad

 
On 9/7/07, Juan Sequeda <juanfe...@gmail.com> wrote:

Isaac Truett

unread,
Sep 10, 2007, 10:24:36 AM9/10/07
to Google-We...@googlegroups.com
> FAIL - Application at context path /ontobrowser could not be started

There should be a stack trace in the server log. Can you post that?

On 9/7/07, Juan Sequeda <juanfe...@gmail.com> wrote:
>

Reply all
Reply to author
Forward
0 new messages