GWT App Deployed To Tomcat Displays Old Content

689 views
Skip to first unread message

KGD

unread,
Jan 23, 2012, 10:52:36 PM1/23/12
to Google Web Toolkit
Hi,
I am currently using Eclipse with GWT SDK 2.4.0 to develop a
GWT application. Inside Eclipse, I have tested my application to
ensure it pulls the dynamic content from a mysql database correctly.

I have deployed it to a local Tomcat 7 installaton and the
application war file deploys successfully. However, the page displays
the OLD hard-coded content which were merely placeholders.

The content that is displayed when I deploy the app to Tomcat
does not exist ANYWHERE in my source code as I removed it when I
changed the source to my database.

Again, the app works fine when using the embedded App Engine
for testing but real deployment to Tomcat continues to reflect old
content.

I have started/stopped Tomcat, cleared my browser cache,
manually deleted all files from the Tomcat webapps directory and still
it's the exact same.

There must be something that I'm missing and I'd appreciate
any help that is available.

Thanks,
KGD

StrongSteve

unread,
Jan 24, 2012, 10:41:22 AM1/24/12
to Google Web Toolkit
Delete the content of the Tomcat temp and work directory and restart
the Tomcat.

Greetings
Stefan

karim duran

unread,
Jan 24, 2012, 10:43:23 AM1/24/12
to google-we...@googlegroups.com
Hi KGD,

I met the same issue ( ...a day ago ....).
Remember that the Tomcat you use on your system is the same that Eclipse use.
Eclipse just uses a connector to the tomcat runtime.
So, there might many reasons :

1) first, when you deploy your WAR, you forget to allow "overwrite existing WAR" from
Eclipse export tool, and you still run the old WAR

2) stoping and starting Tomcat has no effect to the server session TLD cache
(not the browser cache ). Under Tomcat directory, you have a "work" directory with *.tld files.
Delete all these files and stop-restart tomcat many times, even if you have cleaned 
the webapps directory

3) you think you clean your browser cache but the browser didn't clean its cache 
( yes it happens)
Press many time F5, clean cache from menu, request the same JSP with Tomcat stopped
in order to really clean the browser cache

Tell me if it solves anything.

If not, we investigate more.

I hope it helps.

Regards.

Karim Duran

2012/1/24 KGD <keith....@gmail.com>
KGD

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


KGD

unread,
Jan 24, 2012, 8:31:03 PM1/24/12
to Google Web Toolkit
I have done the following:

- Deleted the $CATALINA_HOME\work
- Deleted the $CATALINA_HOME\temp
- Cleared the client browser cache
- Stopped / Restarted Tomcat several times
- With Tomcat stopped, made a call to my entry point page and received
the 404 error message
- Manually cleaned the webapps\<my app> directory from the local file
system

Still, the old content persists. Inside Eclipse, I am using the GWT
App Engine to test my application which I believe uses the Jetty app
server. My Tomcat instance is completely separate from Eclipse.

Any feedback is appreciated. I'm going to copy the project to a new
project and test under a differet webapp context and see if that
works.

Thanks,
Keith




On Jan 24, 10:43 am, karim duran <karim.du...@gmail.com> wrote:
> Hi KGD,
> *
> *
> 2012/1/24 KGD <keith.g.de...@gmail.com>

Peter Ginneberge

unread,
Jan 25, 2012, 2:34:19 AM1/25/12
to google-we...@googlegroups.com
$CATALINA_HOME\conf\Catalina\localhost

Look for an xml file with the same name as the war and remove it.
Restart tomcat.

KGD

unread,
Jan 25, 2012, 9:33:15 PM1/25/12
to Google Web Toolkit
Thank you for the reply. There is no xml file in the $CATALINA_HOME
\conf\Catalina\localhost directory with the same name as the war.

Additional steps taken in attempt to resolve:
- Copied Project into a Project2; ran successfully in App Engine and
it worked; deployed to Tomcat 7 and still shows old content under the
new Project2 webapp context.
- Installed Tomcat 6 and retested; same failure - old content
displayed.

