With all the respect , possibly, this is not correct or container dependent, I dunno.
The <env-entry-name> element is relative to the "java:comp/env" JNDI tree node ,
this is why the Integer i is not only known in the bean contexts but outside bean as well.
The code below show all env variable lookup names
In servlet instead of using
has to be something like JNDI tree "java:comp/env"
Integer passphrase = (Integer) jndiContext.lookup("java:comp/env/com.ivan.scbcd6.FirstBean/i");
you could even do in servlet something like this.