user704591
user704591

Reputation:

Glassfish + PostgreSQL, ClassNotFoundException, mysterious solutions

I have a very annoying problem with Glassfish and PostgreSQL. I have an EAR which contains a WAR and several other EJBs. I am using PostgreSQL. The annoying thing is that sometimes (this sometimes is the most disturbing thing because I have no clue what could go wrong) I get a ClassNotFoundException: java.lang.ClassNotFoundException: org.postgresql.core.Parser

Sometimes (!!!), the problem is solved if I clean and build the whole EAR, sometimes I have to restart the Glassfish, too.

I sometimes get NoClassDefFoundError, too.

Could anybody tell me how to include, package or do anything with the JAR which contains the missing class?

Thank you, Norbert

Upvotes: 0

Views: 205

Answers (1)

araqnid
araqnid

Reputation: 133752

Where do you put the jar: directly inside the EAR? Or in the WAR inside the EAR? For JDBC drivers, I think the recommendation is to always put them in the container's shared area and never in an application. (When I used JBoss a couple of years ago, we always put JDBC drivers into server/lib and had trouble if they were included in EARs as well, especially if the versions got out of sync)

Upvotes: 1

Related Questions