I'm using the GWT Compile option from the Eclipse menu, is there any
other way to manually force a compile? There is no code in the app
for what is being displayed and this is now becoming a breaking point
on using GWT for a solution.

Any insight is appreciated.

Thanks,
KGD

Alan Chaney

unread,
Jan 26, 2012, 9:23:09 AM1/26/12
to google-we...@googlegroups.com
Are you deploying to tomcat as a war?

I re-read your earlier replies on the list and its not clear whether you
have a separate war or are deploying through eclipse.

Alan

KGD

unread,
Jan 26, 2012, 2:13:28 PM1/26/12
to Google Web Toolkit
Yes, I am deploying to my Tomcat installation as a war file. I use
Eclipse to test my code with the App Engine before packaging the war
and deploying on Tomcat.

Thanks,
Keith

Alan Chaney

unread,
Jan 26, 2012, 2:31:41 PM1/26/12
to google-we...@googlegroups.com
So if its deploying the wrong data, then that data must be in the war.

How are you building the war? ant? eclipse 'export' or simply zipping
the war folder?

Alan

KGD

unread,
Jan 26, 2012, 3:49:39 PM1/26/12
to Google Web Toolkit
That's right and that's why I'm perplexed.

In trying to resolve this, I unpacked the war file and decompiled the
class files and the code is the good/current code base for my app
which executes correctly in the App Engine development mode within
Eclipse.

Here are my steps for deployment of my code:
1. Select <Project> from the Eclips project tree
2. From the Eclipse menu bar, select the GWT | GWT - Compile Option
3. No errors during compilation
4. Select <Project> from the Eclipse tree and right-click and select
'Export'
5. Set the export location to be <Project>.jar in the war\WEB-INF\lib
\<Project>.jar
6. Using an ant build.xml, run as Ant Build; war file created
7. Using Tomcat Manager app, 'choose file' <Project>.war
8. Select Deploy
9. War file deployed, application context exists
10. Select app context and OLD CONTENT displayed.

I've opened the <project>.nocache.js file and it appears to reflect
what I think are the appropriate bindings for my rpc calls; definitely
more than static placement of values from original test deployment.

Thanks,
KGD

Alan Chaney

unread,
Jan 26, 2012, 4:01:16 PM1/26/12
to google-we...@googlegroups.com
Hmm...

Well, the next thing I'd try and do is take the war to a separate
machine, set TC 7 up on that, and then do a wget to
http://localhost:8080/<whatever your context name is> and see what's what.

From what you've said, it seems very unlikely that its anything to do
with GWT. Are you absolutely sure you don't have some proxy or something
thats caching what you had originally? If the war has the "right stuff"
in it, then you shouldn't be seeing anything else - if the war has the
old stuff still in it, then its your build process. Don't forget as
someone pointed out earlier that when you are running Tomcat with
Eclipse, by default the TC webapps dir is *NOT* in the actual TC
installation - its in ${workspace_loc}
.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/<your
context>

You can configure this from within Eclipse.

Regards

Alan

KGD

unread,
Jan 26, 2012, 10:13:52 PM1/26/12
to Google Web Toolkit
Thanks. I'll keep that in mind and will move to another server and
see. I already tried with a TC 6 install on the same host as the TC7
install (only one instance running at a time, though).

With regards to running TC with Eclipse, I think there may be a
misunderstanding. I'm not running TC within Eclipse for my
development testing. My TC instance is completely separate from
Eclipse. When I test within Eclipse, I'm using the GWT App Engine
which I believe is an embedded Jetty server.

I'll keep trying and I'm hoping that there's a flag or a process that
I'm missing but it doesn't make a lot of sense that the same process
to initially package and deploy the source doesn't pick up the new
changes. I have literally deleted the UI components from my rootPanel
class in the Designer and recompiled the project only to have it
reappear when I deploy outside of Eclipse.

