Hello Chris, Thanks a lot for responding to my post.
[Chris]What do you mean "not able to access its content"? Do you get 404s? 500s? Does the thread hang? Does the JVM crash? [Souvik]: When I am trying to access the content of usb_1, I am getting 404 error. Here are the details: HTTP Status 404 message < This is blank> description The requested resource () is not available. [Souvik] [Chris]Q:What about starting Tomcat with no USB devices, then trying to access the resources, then attaching the devices and trying again? Ans: Only usb_0 works. [Chris]Q:What happens when both devices are connected *before* you start Tomcat? Ans: Only in this case I could access both the devices. [Chris] Honestly, I'm not sure why you'd want to run a web server off a device which isn't guaranteed to be available. [Souvik] Actually I am developing a HTML5 App which would run on an embedded target. One of the functionalities of the application is to allow user to playback and browse the media content available in an USB stick. Since I am using Webkit browser so some features of HTML5 do not run from file:// url and therefore the pages need to be served from a local web server. I have chosen tomcat for that. So it seems to achieve my goal, I need to first connect usb sticks to all the available usb ports on my target and then start tomcat6. As mentioned by you,is the server keeping this information in the cache so that in future when a USB device is connected to a port, it is able to make that out? Is this understanding correct? Regards, Souvik ________________________________________ From: Christopher Schultz [ch...@christopherschultz.net] Sent: Friday, April 06, 2012 9:10 PM To: Tomcat Users List Subject: Re: Accessing USB drive content from pages served from tomcat6 server -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Souvik, On 4/4/12 12:23 AM, souvik.da...@wipro.com 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 -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk9/DoMACgkQ9CaO5/Lv0PBfAACfVXlHAj4e5uNvBdXCZr2tkb+W WhgAn29GaUK25ShtOA4J0nvpGMgMPhRU =MQjC -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org