Do what Jaikiran Pai suggested. If it works, it meant some how your resource was not declared under
java name space. In that case, remove java name space from annotation
@Resource(name="demoDS",mappedName="demoDS")
Otherwise, you can loop through and print whatever bound to the initial context to detect the JNDI name for your datasource.