Could you show your
I solved my problem.
The problem was this line of code:
ds = (DataSource) envCtx.lookup("jdbc/TEST_DATABASE");
This was throwing an exception.
I simply changed it to:
ds = (DataSource) initCtx.lookup("java:jboss/datasources/TEST_DATABASE");
A subtle difference when moving from tomcat to jboss. Well, now I know.