I think I got it: it was WTP/JBoss not deploying the application.xml file from the ear. The weird thing is that Maven generates it every time, but the file not always (sometimes yes, sometimes no) is deployed to JBoss. It doesn't even work copying the file by hand, I have to remove de app from the server and redeploy it.
Any explanation?