Posting the stack trace of the exception that you are encountering could be helpful. I assume that when you say that it works fine standalone, you are referring to your development environment. What type of app server is the development environment, and where is this .jar file deployed there? I'd also suggest making sure that you don't have duplicate versions (perhaps incompatible versions) of this .jar file. If you have a copy of the .jar inside your .war and a copy of the .jar deployed in the app server's lib/ext folder, you may get something different based on the class loader settings for the EAR/WAR.