>> The convention is java:comp/env/XXX, not java:/comp/env/XXX
>
>Both works, but yes the specs says "java:comp".
>
>/Rickard
Is this an artifact of that java: url context factory in JBoss? In general,
java:comp/env/var is not the same heirarchical name as java:/comp/env/var
as this little example illustrates:
522>java -cp ".;../client/jnp-client.jar" tstName
java:comp/env/var size = 3
c[0] = java:comp
c[1] = env
c[2] = var
java:/comp/env/var size = 4
c[0] = java:
c[1] = comp
c[2] = env
c[3] = var
import javax.naming.*;
class tstName
{
public static void main(String[] args) throws Exception
{
InitialContext ctx = new InitialContext();
Name n0 = ctx.getNameParser("").parse("java:comp/env/var");
System.out.println(n0+" size = "+n0.size());
for(int c = 0; c < n0.size(); c ++)
{
System.out.println("c["+c+"] = "+n0.get(c));
}
Name n1 = ctx.getNameParser("").parse("java:/comp/env/var");
System.out.println(n1+" size = "+n1.size());
for(int c = 0; c < n1.size(); c ++)
{
System.out.println("c["+c+"] = "+n1.get(c));
}
}
}
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]