I am currently experiencing the same behavior in jboss-3.2.3.
In jboss-4.0.0, the behavior is slightly different: The JBoss VM appears to go into the infinite loop before any markup is returned.
Is this a JNDIView bug, or a mis-use of ExternalContext config? In my case I added the following to server/default/conf/jboss-service.xml, immediately before the JNDIView MBean entry:
<!-- Bind a remote LDAP server -->
I found out that the documentation I was reading is wrong. Use the PropertiesURL attribute in order to locate the external file that contains LDAP connection info, NOT Properties attribute as shown in the example.