The Context mapped via ExternalContext is only created on startup of the mbean
and closed when it is stopped. To be able to issue a close on the context there
I would have to add a CacheContext attribute that if set to false would result in
the external context being created on each lookup and would have to be closed
by the client performing the lookup.

----- Original Message ----- 
From: "Jason Dillon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 19, 2001 12:27 PM
Subject: [JBoss-dev] ExternalContext & Context.close()


> I just ran into a problem if I closed a Context that was mapped from
> ExternalContext ala:
> 
>     <mbean code="org.jboss.naming.ExternalContext"
>    name=":service=ExternalContext,name=Dispatcher">
>       <attribute name="RemoteAccess">false</attribute>
>       <attribute name="JndiName">external/dispatcher</attribute>
>       <attribute name="InitialContext">javax.naming.InitialContext</attribute>
>       <attribute name="Properties">somefile.properties</attribute>
>     </mbean>
> 
> The client looks something like this:
> 
>   Context context = (Context)new
>      InitialContext().lookup("external/dispatcher");
> 
>   ... some other look ups
> 
>   context.close();
> 
> There are a couple of bits that use similar code to above (all trying to
> access the same external context).  If I remove Context.close() calls then
> everything works, but if I try to close them, I get some very odd behavior
> (one instance of each class will function, but all other will fail + more).
> 
> >From looking at ExternalContext, I can not see anything obvious that could
> cause this behavior.  For now I can just not close these contexts (but I am
> under the impression that I probably should).
> 
> Perhaps Scott would no best, but is this the correct behavior that I should
> be seeing.  If you would like more detail I can provide that (such as how to
> get a NullPointerException from inside of javax.naming.InitialContext when
> attempting to call addToEnviorment() and such).
> 
> --jason
> 
> 
> 
> 
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-development
> 


_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to