• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat Web App - Strange issue. Requires 2 restart for SSO mode to work

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a small web application deployed on Tomcat server and is is working pretty fine, except in one mode. The web application is available through 2 modes of links - one is regular and other is Single Sign On based.

Here is the sample directory structure:
Tomcat
webapps
MyApp
WEB-INF
web.xml
jsp
myapp.jsp
MyApp.war
bin
logs
conf
web.xml

Deployment Procedure:
Stop the server
Copy the new war to webapps replacing the old one
remove the complete diretcory of MyApp recursively (rm -rf MyApp)
start the server

Issue:
We try both the links of application. The normal one works just fine first time itself. The SSO link shows up the directory listings page of webapps directory showing the MyApp.war and MyApp directory link.
Now all we need to workaround this is just stop the server again and then start it. Surprisingly both SSO mode link and normal works totally fine.
This is recurring problem. Is there a proper permanent fix to this?

Please note the web.xml in Tomcat/conf directory has below
<servlet>
<servlet-name>default</servlet-name>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

Please note the web.xml in Tomcat/webapps/MyApp/WEB-INF directory has below
<welcome-file-list>
<welcome-file>myapp.jsp</welcome-file>
</welcome-file-list>

The application has only myapp.jsp and none of index.* files

myapp.jsp is as below
<html><head><META URL=<%=request.getContextPath()%>/who.do"></head><body/></html>

Somehow first time when new war is deployed, old exploded diretcory is deleted and server is started, the Tomcat might not be finding xcard.jsp or the application specific web.xml and hence it is listings the directory based on settings in Tomcat/conf/web.xml
Second time however it finds the web.xml and xcard.jsp and hence works.

We even tried changing deployment procedure not to delete the exploded directory and rest of steps same. But it does not help either. If we drop the new war while the server is running, it does not take the changes in new war.
 
Their achilles heel is the noogie! Give them noogies tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic