-
1. Re: if I use jboss, Can I use java.io package?
sharkman Jul 26, 2002 4:10 AM (in response to homekeeper)You cannot access the file system from an ejb.
But you could write an mbean which does the i/o stuff and call it from the ejb.
See the Documentation for how to write an mbean.
- Stefan -
2. Re: if I use jboss, Can I use java.io package?
nhebert Jul 26, 2002 7:25 AM (in response to homekeeper)HomeKeeper,
Yes, you can use the java.io package! Just not for
file or directory access to a local filesystem.
The points are made in (EJB 1.1) 18.1.2 are
very clear about this. Files in and of themselves are
not well suited to a distributed, transactional
environment.
But...
The next point that EJBs can be socket clients. This
means they must be able to import java.net.* AND
java.io.*. This works for me in JBoss 3.0.0. After all,
how can we call out to Web Services (hint, hint) from
EJBs which the draft J2EE 1.4 (EJB 2.1) says that we
can and should.
Bottom line, using java.io.* for file I/O is a definite
no-no as per the spec.
Since you mention WebSphere, I can say that WAS 4.0.1
happily writes to the local filesystem which it should
not, without a whinge. Go figure. So much for
J2EE certification...
Cheers,
Noel.