java.lang.NoClassDefFoundError: WEB-INF.classes.sample.jsf.PersonBean (wrong name: sample/jsf/PersonBean)

Spring JIRA | Jose Noheda | 8 years ago
  1. 0

    LocalContainerEntityManagerFactoryBean loads a valid persistence.xml that does not declare any class mappings. It detects correctly some annotated classes in the classpath (inside WEB-INF/classes) and proceeds to load them failing with: Local ClassPath: ... Delegation Mode: PARENT_LAST [1] com.ibm.ws.classloader.CompoundClassLoader@548a548a Local ClassPath: Delegation Mode: PARENT_LAST [2] com.ibm.ws.classloader.ProtectionClassLoader@5ba05ba0 [3] com.ibm.ws.bootstrap.ExtClassLoader@69586958 [4] org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@1e941e94 [5] sun.misc.Launcher$AppClassLoader@29582958 [6] sun.misc.Launcher$ExtClassLoader@41384138 ---Original exception--- java.lang.NoClassDefFoundError: WEB-INF.classes.sample.jsf.PersonBean (wrong name: sample/jsf/PersonBean) at java.lang.ClassLoader.defineClassImpl(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:258) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151) at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:555) at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:506) at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:389) at java.lang.ClassLoader.loadClass(ClassLoader.java:597) at java.lang.Class.forNameImpl(Native Method) at java.lang.Class.forName(Class.java:163) at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:112) at org.hibernate.ejb.Ejb3Configuration.classForName(Ejb3Configuration.java:1008) at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1080) at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:871) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:758) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:425) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:131) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:224) Notice two things: the classloader is set to PARENT_LAST and the name of the class to be loaded seems incorrect. This may ver well be an issue of Hibernate as well. If so, please ignore.

    Spring JIRA | 8 years ago | Jose Noheda
    java.lang.NoClassDefFoundError: WEB-INF.classes.sample.jsf.PersonBean (wrong name: sample/jsf/PersonBean)
  2. 0

    LocalContainerEntityManagerFactoryBean loads a valid persistence.xml that does not declare any class mappings. It detects correctly some annotated classes in the classpath (inside WEB-INF/classes) and proceeds to load them failing with: Local ClassPath: ... Delegation Mode: PARENT_LAST [1] com.ibm.ws.classloader.CompoundClassLoader@548a548a Local ClassPath: Delegation Mode: PARENT_LAST [2] com.ibm.ws.classloader.ProtectionClassLoader@5ba05ba0 [3] com.ibm.ws.bootstrap.ExtClassLoader@69586958 [4] org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@1e941e94 [5] sun.misc.Launcher$AppClassLoader@29582958 [6] sun.misc.Launcher$ExtClassLoader@41384138 ---Original exception--- java.lang.NoClassDefFoundError: WEB-INF.classes.sample.jsf.PersonBean (wrong name: sample/jsf/PersonBean) at java.lang.ClassLoader.defineClassImpl(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:258) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151) at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:555) at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:506) at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:389) at java.lang.ClassLoader.loadClass(ClassLoader.java:597) at java.lang.Class.forNameImpl(Native Method) at java.lang.Class.forName(Class.java:163) at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:112) at org.hibernate.ejb.Ejb3Configuration.classForName(Ejb3Configuration.java:1008) at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1080) at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:871) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:758) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:425) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:131) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:224) Notice two things: the classloader is set to PARENT_LAST and the name of the class to be loaded seems incorrect. This may ver well be an issue of Hibernate as well. If so, please ignore.

    Spring JIRA | 8 years ago | Jose Noheda
    java.lang.NoClassDefFoundError: WEB-INF.classes.sample.jsf.PersonBean (wrong name: sample/jsf/PersonBean)
  3. 0

    All of the suden java.lang.NoClassDefFoundError and class is there (WebSphere forum at Coderanch)

    coderanch.com | 6 months ago
    java.lang.NoClassDefFoundError: com.sun.org.apache.xerces.internal.dom.ElementNSImpl
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Can JSF 1.2 plays nice with WebSphere 6.1?

    Oracle Community | 7 years ago | 843844
    java.lang.NoClassDefFoundError: javax.servlet.jsp.tagext.JspIdConsumer
  6. 0

    All of the suden java.lang.NoClassDefFoundError and class is there

    Coderanch | 7 years ago | Cristian Curelaru
    java.lang.NoClassDefFoundError: com.sun.org.apache.xerces.internal.dom.ElementNSImpl

    29 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NoClassDefFoundError

      WEB-INF.classes.sample.jsf.PersonBean (wrong name: sample/jsf/PersonBean)

      at java.lang.ClassLoader.defineClassImpl()
    2. Java RT
      SecureClassLoader.defineClass
      1. java.lang.ClassLoader.defineClassImpl(Native Method)
      2. java.lang.ClassLoader.defineClass(ClassLoader.java:258)
      3. java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
      3 frames
    3. WebSphere
      CompoundClassLoader.loadClass
      1. com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:555)
      2. com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:506)
      3. com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:389)
      3 frames
    4. Java RT
      Class.forName
      1. java.lang.ClassLoader.loadClass(ClassLoader.java:597)
      2. java.lang.Class.forNameImpl(Native Method)
      3. java.lang.Class.forName(Class.java:163)
      3 frames
    5. Hibernate
      ReflectHelper.classForName
      1. org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:112)
      1 frame
    6. Hibernate EJB
      HibernatePersistence.createContainerEntityManagerFactory
      1. org.hibernate.ejb.Ejb3Configuration.classForName(Ejb3Configuration.java:1008)
      2. org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1080)
      3. org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:871)
      4. org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:758)
      5. org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:425)
      6. org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:131)
      6 frames
    7. Spring ORM
      LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory
      1. org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:224)
      1 frame