无法访问Jboss的本地JNDI

06-04-13 zj
JBOSS版本:jboss-4.0.3SP1

对于有前缀java:的本地JNDI均不能访问(在JSP和Servlet均测试过,不行!),进行lookup的时候都有javax.naming.NameNotFoundException异常,可在jboss中又是正常绑定了的

java: Namespace
  +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
  +- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
  +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
  +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
  +- MySqlDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
  +- comp (class: javax.naming.Context)
  +- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)
  +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
  +- jaas (class: javax.naming.Context)
  |   +- JmsXARealm (class: org.jboss.security.plugins.SecurityDomainContext)
  |   +- jbossmq (class: org.jboss.security.plugins.SecurityDomainContext)
  |   +- HsqlDbRealm (class: org.jboss.security.plugins.SecurityDomainContext)
  +- timedCacheFactory (class: javax.naming.Context)
Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy
  +- TransactionPropagationContextExporter (class: org.jboss.tm.TransactionPropagationContextFactory)
  +- StdJMSPool (class: org.jboss.jms.asf.StdServerSessionPoolFactory)
  +- Mail (class: javax.mail.Session)
  +- TransactionPropagationContextImporter (class: org.jboss.tm.TransactionPropagationContextImporter)
  +- TransactionManager (class: org.jboss.tm.TxManager)
<p>

查寻代码为:

InitialContext initialContext = new InitialContext();
Object obj = initialContext.lookup("java:/MySqlDS");

希望大家谈谈自已的经验~!

mrgaohan
2006-06-09 11:35
我也遇到这个问题,请有经验的人帮忙啊

猜你喜欢