Glassfish can not find JNDI DataSource while deploying

I am trying to deploy an ear in glassfish, but it fails to depoly it complaining that it can't find the DataSource written in the persistence.xml In persistence.xml DataSource is configured asjava...