A few things to check:
1) Check that your application depolyed properly in JBoss. You can check the jmx-console for this or the log file.
2) Make sure that jndi.properties is in your classpath and contains the following:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=localhost