No, no, wrong idea. I'm suggesting that (a) if the EJB Spec or
implementation wished to provide access to resources within the Codebase of
the component (that is, files stored within the .ear file or from the local
filesystem), and (b) the deployment tool of the EJB vendor was written to do
this, the deployer could create a ClassLoader type that honored the request
to getResource() and getResourceAsStream() (while still rejecting
loadClass() calls), with the security permissions set to allow calls to
Thread.currentThread().getContextClassLoader() and/or
getClass().getClassLoader().
Bear in mind, too, that I just walked into the middle of this discussion, so
I'm not entirely sure of the context in which we're speaking. That stated, I
don't see the relevance of 2.16.4 to a discussion of obtaining and using the
component's ClassLoader. Certainly a SecurityException will be thrown if the
thread's current security context holds a CodeSource frame that lacks the
necessary RuntimePersmission to obtain the ClassLoader, but that's merely an
exercise in Java Security Policy permission manipulation, not an artifact of
the VM itself.
Ted Neward
{.NET||Java} Course Author & Instructor
DevelopMentor (http://www.develop.com)
http://www.javageeks.com/tneward/index.html
> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of John Harby
> Sent: Friday, September 28, 2001 12:25 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [EJB-INT] Using classloader to load files from EJB jar
> (was: "Environment Variables")
>
>
> I don't see how you can facilitate this if an unchecked RuntimeException
> occurs in the VM. (cf. VMSpec sec. 2.16.4)
>
> >From: Ted Neward <[EMAIL PROTECTED]>
> >Reply-To: [EMAIL PROTECTED]
> >To: [EMAIL PROTECTED]
> >Subject: Re: Using classloader to load files from EJB jar (was:
> > "Environment Variables")
> >Date: Fri, 28 Sep 2001 10:38:24 -0700
> >
> >Not necessarily true--the container could always synthesize a
> >ClassLoaderInterceptor that provided whatever functionality the container
> >felt was necessary to maintain its services.
> >
> >Ted Neward
> >{.NET||Java} Course Author & Instructor
> >DevelopMentor (http://www.develop.com)
> >http://www.javageeks.com/tneward/index.html
> >
> > > -----Original Message-----
> > > From: A mailing list for Enterprise JavaBeans development
> > > [mailto:[EMAIL PROTECTED]]On Behalf Of John Harby
> > > Sent: Friday, September 28, 2001 10:05 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: [EJB-INT] Using classloader to load files from EJB jar
> > > (was: "Environment Variables")
> > >
> > >
> > > Not ok with the spec, section 24.1 states:
> > >
> > > "� The enterprise bean must not attempt to create a class loader;
> > > obtain the
> > > current class loader;set the context class loader; set
> security manager;
> > > create a new security manager; stop the JVM; or change the input,
> >output,
> > > and error streams.
> > >
> > > These functions are reserved for the EJB Container. Allowing the
> > > enterprise
> > > bean to use these functions could compromise security and decrease the
> > > Container�s ability to properly manage the runtime environment."
> > >
> > > I think the issue you'll find is that runtime security exceptions
> > > can occur
> > > when the loader is created/obtained. If the developer is doing
> > > this sort of
> > > thing then the container cannot intercept these exceptions so the
> > > container
> > > is no longer in control of the application.
> > >
> > >
> > > >From: Johan Eltes <[EMAIL PROTECTED]>
> > > >Reply-To: [EMAIL PROTECTED]
> > > >To: [EMAIL PROTECTED]
> > > >Subject: Using classloader to load files from EJB jar (was:
> >"Environment
> > > > Variables")
> > > >Date: Fri, 28 Sep 2001 10:42:01 +0200
> > > >
> > > >I should be ok to load files in the EJB Jar through the class loader,
> > > >shouldn't it?
> > > >Otherwise it would be hard to do localization and other
> tasks that are
> > > >supported by property-files and other representations of localized
> > > >resources?
> > > >My interpretation of the file io restriction stated in the spec, is
> >that
> > > >you
> > > >shouldn't do file io by referencing the file system.
> > > >This has been on the agenda in many threads....
> > > >
> > > >/Johan
> > > >
> > >
> > >
> > > _________________________________________________________________
> > > Get your FREE download of MSN Explorer at
> >http://explorer.msn.com/intl.asp
> > >
> > > ==================================================================
> > > =========
> > > 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".
> > >
> > >
> >
> >=================================================================
> ==========
> >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".
> >
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
> ==================================================================
> =========
> 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".
>
>
===========================================================================
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".