File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes JPA - NoClassDefFoundError: jpa/County (EmbeddedId) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "JPA - NoClassDefFoundError: jpa/County (EmbeddedId)" Watch "JPA - NoClassDefFoundError: jpa/County (EmbeddedId)" New topic

JPA - NoClassDefFoundError: jpa/County (EmbeddedId)

Jack Bush
Ranch Hand

Joined: Oct 20, 2006
Posts: 235
Hi All,

I am coming across a NoClassDefFoundError: jpa/County below when trying to instantiate a JPA with EmbeddedId:

02/05/2010 10:45:48 PM com.sun.enterprise.appclient.MainWithModuleSupport <init>
WARNING: ACC003: Application threw an exception.
java.lang.NoClassDefFoundError: jpa/County
at client.addCounties(
The following are the relevant code snippets:

Can someone please provide advice on how to properly instantiate County entity without getting NoClassDefFoundError: jpa/County? I have tried all combinations between line 1 – 7 without success.

I am using JDK1.6.0_23, GF2.1 on Windows 7.

Thanks in advance,

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

This is a NoClassDefFoundError, which suggests the classpath is wrong.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jack Bush
Ranch Hand

Joined: Oct 20, 2006
Posts: 235
Hi Paul,

Thank you for offerring advice to this threat.

I managed to re-create the whole Java EE 5 project from scratch and can confirm that County is part of CountyConsumer-ejb has been included in the CLASSPATH of CountyConsumer-app-client but it did not make any difference. Below is the CLASSPATH segment of CountyConsumer-app-client in nbproject/ (Netbeans 6.9.1):

I am wondering whether this lost of access/visibility of County from client.AddCounties() is due to the fact that it is an Application Client which is in a different container? Also find it strange to see the names of 2 old packages (domain, ejb) already been deleted and could not find them in any of the codes or configuration files.

Any suggestion?


I agree. Here's the link:
subject: JPA - NoClassDefFoundError: jpa/County (EmbeddedId)
It's not a secret anymore!