tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Renaers" <Frank.Rena...@ikan.be>
Subject Tomcat 5 - jndi problem
Date Wed, 10 Dec 2003 11:03:44 GMT
Hi,

Is it possible to browse the Tomcat jndi context from within another vm.
I wrote a small junit test to test this, but it always fails !!
It always throws a javax.naming.NameNotFoundException: Name java:comp is not bound in this
Context 

My jndi.properties contains the following settings : 
java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory
java.naming.provider.url=http://localhost:8080

My conf.xml :
<!-- Global JNDI resources -->
<GlobalNamingResources>

  <!-- Test entry for demonstration purposes -->
  <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
</GlobalNamingResources>

My test :

public void testDataSource() throws Exception {

        // Obtain our environment naming context
        javax.naming.Context initCtx = new javax.naming.InitialContext();
        javax.naming.Context envCtx = (javax.naming.Context) initCtx.lookup("java:comp/env/simpleValue");
   
    }
}

Thanks,

Frank Renaers





Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message