tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Accessing USB drive content from pages served from tomcat6 server
Date Fri, 06 Apr 2012 15:40:51 GMT
Hash: SHA1


On 4/4/12 12:23 AM, wrote:
> I have a NPAPI plugin which gets a notification from my middleware 
> whenever a USB MSD device is connected to the system. The HTML
> page which loads the plug-in then plays the Media
> (audio/video/pictures) that are present in the USB drive. This html
> page is served from a local tomcat server (the same PC to which the
> USB MSD device has been connected). To enable access to USB Device
> from the HTML page (served from tomcat6 server), I have added
> following lines in /etc/tomcat6/server.xml (in Ubuntu 10.10):
> <Context path="/usb_0" docBase="/media/WCF/usb_0/"/>

So, first, you shouldn't put <Context> in server.xml. Search the
archives and read the Tomcat User Guide for many reasons why not. Léa
has the proper prescription for how to deploy a context outside of
your appBase.

> When I am pluggin in the first USB device (which is mounted at 
> /media/WCF/usb_0), I am able to access the device content from my 
> HTML page (served from my tomcat6 server ) but when I am
> connecting the second USB device which is mounted at
> /media/WCF/usb_1, I am not able to access its content.

What do you mean "not able to access its content"? Do you get 404s?
500s? Does the thread hang? Does the JVM crash?

Tomcat caches certain information about the contexts it deploys. I
suspect that by removing the webapp's docBase (or suddenly having it
appear out of nowhere when a USB device is connected) is surprising to
say the least.

> In the browser when I am trying to check the content of 
> http://localhost:8080/usb_1/ by typing the URL in the address bar,
> I am getting error resource not available. For usb_0, I am able to
> see the resources.

Does usb_0 always work and usb_1 never works? What happens when both
devices are connected *before* you start Tomcat? What about when
neither of them are connected beforehand? What about starting Tomcat
with no USB devices, then trying to access the resources, then
attaching the devices and trying again?

All of those things would be good to know in order to help you out.

Honestly, I'm not sure why you'd want to run a web server off a device
which isn't guaranteed to be available.

- -chris
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools -
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message