Thanks,
KGD

On Jan 26, 4:01 pm, Alan Chaney <a...@mechnicality.com> wrote:
> Hmm...
>
> Well, the next thing I'd try and do is take the war to a separate
> machine, set TC 7 up on that, and then do a wget tohttp://localhost:8080/<whatever your context name is> and see what's what.

KGD

unread,
Jan 27, 2012, 9:34:39 AM1/27/12
to Google Web Toolkit
****RESOLVED****

When I created my custom GWT Project, the <project>.gwt.xml file did
not originally include a rename tag. In my development, I added that
tag AFTER I had already generated my initial test with my static
content. It appears that the rename attribute is read by the GWT
Compiler to generate the client side javascript and html files.
However, the original javascript and html files remained in the war
directory under the default path and were being packaged with my
webapp which included the unmodified entry point html file which
pointed to the old path and therefore the static content was being
displayed even though all of my java code was updated and packaged
correctly along with the new javascript and html files which existed
under the new path as indicated in my rename attribute.

Now, my project works both in the App Engine for development and when
I deploy to my external Tomcat instance. I don't understand why the
internal App Engine would find the new path for the javascript and
html but now they are both in sync which is what I needed.

Thanks to all who responded. I've learned a great deal through this
process and now have a much better understanding of GWT.

Thanks,
KGD
> > > 7. UsingTomcatManager app, 'choose file'<Project>.war
> > > 8. Select Deploy
> > > 9. War file deployed, application context exists
> > > 10. Select app context and OLDCONTENTdisplayed.
>
> > > I've opened the<project>.nocache.js file and it appears to reflect
> > > what I think are the appropriate bindings for my rpc calls; definitely
> > > more than static placement of values from original test deployment.
>
> > > Thanks,
> > > KGD
>
> > > On Jan 26, 2:31 pm, Alan Chaney<a...@mechnicality.com>  wrote:
> > >> So if its deploying the wrong data, then that data must be in the war.
>
> > >> How are you building the war? ant? eclipse 'export' or simply zipping
> > >> the war folder?
>
> > >> Alan
>
> > >> On 1/26/2012 11:13 AM, KGD wrote:
>
> > >>> Yes, I am deploying to myTomcatinstallation as a war file.   I use
> > >>> Eclipse to test my code with the App Engine before packaging the war
> > >>> and deploying onTomcat.
> > >>> Thanks,
> > >>> Keith
> > >>> On Jan 26, 9:23 am, Alan Chaney<a...@mechnicality.com>    wrote:
> > >>>> Are you deploying totomcatas a war?
> > >>>> I re-read your earlier replies on the list and its not clear whether you
> > >>>> have a separate war or are deploying through eclipse.
> > >>>> Alan
> > >>>> On 1/23/2012 7:52 PM, KGD wrote:
> > >>>>> Hi,
> > >>>>>            I am currently using Eclipse with GWT SDK 2.4.0 to develop a
> > >>>>> GWT application.  Inside Eclipse, I have tested my application to
> > >>>>> ensure it pulls the dynamiccontentfrom a mysql database correctly.
> > >>>>>            I have deployed it to a localTomcat7 installaton and the
> > >>>>> application war file deploys successfully.  However, the page displays
> > >>>>> the OLD hard-codedcontentwhich were merely placeholders.
> > >>>>>            Thecontentthat is displayed when I deploy the app toTomcat
> > >>>>> does not exist ANYWHERE in my source code as I removed it when I
> > >>>>> changed the source to my database.
> > >>>>>              Again, the app works fine when using the embedded App Engine
> > >>>>> for testing but real deployment toTomcatcontinues to reflect old
> > >>>>>content.
> > >>>>>              I have started/stoppedTomcat, cleared my browser cache,
> > >>>>> manually deleted all files from theTomcatwebapps directory and still
Reply all
Reply to author
Forward
0 new messages