Something is probably wrong with your JNDI configuration. Any changed jndi.properties, or included with your application?
No, nothing at all is changing in the app.
I mean, I can start up the app, and it talks to Jboss "A" and database "X".
Now I start up Jboss "B" which is configured for database "Y".
Now while Jboss "B" is in the process of starting up, I start my app multiple times. I can start it up half a dozen times talking to the correct DB, but then after a minute obviously something in the start up process has screwed up, and maybe the 7th time I start the app, suddenly now it is talking to the wrong database. Nothing whatsoever has changed in the client app. Something is changing during the startup of the second JBoss.