Darryl Miles [http://community.jboss.org/people/dlmiles] created the discussion

"Re: AS6 & Snowdrop2 multiple queries"

To view the discussion, visit: http://community.jboss.org/message/594508#594508

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


        } catch (NamingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }



Returns data:



;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

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

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

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

>>> jndiPath=warApplicationContext
>>> NameNotFoundException=warApplicationContext not bound
END

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

Reply to this message by going to Community
[http://community.jboss.org/message/594508#594508]

Start a new discussion in Snowdrop at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2082]

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to