Meaningless Drivel is fun!*
The moose likes EJB and other Java EE Technologies and the fly likes User upload files in to a cluster application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "User upload files in to a cluster application" Watch "User upload files in to a cluster application" New topic
Author

User upload files in to a cluster application

bengt hammarlund
Ranch Hand

Joined: Oct 17, 2003
Posts: 78
Hi people,

I�m facing a real problem here. I need users to upload files (images, album photos and other types) into a application deployed into a clustered server (Weblogic Server - Portal 8.1.6).

The thing is that I want to save the files directly into the file system. But if I am in a cluster, the user is uploading the file(s) into one physical machine. Is that a decent way of replicating the files uploaded? Maybe Weblogic itself has a way, but I can�t seem to figure it out by it�s documentation.

Thank�s for any replies.


<b><i>Bengt Hammarlund</i><br />� Sun Certified Java Programmer</b>
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You could persist them in a database. Alternatively, you could hunt for a JCA adapter to give you access to the file system from an EJB container.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
bengt hammarlund
Ranch Hand

Joined: Oct 17, 2003
Posts: 78
I think there is a way to share a storage device. Any ideias?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Writing anything to the File System is prohibited by the EJB specification. YOu can only safely write to a managed resource, such as a database.
Tong Wang
Ranch Hand

Joined: Jun 20, 2005
Posts: 44
You can do file upload in servlets. As a matter of fact, Struts provides support for file uploading and it's very easy to use.

As for shared storage device, my company's web server cluster (running Gentoo linux) is using one: all the user uploaded images are stored in that shared directory and if one web server goes down, the other server kicks in and takes over the shared folder. But unfortunately, I didn't set it up, so can't provide you with any more info.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: User upload files in to a cluster application