wood burning stoves
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 Building Microservices this week in the Design 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(ClassLoader.java:927)
at java.lang.ClassLoader.loadClass(ClassLoader.java:298)
at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at com.sun.hk2.component.LazyInhabitant.loadClass(LazyInhabitant.java:124)
at com.sun.hk2.component.LazyInhabitant.fetch(LazyInhabitant.java:111)
at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:135)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
at org.jvnet.hk2.component.Habitat$5.get(Habitat.java:701)
at java.util.AbstractList$Itr.next(AbstractList.java:345)
at com.sun.enterprise.naming.impl.NamedNamingObjectManager.checkAndLoadProxies(NamedNamingObjectManager.java:73)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:462)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.virtualpairprogrammers.client.ClientApplicationTest.main(ClientApplicationTest.java:19)

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Getting NoClassDefFoundError
It's not a secret anymore!