Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / JavaBeans / June 2005

Tip: Looking for answers? Try searching our database.

File I/O with EJBs

Thread view: 
exquisitus - 11 May 2005 11:09 GMT
I need to access files from an EJB (I know this is against the EJB spec
but I cannot blob th files and store in a database [for example]- for
various reasons too long to list here). The (gzipped) files are stored
in a directory system off of a root directory. I am thinking of using
JNDI to locate the files, using my own naming system to navigate the
directory structure and then use JMS to send the requested data to the
requestor EJB.

Is this a reasonable (i.e. good) design?. Am I overlooking anything, are
there any pitfalls (gotchas) that I need to be aware of?

Look forward to your responses

MTIA
Alexandr Molochnikov - 11 May 2005 17:38 GMT
Here is one way to circumvent the problem of I/O in EJB:

Servlets are allowed to access the file system. So, you can have all I/O
located in the servlet, and use HTTP to get the file content into your EJ
Bean (through the URL class).

HTH

Alex Molochnikov
Gestalt Corporation
www.gestalt.com

> I need to access files from an EJB (I know this is against the EJB spec
> but I cannot blob th files and store in a database [for example]- for
[quoted text clipped - 10 lines]
>
> MTIA
Frank Langelage - 11 May 2005 20:52 GMT
> I need to access files from an EJB (I know this is against the EJB spec
> but I cannot blob th files and store in a database [for example]- for
> various reasons too long to list here). The (gzipped) files are stored
> in a directory system off of a root directory. I am thinking of using
> ...

I/O is allowed when using an adapter according to JCA spec.
At sourceforge.net you'll find project fileRA for this purpose.

Regrds,
Frank
exquisitus - 11 May 2005 23:02 GMT
Thanks Frank. Interesting article about it on theserverside. My bigges
problem with it (it turns out it was the same for the majority of
correspondents), is the restrictive (GPL) licensing. I will have to rule
it out on that basis alone.

>> I need to access files from an EJB (I know this is against the EJB
>> spec but I cannot blob th files and store in a database [for example]-
[quoted text clipped - 7 lines]
> Regrds,
> Frank
Robert Maas, see http://tinyurl.com/uh3t - 15 Jun 2005 07:30 GMT
> From: exquisitus <nebulla@alpha-centauri.com>
> I need to access files from an EJB (... but I cannot blob th[e] files
> and store in a database ...)

I'm just a newcomer to this, so please knock down this idea if it's not
feasible: Could you set up the file access on a RMI service, and have
the bean get the data via RMI?
John C. Bollinger - 15 Jun 2005 16:21 GMT
>>From: exquisitus <nebulla@alpha-centauri.com>
>>I need to access files from an EJB (... but I cannot blob th[e] files
[quoted text clipped - 3 lines]
> feasible: Could you set up the file access on a RMI service, and have
> the bean get the data via RMI?

It would be non-compliant with the EJB specifications for a bean to
contact an RMI server directly, just like it is non-compliant for a bean
to perform I/O via the java.io or java.nio packages.  That doesn't
necessarilly mean that it wouldn't work (in some cases), but it is unwise.

Signature

John Bollinger
jobollin@indiana.edu

Doug Pardee - 16 Jun 2005 04:39 GMT
> It would be non-compliant with the EJB specifications
> for a bean to contact an RMI server directly

Where is that specified?

I not only don't see any prohibition against RMI, I see that the
container is required to have a security policy that will "allow
enterprise beans to use the client functionality of the
Java IDL and RMI-IIOP packages that are part of the Java 2 platform."
(Table 19, Section 24.2.1 of the EJB 2.0 Specification).


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.