Re: Tomcat app re-deploying is removing symbolic links

Discussion in 'Java' started by Juha Laiho, Jul 20, 2004.

  1. Juha Laiho

    Juha Laiho Guest

    [moving the thread to comp.lang.java.programmer]

    (BrianM) said:
    >Is there any way tomcat can be told what folders to remove when
    >redeploying an application.


    As I understand it, redeploying means: clean up everything in the
    webapp and replace with new. I'd be surprised if I saw an incomplete
    cleanup. Also, the webapp directory should be considered the sole
    domain of the application server -- do not touch anything within it
    manually.

    >I set up symbolic links from directories containing critical files
    >outside of tomcat into a tomcat web application.

    ....
    >My problem is, when I redeploy the tomcat web application, the data
    >contained in the symbolic link folders also gets removed.


    As you write in clj.databases group, I guess your information is
    database connection info. As for reaching beyond the symlinks, note
    that Tomcat also runs on platforms that don't have symlinks - so
    it is reasonable that it doesn't understand the concept, but sees
    them as simple directories/files.

    >Any ways around this?


    Redesign. Write your app in some such way that you don't need the symlinks,
    yet giving your app some way to access info outside the webapp tree.
    F.ex. a class (f.ex. servlet to be loaded on container startup) that
    reads from somewhere (system property, servlet init parameter, ...)
    the directory name in which the critical data is, and loads the data.
    Other classes needing this data can then access the data just by querying
    from this servlet. More sophisticated ways would be use of JDBC (if your
    Tomcat version is recent enough).


    This is actually something I've been pondering for quite some time --
    how to pass information about the application environment (f.ex.
    database connection info) into the application, preferably so that
    the application deployer doesn't need to touch the .war file (or the
    webapp directory), and the above means are what I've come up with.

    How are others tackling this issue?
    --
    Wolf a.k.a. Juha Laiho Espoo, Finland
    (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
    PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
    "...cancel my subscription to the resurrection!" (Jim Morrison)
    Juha Laiho, Jul 20, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim
    Replies:
    4
    Views:
    6,977
  2. Nick Howes
    Replies:
    6
    Views:
    559
    Toby A Inkster
    Nov 24, 2003
  3. pekka.niiranen
    Replies:
    0
    Views:
    255
    pekka.niiranen
    Feb 10, 2004
  4. mp
    Replies:
    24
    Views:
    812
    Floyd L. Davidson
    May 3, 2006
  5. humbleaptience

    Accessing Symbolic Links on Unix File Shares

    humbleaptience, Feb 1, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    301
    humbleaptience
    Feb 1, 2007
Loading...

Share This Page