<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Re: AS6 & Snowdrop2 multiple queries
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/dlmiles">Darryl Miles</a> in <i>Snowdrop</i> - <a href="http://community.jboss.org/message/594508#594508">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><pre class="jive-pre"><code class="jive-code">
InitialContext ctxt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; try {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ctxt = new InitialContext();
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; NamingEnumeration&lt;Binding&gt; bindings = ctxt.listBindings((String)"");
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; while(bindings.hasMore()) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Binding b = bindings.next();
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sb.append(";" + b.toString() + "\n");
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; String[] jndiPathList = { "earApplicationContext", "jpaApplicationContext", "ejbApplicationContext", "warApplicationContext", "//Helper" };
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; for(String jndiPath : jndiPathList) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //String jndiPath = "ejbApplicationContext";
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //jndiPath = "jpaApplicationContext";
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //jndiPath = "earApplicationContext";
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; try {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Object o;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(jndiPath.equals("//Helper")) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; javax.servlet.ServletContext sc = WicketApplication.get().getServletContext();
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; o = WebApplicationContextUtils.getWebApplicationContext(sc);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } else {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; o = ctxt.lookup(jndiPath);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sb.append("&gt;&gt;&gt; jndiPath=" + jndiPath + "\n");
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sb.append("&gt;&gt;&gt; type=" + ((o != null)? o.getClass().getName() : "unknown") + "\n");
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sb.append("&gt;&gt;&gt; toString=" + ((o != null) ? o.toString() : "null") + "\n");
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; BeanFactory bf = (BeanFactory)o;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ApplicationContext ac = (ApplicationContext)bf;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sb.append("&gt;&gt;&gt; getId=" + ac.getId() + "\n");
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sb.append("&gt;&gt;&gt; displayName=" + ac.getDisplayName() + "\n");
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sb.append("&gt;&gt;&gt; parent=" + ac.getParent() + "\n");
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sb.append("&gt;&gt;&gt; parentBeanFactory=" + ac.getParentBeanFactory() + "\n");
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } catch(NameNotFoundException e) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sb.append("&gt;&gt;&gt; jndiPath=" + jndiPath + "\n");
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sb.append("&gt;&gt;&gt; NameNotFoundException=" + e.getMessage() + "\n");
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //sb.append("&gt;&gt;&gt; " + ac. + "\n");
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sb.append("END\n");
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //bf = (BeanFactory) applicationContext;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }


&#160;&#160;&#160;&#160;&#160;&#160;&#160; } catch (NamingException e) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // TODO Auto-generated catch block
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.printStackTrace();
&#160;&#160;&#160;&#160;&#160;&#160;&#160; }
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Returns data:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">
;UserTransactionSessionFactory: $Proxy102:org.jboss.invocation.unified.interfaces.UnifiedInvokerProxy@5872ee46
;UUIDKeyGeneratorFactory: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory:org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory@2ffd6b29
;com.domain.ear: org.jnp.interfaces.NamingContext:org.jnp.interfaces.NamingContext@53e7ec65
;HiLoKeyGeneratorFactory: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory:org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory@76da70d4
;SecureDeploymentManager: org.jnp.interfaces.NamingContext:org.jnp.interfaces.NamingContext@1f5105ec
;SecureManagementView: org.jnp.interfaces.NamingContext:org.jnp.interfaces.NamingContext@5bd904
;DeploymentManager: org.jboss.aop.generatedproxies.AOPProxy$4:org.jboss.aop.generatedproxies.AOPProxy$4@12e9aaf5
;XAConnectionFactory: org.hornetq.jms.client.HornetQConnectionFactory:Reference Class Name: org.hornetq.jms.client.HornetQConnectionFactory
Type: HornetQ-CF
Content: [B@e0495cb

;persistence.unit:unitName=com.domain.ear.ear: org.jnp.interfaces.NamingContext:org.jnp.interfaces.NamingContext@4f06499d
;persistence.unit:unitName=jboss-ejb3-timerservice-mk2.jar#timerdb: org.hibernate.impl.SessionFactoryImpl:Reference Class Name: org.hibernate.impl.SessionFactoryImpl
Type: uuid
Content: 7c0ac58c-5bca-469a-9fc0-69cd1d690f02

;ProfileService: org.jboss.aop.generatedproxies.AOPProxy$2:org.jboss.aop.generatedproxies.AOPProxy$2@19b8db54
;jpaApplicationContext: org.jboss.spring.factory.NamedXmlApplicationContext:Reference Class Name: org.jboss.spring.factory.NamedXmlApplicationContext
Type: nns
Content: jpaApplicationContext

;SecureProfileService: org.jnp.interfaces.NamingContext:org.jnp.interfaces.NamingContext@25cb0af3;queue: org.jnp.interfaces.NamingContext:org.jnp.interfaces.NamingContext@353beae7
;UserTransction: org.jboss.tm.usertx.client.ClientUserTransaction:Reference Class Name: org.jboss.tm.usertx.client.ClientUserTransaction

;ConnectionFactory: org.hornetq.jms.client.HornetQConnectionFactory:Reference Class Name: org.hornetq.jms.client.HornetQConnectionFactory
Type: HornetQ-CF
Content: [B@70bafefe

;jmx: org.jnp.interfaces.NamingContext:org.jnp.interfaces.NamingContext@4bb0f84;ProxyFactory: org.jnp.interfaces.NamingContext:org.jnp.interfaces.NamingContext@14f7a589
;BeanValidatorFactories: org.jnp.interfaces.NamingContext:org.jnp.interfaces.NamingContext@e94d020
;earApplicationContext: org.jboss.spring.factory.NamedXmlApplicationContext:Reference Class Name: org.jboss.spring.factory.NamedXmlApplicationContext
Type: nns
Content: earApplicationContext

;ejbApplicationContext: org.jboss.spring.factory.NamedXmlApplicationContext:Reference Class Name: org.jboss.spring.factory.NamedXmlApplicationContext
Type: nns
Content: ejbApplicationContext

;TomcatAuthenticators: java.util.Properties:{FORM=org.apache.catalina.authenticator.FormAuthenticator, BASIC=org.apache.catalina.authenticator.BasicAuthenticator, DIGEST=org.apache.catalina.authenticator.DigestAuthenticator, CLIENT-CERT=org.apache.catalina.authenticator.SSLAuthenticator, NONE=org.apache.catalina.authenticator.NonLoginAuthenticator}
;XAThroughputConnectionFactory: org.hornetq.jms.client.HornetQConnectionFactory:Reference Class Name: org.hornetq.jms.client.HornetQConnectionFactory
Type: HornetQ-CF
Content: [B@4bebec5a

;ManagementView: org.jboss.aop.generatedproxies.AOPProxy$3:org.jboss.aop.generatedproxies.AOPProxy$3@26bba826
;ThroughputConnectionFactory: org.hornetq.jms.client.HornetQConnectionFactory:Reference Class Name: org.hornetq.jms.client.HornetQConnectionFactory
Type: HornetQ-CF
Content: [B@6dea2fa6

&gt;&gt;&gt; jndiPath=earApplicationContext
&gt;&gt;&gt; type=org.jboss.spring.factory.NamedXmlApplicationContext
&gt;&gt;&gt; toString=org.jboss.spring.factory.NamedXmlApplicationContext@4a814c0d: startup date [Mon Mar 21 14:35:47 GMT 2011]; root of context hierarchy
&gt;&gt;&gt; getId=org.jboss.spring.factory.NamedXmlApplicationContext@4a814c0d
&gt;&gt;&gt; displayName=org.jboss.spring.factory.NamedXmlApplicationContext@4a814c0d
&gt;&gt;&gt; parent=null
&gt;&gt;&gt; parentBeanFactory=null
END

&gt;&gt;&gt; jndiPath=jpaApplicationContext
&gt;&gt;&gt; type=org.jboss.spring.factory.NamedXmlApplicationContext
&gt;&gt;&gt; toString=org.jboss.spring.factory.NamedXmlApplicationContext@18b706c8: startup date [Mon Mar 21 14:35:48 GMT 2011]; root of context hierarchy
&gt;&gt;&gt; getId=org.jboss.spring.factory.NamedXmlApplicationContext@18b706c8
&gt;&gt;&gt; displayName=org.jboss.spring.factory.NamedXmlApplicationContext@18b706c8
&gt;&gt;&gt; parent=null
&gt;&gt;&gt; parentBeanFactory=null
END

&gt;&gt;&gt; jndiPath=ejbApplicationContext
&gt;&gt;&gt; type=org.jboss.spring.factory.NamedXmlApplicationContext
&gt;&gt;&gt; toString=org.jboss.spring.factory.NamedXmlApplicationContext@4c47a353: startup date [Mon Mar 21 14:35:48 GMT 2011]; root of context hierarchy
&gt;&gt;&gt; getId=org.jboss.spring.factory.NamedXmlApplicationContext@4c47a353
&gt;&gt;&gt; displayName=org.jboss.spring.factory.NamedXmlApplicationContext@4c47a353
&gt;&gt;&gt; parent=null
&gt;&gt;&gt; parentBeanFactory=null
END

&gt;&gt;&gt; jndiPath=warApplicationContext
&gt;&gt;&gt; NameNotFoundException=warApplicationContext not bound
END

&gt;&gt;&gt; jndiPath=//Helper
&gt;&gt;&gt; type=org.springframework.web.context.support.XmlWebApplicationContext
&gt;&gt;&gt; toString=Root WebApplicationContext: startup date [Mon Mar 21 14:36:51 GMT 2011]; root of context hierarchy
&gt;&gt;&gt; getId=org.springframework.web.context.WebApplicationContext:/webapp.wicket
&gt;&gt;&gt; displayName=Root WebApplicationContext
&gt;&gt;&gt; parent=null
&gt;&gt;&gt; parentBeanFactory=null
END

</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/594508#594508">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Snowdrop at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2082">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>