You could build an MBean that performs the file I/O and the EJB could call the MBean or you could build an MBean that binds a writer object to the JNDI and the EJB can lookup an invoke that. That should satisfy the abstraction of EJBs from the file I/O layer.
Another way is to have your servlet talk HTTP and build a web application layer that on-sends the request to the EJB and at the end of it, if successful, write something to file - also saves the servlet from carrying around the JBoss client library.
Depends on your requirements, time frame, etc.
Obviously quite a few ways to do things but those are a couple of suggestions.
Thanks. I think I will look into the MBean idea.
BTW, I meant applet not servlet. It was getting late at night.