This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Getting NoClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Getting NoClassDefFoundError" Watch "Getting NoClassDefFoundError" New topic

Getting NoClassDefFoundError

peter aerts
Ranch Hand

Joined: Jan 22, 2009
Posts: 32

[size=18]Hi Dears,

I have created a simple EJB project as a sample in MyElipse but i am getting below error when i am runing it , please advice me what to do to fix it.

I should mention that i have added below jar files to the Java Biuld Path but still i am getting below error.


public class ClientApplicationTest {

public static void main(String[] args) {

try {
Context jndi = new InitialContext();

EmployeeManagementService service = (EmployeeManagementService) jndi.lookup("com.virtualpairprogrammers.staffmanagement.EmployeeManagemanetService");
List<Employee> listEmployee = service.getAllEmployee();
for (Employee employee : listEmployee) {


} catch (NamingException e) {



Apr 1, 2013 12:00:02 AM com.sun.enterprise.v3.server.CommonClassLoaderServiceImpl findDerbyClient
INFO: Cannot find javadb client jar file, derby jdbc driver will not be available by default.
Exception in thread "main" java.lang.NoClassDefFoundError: org/glassfish/api/naming/NamedNamingObjectProxy
at java.lang.ClassLoader.findBootstrapClass(Native Method)
at java.lang.ClassLoader.findBootstrapClassOrNull(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at com.sun.hk2.component.LazyInhabitant.loadClass(
at com.sun.hk2.component.LazyInhabitant.fetch(
at com.sun.hk2.component.EventPublishingInhabitant.get(
at com.sun.hk2.component.AbstractInhabitantImpl.get(
at org.jvnet.hk2.component.Habitat$5.get(
at java.util.AbstractList$
at com.sun.enterprise.naming.impl.NamedNamingObjectManager.checkAndLoadProxies(
at com.sun.enterprise.naming.impl.SerialContext.lookup(
at com.sun.enterprise.naming.impl.SerialContext.lookup(
at javax.naming.InitialContext.lookup(
at com.virtualpairprogrammers.client.ClientApplicationTest.main(

I agree. Here's the link:
subject: Getting NoClassDefFoundError
jQuery in Action, 3rd edition