geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Mulder <ammul...@alumni.princeton.edu>
Subject Re: reference to ServerInfo from inside a j2ee app?
Date Wed, 10 Aug 2005 22:12:04 GMT
	There are a lot more elements you can use in your reference:

http://chariotsolutions.com/geronimo/web-plan.html#figure-web-gbean-name

	(It's at the very bottom of the page if the anchor doesn't work 
for you).  In this case, it sounds like you want to add:

<application>null</application>

Aaron

On Wed, 10 Aug 2005, toby cabot wrote:
> Hi Folks,
> 
> I'm working on getting web authentication to work, and it's mostly
> there thanks to whoever wrote the "demo" application.  Thanks for
> that, I learned a lot from looking at it.
> 
> Now I'd like to start the various gbeans in geronimo-application.xml
> instead of relying on the ones in the org/apache/geronimo/Secure plan.
> It mostly works, but the problem is getting a reference to ServerInfo.
> If I crib from the demo app, like so:
> 
>     <gbean name="hello-realm" class="org.apache.geronimo.security.realm.GenericSecurityRealm">
>         <attribute name="realmName">hello-realm</attribute>
>         <reference name="LoginModuleConfiguration">
>             <name>hello-login-chain</name>
>         </reference>
>         <reference name="ServerInfo">
>             <module>org/apache/geronimo/System</module>
>             <name>ServerInfo</name>
>         </reference>
>     </gbean>
> 
> I get this in the log:
> 
> 17:03:49,034 DEBUG main [org.apache.geronimo.gbean.runtime.GBeanSingleReference] Waiting
to start geronimo.server:J2EEApplication=hello,J2EEModule=null,J2EEServer=geronimo,j2eeType=SecurityRealm,name=hello-realm
because no targets are running for reference ServerInfo matching the patternspatterns geronimo.server:J2EEApplication=hello,J2EEModule=org/apache/geronimo/System,J2EEServer=geronimo,j2eeType=GBean,name=ServerInfo

> 
> ... and the hello-realm gbean is stuck in the starting state.  Note
> that it's looking for ServerInfo with "J2EEApplication=hello" (which
> is the name of my application) whereas the real ServerInfo has
> "J2EEApplication=null".  I also tried swapping the module and name
> elements with:
> 
> <gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/System,J2EEServer=geronimo,j2eeType=GBean,name=ServerInfo</gbean-name>
> 
> ... then it works, but this seems much more brittle to me than using
> the module and the name.  It works in the module/name case if I deploy
> the gbean descriptors in a standalone descriptor file rather than in
> the ear.
> 
> I'm wondering if in the module/name case Geronimo should try the
> current application first, and if that fails try J2EEApplication=null.
> If that sounds like a good idea I'd be willing to take a stab at it if
> someone could point me to roughly the code that's doing the
> translation from module/name to gbean name.
> 
> Thanks,
> Toby
> 

Mime
View raw message