6 Replies Latest reply on Aug 3, 2011 4:04 PM by Taimur Mirza

    ClassNotFoundException for my local interface on Jboss7 startup

    Taimur Mirza Newbie

      I have JBoss7 Final and seam 2 application. My EJB is defined something like

       

      MyEJBBean.java

       

      @Stateless

      @AutoCreate

      @Name("MyEJB")

      @JndiName(value = "java:app/ejb-1.0/MyEJBBean")

      public class MyEJBBean implements MyEJB {

          .

          .

          .

      }

       

       

      and corresponding local interface is defined as

       

      MyEJB.java

      @Local

      public interface MyEJB{

          .

          .

          .

      }

       

      Both of above are in the same my-ejb.jar

       

      Components.xml

       

      <!-- <core:init jndi-pattern="my-app/#{ejbName}/local"/> -->

       

      JNDI pattern is commented as I am using JBoss 7. Now I am getting ClassNotFoundException for my local interface on Jboss startup.  Any idea???

       

      Caused by: javassist.CannotCompileException: by java.lang.NoClassDefFoundError: com/my/MyEJB

              at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:169) [javassist-3.12.1.GA.jar:3.12.0.GA]

              at org.jboss.seam.util.ProxyFactory.createClass3(ProxyFactory.java:352) [jboss-seam-2.2.2.Final.jar:]

              ... 72 more

      Caused by: java.lang.NoClassDefFoundError: com/my/MyEJB

              at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_12]

              at java.lang.ClassLoader.defineClass(ClassLoader.java:621) [:1.6.0_12]

              at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) [:1.6.0_12]

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_12]

              at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_12]

              at javassist.util.proxy.FactoryHelper.toClass2(FactoryHelper.java:181) [javassist-3.12.1.GA.jar:3.12.0.GA]

              at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:163) [javassist-3.12.1.GA.jar:3.12.0.GA]

              ... 73 more

      Caused by: java.lang.ClassNotFoundException: com.my.MyEJB from [Module "deployment.my-app.ear:main" from Service Module Loader]

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191) [jboss-modules.jar:1.0.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358) [jboss-modules.jar:1.0.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330) [jboss-modules.jar:1.0.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330) [jboss-modules.jar:1.0.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330) [jboss-modules.jar:1.0.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307) [jboss-modules.jar:1.0.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101) [jboss-modules.jar:1.0.1.GA]

              at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) [:1.6.0_12]

              ... 80 more