As part of a Java EE application I'm developing on JBoss, I need to persist the contents of a file on the JNDI tree. I'm doing this by reading the contents of the file into a by byte array, then binding it to JNDI as follows.
getInitialContext().rebind("customers_datafile", byteArray);
This works fine, but the binding is lost when the JBoss server is stopped/restarted. Is there a way to make it perist between restarts? Ideally I'd like to achieve this without having to rebind it using code similar to above upon each restart.