In order to get the restriction up and working, you have to define a
different code base for your beans, which few vendors actually do. That
would be specified in your java.policy file, not in the EJB server
itself (there's no API for the container to do that).
Funny, but EJB actually has to go the extra step to place these
restrictions, and I don't think anybody actually took the time (or ever
will) to do that.
arkin
Marc-Oliver Scheele wrote:
>
> Hello;
>
> I thought the EJB 1.1 prohibited file access via java.io.*.
>
> I tested it against the sun's J2EE, because they have
> fully implemented EJB 1.1.
>
> And what a surprise:
> There are no restrictions for I/O!
>
> Here is the code I used in my bean:
>
> import javax.ejb.*;
> import java.io.*;
> public class AdderEJB implements SessionBean
> {
>
> int total;
>
> public void ejbCreate() {
> total = 0;
> }
>
> public void ejbCreate(int initial) {
> total = initial;
> }
>
> public void add(int number) {
> total += number;
> try {
> File file= new java.io.File("c:/temp/newww.txt");
> FileWriter writer = new FileWriter(file);
> writer.write("Hallo dies ist eine I/O-Operation mit EJB");
> writer.close();
> } catch (Exception exc) {
> System.out.println("Konnte nicht schreiben---- ");
> exc.printStackTrace();
> }
> }
>
> public int getTotal() {
> return total;
> }
>
> public AdderEJB() {}
> public void setSessionContext(SessionContext sc) {}
> public void ejbRemove() {}
> public void ejbActivate() {}
> public void ejbPassivate() {}
>
> } // AdderEJB
>
> Greetings
> Oliver
>
> ===========================================================================
> 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".
--
----------------------------------------------------------------------
Assaf Arkin www.exoffice.com
CTO, Exoffice Technologies, Inc. www.exolab.org
===========================================================================
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".