Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Setting up Tomcat to run jsp/servlet's from USB keychain

Reply
Thread Tools

Setting up Tomcat to run jsp/servlet's from USB keychain

 
 
DiscoStu
Guest
Posts: n/a
 
      09-01-2004
Thats right,

I've got this client program that runs as a series of JSP pages
and a few servlets. I want to distribute just my web application on
the keychains, and then have Tomcat5 installed on all the machines
that will run the client program. I know I can setup a Tomcat context
to point to a directory OTHER then in the /webapps folder. So I want
to point to my webapp stored on the keychain drive, but when Tomcat
loads the keychain wont be attached so it wont be able to load that
context on startup. If a user plugs his/her keychain drive in and the
directory then becomes valid, will tomcat know enough to then load-up
the context? (Does it rescan the server.xml file, like it does the
web.xml files?)

Also, what would be the consequences of having the user pull out the
keychain drive, thus making the web application unavailable to Tomcat.
Will tomcat be able to recognize and gracefully handle that?

Thanks everyone,

Greg
 
Reply With Quote
 
 
 
 
Murray
Guest
Posts: n/a
 
      09-02-2004

"DiscoStu" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Thats right,
>
> I've got this client program that runs as a series of JSP pages
> and a few servlets. I want to distribute just my web application on
> the keychains, and then have Tomcat5 installed on all the machines
> that will run the client program. I know I can setup a Tomcat context
> to point to a directory OTHER then in the /webapps folder. So I want
> to point to my webapp stored on the keychain drive, but when Tomcat
> loads the keychain wont be attached so it wont be able to load that
> context on startup. If a user plugs his/her keychain drive in and the
> directory then becomes valid, will tomcat know enough to then load-up
> the context? (Does it rescan the server.xml file, like it does the
> web.xml files?)
>
> Also, what would be the consequences of having the user pull out the
> keychain drive, thus making the web application unavailable to Tomcat.
> Will tomcat be able to recognize and gracefully handle that?
>
> Thanks everyone,
>
> Greg


I doubt very much any of that will work in the way you want. Tomcat doesn't
rescan the server.xml for changes, and doesn't automagically retry to load
contexts after they fail. However, it does monitor the webapps directory and
will hot-deploy a new app if it finds one.

Instead of defining the Context in server.xml, you can use a separate xml
descriptor which might look something like this

<Context path="/whatever" docBase="E:/myProject/war" debug="0"
reloadable="true">
<Loader reloadable="true" checkInterval="5"/>
</Context>

When the USB drive is connected, you could run a script that copies this XML
descriptor into the tomcat/webapps dir. Tomcat will detect the change and
deploy the app from the USB drive

As for removing the key, Tomcat will actually crash. I just tried it myself.
The entire server shuts down.


 
Reply With Quote
 
 
 
 
dan
Guest
Posts: n/a
 
      10-01-2004
"Murray" <(E-Mail Removed)> wrote in message news:<wuuZc.16220$(E-Mail Removed)>...
> "DiscoStu" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
> > Thats right,
> >
> > I've got this client program that runs as a series of JSP pages
> > and a few servlets. I want to distribute just my web application on
> > the keychains, and then have Tomcat5 installed on all the machines
> > that will run the client program. I know I can setup a Tomcat context
> > to point to a directory OTHER then in the /webapps folder. So I want
> > to point to my webapp stored on the keychain drive, but when Tomcat
> > loads the keychain wont be attached so it wont be able to load that
> > context on startup. If a user plugs his/her keychain drive in and the
> > directory then becomes valid, will tomcat know enough to then load-up
> > the context? (Does it rescan the server.xml file, like it does the
> > web.xml files?)
> >
> > Also, what would be the consequences of having the user pull out the
> > keychain drive, thus making the web application unavailable to Tomcat.
> > Will tomcat be able to recognize and gracefully handle that?
> >
> > Thanks everyone,
> >
> > Greg

>
> I doubt very much any of that will work in the way you want. Tomcat doesn't
> rescan the server.xml for changes, and doesn't automagically retry to load
> contexts after they fail. However, it does monitor the webapps directory and
> will hot-deploy a new app if it finds one.
>
> Instead of defining the Context in server.xml, you can use a separate xml
> descriptor which might look something like this
>
> <Context path="/whatever" docBase="E:/myProject/war" debug="0"
> reloadable="true">
> <Loader reloadable="true" checkInterval="5"/>
> </Context>
>
> When the USB drive is connected, you could run a script that copies this XML
> descriptor into the tomcat/webapps dir. Tomcat will detect the change and
> deploy the app from the USB drive
>
> As for removing the key, Tomcat will actually crash. I just tried it myself.
> The entire server shuts down.



I am working on a similar task, and was wondering the following.

When I set my

<Context path="/whatever" docBase="E:/" debug="0"
reloadable="true"></Context>

And E: is the drive my USB key is in, everything works fine. Now in
some instances the webapps reside on a computer that I have mapped a
drive to. say drive W: When I set my context as

<Context path="/whatever" docBase="W:/" debug="0"
reloadable="true"></Context>

And try to view the pages, ( after restarting tomcat 5.x with the
drive already mapped ) i get a HTTP 404 error. And the log states it
is an invalid path, or no read access. Any idea what is causing this?
I can view the files fine through the mapped drive. ( also tried the
UNC path i.e. //servername/apps, still didn't work )
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Innovage Photo keychain p4o2 Computer Support 0 01-03-2008 04:29 PM
Keychain Digital Photo Viewer that works with MacOS X. mgrahm@trib.com Digital Photography 1 11-09-2006 06:55 PM
best/easy way to encrypt USB keychain drive Mike245 Computer Support 3 09-27-2004 12:47 PM
Sample Photos from BenQ DC1300 and 300K Mini Digital Keychain Camera Robert J Batina Digital Photography 0 04-04-2004 05:20 PM
Anybody got one of these keychain cameras? Duane Morin Digital Photography 1 12-27-2003 01:32 AM



Advertisments