Since you are using a standalone Java Client Application, it's probably running outside the JVM of your appserver. The url for lookup "java:comp/env/<beanJNDIName>", is the J2EE specification for looking EJB's (or other resources) INSIDE the same environment, not outside of the environment. You java client app has no idea about java:comp

Try giving entire url for lookup e.g.

context.lookup("<protocol>://<host>:<port>/<resourceName>")

On my box I have a DataSource registered in weblogic JNDI Namespace under context jdbc/Oracle_sid. From standalone java app I look up datasource as