2 Replies Latest reply on May 25, 2011 10:25 AM by bemar

    ClassNotFound Exception after Jboss 5.1 start - after hot deployment working

    bemar

      Hello,


      I have a strange behavior of my project.
      When I start the Jboss 5.1 Server with the seam 2.2.0 project I get the stacktrace below.
      When I rebuild and hot-deploy the same code into the server everything works fine.


      It exactly happens with my DAO object inside a quartz processor discussed in thread
      Seam Thread QuartzNotWorking.


      Do someone have the same behavior or do someone has a Idea what it could be?


      Thx in forward for your help


      Ben



      org.jboss.seam.InstantiationException: Could not instantiate Seam component: mailqueueDAO
           at org.jboss.seam.Component.newInstance(Component.java:2144)
           at org.jboss.seam.Component.getInstance(Component.java:2021)
           at org.jboss.seam.Component.getInstance(Component.java:1983)
           at org.jboss.seam.Component.getInstance(Component.java:1977)
           at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2349)
           at org.jboss.seam.Component.getValueToInject(Component.java:2301)
           at org.jboss.seam.Component.injectAttributes(Component.java:1736)
           at org.jboss.seam.Component.inject(Component.java:1554)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:52)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
           at ch.bemar.creditfriend.quartz.ScheduleProcessor_$$_javassist_seam_3.createEjbTimer(ScheduleProcessor_$$_javassist_seam_3.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
           at org.jboss.seam.async.AsynchronousInvocation$1.process(AsynchronousInvocation.java:62)
           at org.jboss.seam.async.Asynchronous$ContextualAsynchronousRequest.run(Asynchronous.java:80)
           at org.jboss.seam.async.AsynchronousInvocation.execute(AsynchronousInvocation.java:44)
           at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:243)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
      Caused by: javax.naming.NamingException: Could not dereference object [Root exception is java.lang.RuntimeException: Can not find interface declared by Proxy in our CL + BaseClassLoader@181f91a{vfszip:/E:/jboss-5.1.0.GA/server/default/deploy/quartz-ra.rar/}]
           at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1504)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:822)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
           at javax.naming.InitialContext.lookup(Unknown Source)
           at org.jboss.seam.Component.instantiateSessionBean(Component.java:1400)
           at org.jboss.seam.Component.instantiate(Component.java:1364)
           at org.jboss.seam.Component.newInstance(Component.java:2122)
           ... 33 more
      Caused by: java.lang.RuntimeException: Can not find interface declared by Proxy in our CL + BaseClassLoader@181f91a{vfszip:/E:/jboss-5.1.0.GA/server/default/deploy/quartz-ra.rar/}
           at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.redefineProxyInTcl(ProxyObjectFactory.java:343)
           at org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:134)
           at org.jboss.ejb3.proxy.impl.objectfactory.session.stateless.StatelessSessionProxyObjectFactory.getProxy(StatelessSessionProxyObjectFactory.java:79)
           at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:158)
           at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
           at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1479)
           at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1496)
           ... 39 more
      Caused by: java.lang.ClassNotFoundException: ch.bemar.creditfriend.action.MailqueueDAO from BaseClassLoader@181f91a{VFSClassLoaderPolicy@95b5c{name=vfszip:/E:/jboss-5.1.0.GA/server/default/deploy/quartz-ra.rar/ domain=ClassLoaderDomain@1d38b87{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@183f74d} roots=[MemoryContextHandler@5049504[path= context=vfsmemory://5c4o02w-56wfab-go4c8yfu-1-go4c9cbu-23 real=vfsmemory://5c4o02w-56wfab-go4c8yfu-1-go4c9cbu-23], DelegatingHandler@7868895[path=quartz-ra.rar context=file:/E:/jboss-5.1.0.GA/server/default/deploy/ real=file:/E:/jboss-5.1.0.GA/server/default/deploy/quartz-ra.rar], DelegatingHandler@14505228[path=quartz-ra.rar/quartz-ra.jar context=file:/E:/jboss-5.1.0.GA/server/default/deploy/ real=file:/E:/jboss-5.1.0.GA/server/default/deploy/quartz-ra.rar/quartz-ra.jar]]  delegates=null exported=[org.jboss.resource.adapter.quartz.inflow, META-INF] <IMPORT-ALL>NON_EMPTY}}
           at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:448)
           at java.lang.ClassLoader.loadClass(Unknown Source)
           at java.lang.ClassLoader.loadClassInternal(Unknown Source)
           at java.lang.Class.forName0(Native Method)
           at java.lang.Class.forName(Unknown Source)
           at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.redefineProxyInTcl(ProxyObjectFactory.java:339)
           ... 45 more
      



        • 1. Re: ClassNotFound Exception after Jboss 5.1 start - after hot deployment working
          bemar

          Here's MailqueueDAO and ...Impl


          import java.util.List;
          
          import javax.ejb.Local;
          
          import ch.bemar.creditfriend.action.util.GenericDAO;
          import ch.bemar.creditfriend.model.Mailqueue;
          import ch.bemar.creditfriend.model.Person;
          
          @Local
          public interface MailqueueDAO extends GenericDAO<Mailqueue, Long>
          {
          
              Mailqueue findById(Long id);
              
              List<Mailqueue> getAllUnsend();
              
              Mailqueue createAndSaveNew(Person p, String path);
              
              Mailqueue updateMailqueue(Mailqueue m);
          
          }
          






          import java.sql.Timestamp;
          import java.util.ArrayList;
          import java.util.List;
          
          import javax.ejb.Stateless;
          import javax.persistence.NoResultException;
          import javax.persistence.Query;
          
          import org.jboss.seam.annotations.AutoCreate;
          import org.jboss.seam.annotations.Logger;
          import org.jboss.seam.annotations.Name;
          import org.jboss.seam.log.Log;
          
          import ch.bemar.creditfriend.action.util.GenericDAOSeamJPAImpl;
          import ch.bemar.creditfriend.model.Mailqueue;
          import ch.bemar.creditfriend.model.Person;
          
          @Stateless
          @Name("mailqueueDAO")
          @AutoCreate
          public class MailqueueDAOImpl extends GenericDAOSeamJPAImpl<Mailqueue, Long> implements MailqueueDAO
          {
              @Logger
              private Log log;
          
              @Override
              public Mailqueue createAndSaveNew(Person p, String path)
              {
                  Mailqueue m = new Mailqueue();
                  m.setPerson(p);
                  m.setTemplatePath(path);
                  m.setNameModuser(p.getNameUsername());
                  this.entityManager.persist(m);
                  return m;
              }
          
              @Override
              public List<Mailqueue> getAllUnsend()
              {
                  String sql = "from Mailqueue mailqueue where mailqueue.send = false";
          
                  Query query = this.entityManager.createQuery(sql);
                  List<Object> objList = new ArrayList<Object>();
                  List<Mailqueue> mailList = new ArrayList<Mailqueue>();
                  try
                  {
                      objList = query.getResultList();
                  } catch (NoResultException ex)
                  {
                  }
          
                  if (objList != null && objList.size() > 0 && objList.get(0) instanceof Mailqueue)
                  {
                      mailList = new ArrayList<Mailqueue>();
                      for (Object o : objList)
                      {
                          mailList.add((Mailqueue) o);
                      }
                  }
                  return mailList;
              }
          
              @Override
              public Mailqueue findById(Long id)
              {
                  String sql = "from Mailqueue mailqueue where mailqueue.idMail = ? ";
          
                  Query query = this.entityManager.createQuery(sql);
                  query.setParameter(1, id);
                  Object obj = null;
                  try
                  {
                      obj = query.getSingleResult();
                  } catch (NoResultException ex)
                  {
                  }
          
                  if (obj != null && obj instanceof Mailqueue)
                  {
                      Mailqueue p = (Mailqueue) obj;
                      return p;
                  }
                  return null;
              }
          
              @Override
              public Mailqueue updateMailqueue(Mailqueue m)
              {
                  m.setModiDate(new Timestamp(System.currentTimeMillis()));
                  this.entityManager.persist(m);        
                  return m;
              }
          }
          





          • 2. Re: ClassNotFound Exception after Jboss 5.1 start - after hot deployment working
            bemar

            Found some other threads with that issue.


            Seems to be a class load problem with the quartz library.


            After putting the quartz.jar into my deployment lib it is working without any errors at server start.