Guys, while it's interesting discussing accessing files thru EJBs, I have found it to be VERY slow, at least for this practical application. Basically, you're going to load the whole file into memory and pass it around to the web layer? Most of the PPTs I use are about 500KB-1000KB in size, at least the ones below 20 slides. 50 concurrent clients and you're using 50 MB or more you don't actually need to use, and worse yet, 50 MB that need almost inmediate garbage collection. A guy keeping F5 pressed in Explorer and your cluster goes down in flames(funny, OutOfMemoryError, being an Error, is fatal to app servers; respawning takes time, measured in minutes for Weblogic, for instance).
I'd think that for Yogaraj's needs, a simple servlet will do. It should locate the file repository, then using a parameter locate the file within the repository, write the appropiate headers (specially the correct mime-type) and dump the file into the Response outputstream. Making the Servlet a filter makes the process even easier. My 2c, Juan Pablo Lorandi Chief Software Architect Code Foundry Ltd. [EMAIL PROTECTED] Barberstown, Straffan, Co. Kildare, Ireland. Tel: +353-1-6012050 Fax: +353-1-6012051 Mobile: +353-86-2157900 www.codefoundry.com > -----Original Message----- > From: A mailing list for Enterprise JavaBeans development > [mailto:[EMAIL PROTECTED]] On Behalf Of John Harby > Sent: Tuesday, December 10, 2002 2:10 PM > To: [EMAIL PROTECTED] > Subject: Re: File Reading! > > > I like the JMX approach. But don't you want to have the EJB > find the JMX MBeanHome using JNDI and then make request the > file? There is an example of this here: > > http://edocs.bea.com/wls/docs61/jmx/basics.html > > > >From: Ian Vellosa <[EMAIL PROTECTED]> > >Reply-To: [EMAIL PROTECTED] > >To: [EMAIL PROTECTED] > >Subject: Re: File Reading! > >Date: Tue, 10 Dec 2002 08:43:44 +0000 > > > >Firstly, as your aware EJB's are not supposed to have any IO > access to > >the file system. So this makes things fun! > > > >I have been thinking about a similar issue. My plan is to > build a small > >component that will probably be managed with JMX which sits on the > >machine that will hold the files. The EJB can then open a socket > >connection to this small file server program and request > files that can > >then be sent out through the front end. > > > >You can have some database meta information about the files that you > >store, which will include the file server that is holding the file. > >this should allow for multiple file servers. > > > >This will also allow for multiple application servers > (cluster) to all > >access the same file stores. > > > >I'm sure that there are some flaws with this plan too so, > I'm waiting > >to hear from some more experianced guys ;) > > > >regards > >IV > > > > > > > from: "Jayaprakasam, Yogaraj (Cognizant)" > ><[EMAIL PROTECTED]> > > > date: Tue, 10 Dec 2002 08:10:57 > > > to: [EMAIL PROTECTED] > > > subject: Re: File Reading! > > > > > > Hello All, > > > My project as an requirement to publish different type of files > > > (Word,Excel,PPT,zip etc) on the web. Our web page should > have a link > > > to those files on click of it, the Corresponding files must be > > > opened either on the web page or downloaded > >to > > > the client machine and facilitate the user to read it. But our > > > problem > >is > > > either our files may eventually be residing on a separate file > > > server or > >on > > > the same machine, where our web server will be running. > Here, if our > >files > > > are going to be residing on a different machine, we can > either make > > > the network mapping and create on virtual directory for > that folder > > > and give > >the > > > link on our browser to allow the user to open those files on the > > > same browser or we can read the content of the file and > push it to > > > the > >browser. > > > The first point is ok, if our client allows us to create a virtual > >directory > > > to the file server. If that is ruled out then I need to go to the > > > file reading. Now, my questions is, is there any such component > > > available > >already > > > out there which will be as efficient as the webserver virtual > > > mapping > >and > > > serve the same purpose? > > > Can you guys please throw some light on this? > > > Expecting your valuable suggestions in this regard. > > > > > > Regards, > > > Yogaraj > > > > > > > > > >============================================================= > ========== > >==== > >To unsubscribe, send email to [EMAIL PROTECTED] and > include in the body > >of the message "signoff EJB-INTEREST". For general help, > send email to > >[EMAIL PROTECTED] and include in the body of the message "help". > > > _________________________________________________________________ > Protect your PC - get McAfee.com VirusScan Online > http://clinic.mcafee.com/clinic/ibuy/campaign.> asp?cid=3963 > > > > ============================================================== > ============= > To unsubscribe, send email to [EMAIL PROTECTED] and > include in the body of the message "signoff EJB-INTEREST". > For general help, send email to [EMAIL PROTECTED] and > include in the body of the message "help". > > =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
