Steve
Steve

Reputation: 8829

GlassFish 3.1.2 PostgreSQL 9.1 = ClassNotFoundException

I just upgraded GlassFish from 3.1.1 to 3.1.2. My app deploys, but bombs out on any page that makes use of JPA (all of them!).

java.lang.ClassNotFoundException: org.postgresql.jdbc4.Jdbc4PreparedStatement
    at com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:782)
    at com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:696)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    ... 168 more

Is there some 3.1.2 deployment related change that I've missed?

Also, if it's relevant, I build and package with Maven 2.

Update:

As suggested, adding the PostgreSQL JDBC jar manually to GlassFish 3.1.2 has worked, but this is not a solution because it should not be necessary as it complicates the deployment process and is a regression from 3.1.1.

Upvotes: 1

Views: 1620

Answers (1)

You need to add the jar containing the JDBC driver to the Glassfish installation.

I believe it needs to go in an ext folder under the domain.

Upvotes: 2

Related Questions