5 Replies Latest reply on Oct 19, 2010 10:07 AM by Alvaro Rettich

    ClassNotFoundException on JBoss AS 5.1.0.GA

    Marius Bogoevici Newbie

      Running the numberguess sample in a plain JBoss AS 5.1.0.GA (freshly extracted sample, freshly exctracted AS) yields a ClassNotFoundException:


      00:00:48,807 INFO  [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 45s:151ms
      00:00:49,402 INFO  [WebBeansBootstrap] Web Beans 1.0.0.PREVIEW1
      00:00:49,585 ERROR [AbstractKernelController] Error installing to Start: name=vfszip:/home/marius/Work/jboss/webbeans/examples/numberguess/target/webbeans-numberguess.war/_WebBeansBootstrapBean state=Create
      java.lang.NoClassDefFoundError: Ljavax/enterprise/inject/Instance;
              at java.lang.Class.getDeclaredFields0(Native Method)
              at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
              at java.lang.Class.getDeclaredFields(Class.java:1743)
              at org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl.<init>(AnnotatedClassImpl.java:127)
              at org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl.of(AnnotatedClassImpl.java:108)



      Looking deeper into the stacktrace, it seems that jsr299-api.jar is not even found on the classpath of the deployer:


      Caused by: java.lang.ClassNotFoundException: javax.enterprise.inject.Instance from BaseClassLoader@12879b15{VFSClassLoaderPolicy@4d68934{name=vfszip:/home/marius/Work/jboss/webbeans/examples/numberguess/target/webbeans-numberguess.war/ domain=ClassLoaderDomain@644b67bc{name=vfszip:/home/marius/Work/jboss/webbeans/examples/numberguess/target/webbeans-numberguess.war/ parentPolicy=AFTER_BUT_JAVA_BEFORE parent=ClassLoaderDomain@181b7c76{DefaultDomain}} roots=[MemoryContextHandler@550090599[path= context=vfsmemory://3j011-humt78-fvq32syd-1-fvq33rk1-9o real=vfsmemory://3j011-humt78-fvq32syd-1-fvq33rk1-9o], ZipEntryHandler@455597058[path=WEB-INF/classes context=file:/home/marius/Work/jboss/webbeans/examples/numberguess/target/webbeans-numberguess.war real=file:/home/marius/Work/jboss/webbeans/examples/numberguess/target/webbeans-numberguess.war/WEB-INF/classes], DelegatingHandler@1440552251[path=WEB-INF/lib/el-ri-1.2.jar context=file:/home/marius/Work/jboss/webbeans/examples/numberguess/target/webbeans-numberguess.war real=file:/home/marius/Work/jboss/webbeans/examples/numberguess/target/webbeans-numberguess.war/WEB-INF/lib/el-ri-1.2.jar], DelegatingHandler@631046279[path=WEB-INF/lib/jsf-facelets-1.1.15.B1.jar context=file:/home/marius/Work/jboss/webbeans/examples/numberguess/target/webbeans-numberguess.war real=file:/home/marius/Work/jboss/webbeans/examples/numberguess/target/webbeans-numberguess.war/WEB-INF/lib/jsf-facelets-1.1.15.B1.jar], DelegatingHandler@1720562267[path=webbeans.deployer/lib-int/webbeans-core.jar context=file:/opt/jboss/jboss-5.1.0.GA/server/default/deployers/ real=file:/opt/jboss/jboss-5.1.0.GA/server/default/deployers/webbeans.deployer/lib-int/webbeans-core.jar], FileHandler@1622714614[path=webbeans.deployer/lib-int/faces context=file:/opt/jboss/jboss-5.1.0.GA/server/default/deployers/ real=file:/opt/jboss/jboss-5.1.0.GA/server/default/deployers/webbeans.deployer/lib-int/faces/]]  delegates=null exported=[, com.sun.facelets.tag, org.jboss.webbeans.examples.numberguess, com.sun.facelets, com.sun.facelets.impl, org.jboss.webbeans.bean.standard, META-INF.rsc, org.jboss.webbeans.xml.registrator.bean, org.jboss.webbeans.bean, com.sun.el.lang, org.jboss.webbeans.util.collections.multi, org.jboss.webbeans.xml, com.sun.facelets.tag.jsf.core, com.sun.facelets.tag.jsf.html, org.jboss.webbeans.bean.ee, org.jboss.webbeans.persistence, org.jboss.webbeans.util, org.jboss.webbeans.util.collections, com.sun.el.parser, com.sun.facelets.util, org.jboss.webbeans.xml.checker.beanchildren.impl, org.jboss.webbeans.context.beanstore, com.sun.el, META-INF.maven.org.jboss.webbeans.webbeans-core, com.sun.facelets.tag.jstl.fn, org.jboss.webbeans.injection.resolution, org.jboss.webbeans.bean.ee.jms, com.sun.facelets.tag.jsf, org.jboss.webbeans.util.reflection, org.jboss.webbeans.xml.registrator.bean.impl, org.jboss.webbeans.xml.checker.beanchildren, org.jboss.webbeans.jsf, org.jboss.webbeans.introspector.jlr, org.jboss.webbeans.el, org.jboss.webbeans.resources, org.jboss.webbeans.context, org.jboss.webbeans.bootstrap, org.jboss.webbeans.ejb, org.jboss.webbeans.event, org.jboss.webbeans.conversation, org.jboss.webbeans.injection, org.jboss.webbeans.literal, org.jboss.webbeans.servlet, com.sun.el.util, org.jboss.webbeans.metadata, com.sun.facelets.tag.ui, org.jboss.webbeans.bean.proxy, META-INF, org.jboss.webbeans, ee, org.jboss.webbeans.introspector, com.sun.facelets.compiler, com.sun.facelets.tag.jstl.core, com.sun.facelets.el, org.jboss.webbeans.xml.checker.beanchildren.ext, org.jboss.webbeans.xml.registrator.bean.ext, com.sun.facelets.component] <IMPORT-ALL>NON_EMPTY}}
              at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:448)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
              at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
              ... 109 more



      This looks pretty basic to me, so I am wondering if anyone has encountered this before and/or knows of way around it.


      Thanks,
      Marius