[jboss-user] [Snowdrop] - Re: AS6 & Snowdrop2 multiple queries

Darryl Miles do-not-reply at jboss.com
Mon Mar 21 10:53:58 EDT 2011


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 at 5872ee46
;UUIDKeyGeneratorFactory: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory:org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory at 2ffd6b29
;com.domain.ear: org.jnp.interfaces.NamingContext:org.jnp.interfaces.NamingContext at 53e7ec65
;HiLoKeyGeneratorFactory: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory:org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory at 76da70d4
;SecureDeploymentManager: org.jnp.interfaces.NamingContext:org.jnp.interfaces.NamingContext at 1f5105ec
;SecureManagementView: org.jnp.interfaces.NamingContext:org.jnp.interfaces.NamingContext at 5bd904
;DeploymentManager: org.jboss.aop.generatedproxies.AOPProxy$4:org.jboss.aop.generatedproxies.AOPProxy$4 at 12e9aaf5
;XAConnectionFactory: org.hornetq.jms.client.HornetQConnectionFactory:Reference Class Name: org.hornetq.jms.client.HornetQConnectionFactory
Type: HornetQ-CF
Content: [B at e0495cb

;persistence.unit:unitName=com.domain.ear.ear: org.jnp.interfaces.NamingContext:org.jnp.interfaces.NamingContext at 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 at 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 at 25cb0af3;queue: org.jnp.interfaces.NamingContext:org.jnp.interfaces.NamingContext at 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 at 70bafefe

;jmx: org.jnp.interfaces.NamingContext:org.jnp.interfaces.NamingContext at 4bb0f84;ProxyFactory: org.jnp.interfaces.NamingContext:org.jnp.interfaces.NamingContext at 14f7a589
;BeanValidatorFactories: org.jnp.interfaces.NamingContext:org.jnp.interfaces.NamingContext at 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 at 4bebec5a

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

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

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

>>> jndiPath=ejbApplicationContext
>>> type=org.jboss.spring.factory.NamedXmlApplicationContext
>>> toString=org.jboss.spring.factory.NamedXmlApplicationContext at 4c47a353: startup date [Mon Mar 21 14:35:48 GMT 2011]; root of context hierarchy
>>> getId=org.jboss.spring.factory.NamedXmlApplicationContext at 4c47a353
>>> displayName=org.jboss.spring.factory.NamedXmlApplicationContext at 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]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110321/8fea43aa/attachment-0001.html 


More information about the jboss-user mailing list