standalone Java client with bonita-client-5.9.jar works but the same Java client in JBoss 7.1 does not work

A standalone Java client built in with bonita-client-5.9.jar library works fine but when the same Java client is moved to the JEE architecture running on JBoss 7.1 environment does not work. Show log message: Password Incorrect/Password Required

Java code: