blog.relativt.net

Eirik's public note to self

4 September 2011

GlassFish v3: Picky about where the libraries in an EAR are located

by Eirik Tenold

While trying to deploy an EAR-application on GlassFish v3, I got an error about missing class files. The mentioned class files where from external libraries packaged along with my EJB inside the ear-file. I found this strange since the same ear-file deployed just fine on GlassFish v2. Strange…

After a couple of hours with trial-and-error and my favorite troubleshooter (Google), I came across another guy who had similar problems. It turned out that GlassFish v3 is more picky about where libraries are located. The short answer: Just add a simple line in the pom.xml:

<library-directory>lib</library-directory>
tags: GlassFish - Java - Java EE - Maven