FYI, the workaround I am using currently is to have a library with a
function that can read the resource. This library has the required
permission, and can be called from the bean. Something like this:
   public InputStream getResource(final String name, final Object
requestor)
   {
      return (InputStream)AccessController.doPrivileged(new
PrivilegedAction()
      {
         public Object run()
         {
            return
requestor.getClass().getClassLoader().getResourceAsStream(name);
         }
      });
   }
-----------------

Works. Good?

BTW, as you can see I have to provide the caller in order to get to the
classloader. If it was mandatory that the classloader is available
through Thread.currentThread().getContextClassLoader() then this would
not be necessary. Any thoughts on this?

/Rickard

--
Rickard �berg

@home: +46 13 177937
Email: [EMAIL PROTECTED]
http://www.dreambean.com
Question reality

===========================================================================
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".

Reply via email to