1 Reply Latest reply on Mar 2, 2010 11:37 AM by jaikiran pai

    EJB3 SLBS access from a quartz job results in ClassNotFoundExceptions, working now about 8 hours on that :-(...

    Michael Obster Newbie

      Hi,

       

      have some big problems accessing an EJB3 SLBS from a quartz job on JBoss 5.1.0. I always getting an error like this:

       

      This the error:

      17:08:10,041 ERROR [JobRunShell] Job default.job.0.1267546069637 threw an unhandled Exception: 
      javax.ejb.EJBTransactionRolledbackException: Unable to inject jndi dependency: env/vwg.audi.cancard.business.scheduler.jobs.StateCheckJob/stateFacade into property vwg.audi.cancard.business.scheduler.jobs.StateCheckJob.stateFacade: vwg.audi.cancard.business.facade.StateFacade from BaseClassLoader@517f0c{VFSClassLoaderPolicy@6c11eb{name=vfszip:/D:/server/jboss_cancard/server/default/deploy/quartz-ra.rar/ domain=ClassLoaderDomain@63a8af{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@1ea5671} roots=[MemoryContextHandler@17599419[path= context=vfsmemory://a6z3s46-c42kit-g6aw5jhs-1-g6aw5ydo-22 real=vfsmemory://a6z3s46-c42kit-g6aw5jhs-1-g6aw5ydo-22], DelegatingHandler@11118241[path=quartz-ra.rar context=file:/D:/server/jboss_cancard/server/default/deploy/ real=file:/D:/server/jboss_cancard/server/default/deploy/quartz-ra.rar], DelegatingHandler@33202086[path=quartz-ra.rar/quartz-ra.jar context=file:/D:/server/jboss_cancard/server/default/deploy/ real=file:/D:/server/jboss_cancard/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.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:115)
           at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
           at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:194)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:80)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:282)
           at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:270)
           at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:140)
           at $Proxy347.execute(Unknown Source)
           at org.jboss.resource.adapter.quartz.inflow.QuartzJob.execute(QuartzJob.java:57)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
      Caused by: java.lang.RuntimeException: Unable to inject jndi dependency: env/vwg.audi.cancard.business.scheduler.jobs.StateCheckJob/stateFacade into property vwg.audi.cancard.business.scheduler.jobs.StateCheckJob.stateFacade: vwg.audi.cancard.business.facade.StateFacade from BaseClassLoader@517f0c{VFSClassLoaderPolicy@6c11eb{name=vfszip:/D:/server/jboss_cancard/server/default/deploy/quartz-ra.rar/ domain=ClassLoaderDomain@63a8af{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@1ea5671} roots=[MemoryContextHandler@17599419[path= context=vfsmemory://a6z3s46-c42kit-g6aw5jhs-1-g6aw5ydo-22 real=vfsmemory://a6z3s46-c42kit-g6aw5jhs-1-g6aw5ydo-22], DelegatingHandler@11118241[path=quartz-ra.rar context=file:/D:/server/jboss_cancard/server/default/deploy/ real=file:/D:/server/jboss_cancard/server/default/deploy/quartz-ra.rar], DelegatingHandler@33202086[path=quartz-ra.rar/quartz-ra.jar context=file:/D:/server/jboss_cancard/server/default/deploy/ real=file:/D:/server/jboss_cancard/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.injection.JndiPropertyInjector.lookup(JndiPropertyInjector.java:82)
           at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:99)
           at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:89)
           at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:61)
           at org.jboss.ejb3.injection.InjectionInvocation.invokeTarget(InjectionInvocation.java:89)
           at org.jboss.ejb3.injection.InjectionInvocation.invokeNext(InjectionInvocation.java:83)
           at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
           at org.jboss.ejb3.injection.InjectionInvocation.invokeNext(InjectionInvocation.java:74)
           at org.jboss.ejb3.EJBContainer.injectBeanContext(EJBContainer.java:1086)
           at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:83)
           at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:73)
           at org.jboss.ejb3.pool.StrictMaxPool.get(StrictMaxPool.java:146)
           at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:58)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
           ... 17 more
      Caused by: javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NamingException: Could not dereference object [Root exception is java.lang.RuntimeException: Can not find interface declared by Proxy in our CL + BaseClassLoader@517f0c{vfszip:/D:/server/jboss_cancard/server/default/deploy/quartz-ra.rar/}]]
           at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1352)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:817)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
           at org.jboss.ejb3.JndiUtil.lookup(JndiUtil.java:44)
           at org.jboss.injection.JndiPropertyInjector.lookup(JndiPropertyInjector.java:75)
           ... 31 more
      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@517f0c{vfszip:/D:/server/jboss_cancard/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(InitialContext.java:392)
           at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1346)
           ... 35 more
      Caused by: java.lang.RuntimeException: Can not find interface declared by Proxy in our CL + BaseClassLoader@517f0c{vfszip:/D:/server/jboss_cancard/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(NamingManager.java:304)
           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: vwg.audi.cancard.business.facade.StateFacade from BaseClassLoader@517f0c{VFSClassLoaderPolicy@6c11eb{name=vfszip:/D:/server/jboss_cancard/server/default/deploy/quartz-ra.rar/ domain=ClassLoaderDomain@63a8af{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@1ea5671} roots=[MemoryContextHandler@17599419[path= context=vfsmemory://a6z3s46-c42kit-g6aw5jhs-1-g6aw5ydo-22 real=vfsmemory://a6z3s46-c42kit-g6aw5jhs-1-g6aw5ydo-22], DelegatingHandler@11118241[path=quartz-ra.rar context=file:/D:/server/jboss_cancard/server/default/deploy/ real=file:/D:/server/jboss_cancard/server/default/deploy/quartz-ra.rar], DelegatingHandler@33202086[path=quartz-ra.rar/quartz-ra.jar context=file:/D:/server/jboss_cancard/server/default/deploy/ real=file:/D:/server/jboss_cancard/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(ClassLoader.java:248)
           at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
           at java.lang.Class.forName0(Native Method)
           at java.lang.Class.forName(Class.java:247)
           at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.redefineProxyInTcl(ProxyObjectFactory.java:339)
           ... 45 more
      

       

      This is my job:

      package vwg.audi.cancard.business.scheduler.jobs;
      
      import javax.ejb.ActivationConfigProperty;
      import javax.ejb.EJB;
      import javax.ejb.MessageDriven;
      
      import org.apache.log4j.Logger;
      import org.jboss.ejb3.annotation.ResourceAdapter;
      import org.quartz.Job;
      import org.quartz.JobExecutionContext;
      import org.quartz.JobExecutionException;
      
      import vwg.audi.cancard.business.facade.StateFacade;
      
      /**
       * Job: State check of the cards
       * 
       * @author Michael Obster
       *
       */
      
      @MessageDriven(activationConfig =
      {@ActivationConfigProperty(propertyName = "cronTrigger", propertyValue = "*/5 * * * * ?")})
      @ResourceAdapter("quartz-ra.rar")
      public class StateCheckJob implements Job {
           @SuppressWarnings("unused")
           private static Logger logger = Logger.getLogger(StateCheckJob.class);
           
           @EJB
           private StateFacade stateFacade;
      
           /**
            * @see org.quartz.Job#execute(org.quartz.JobExecutionContext)
            *
            * {@inheritDoc}
            */
           public void execute(JobExecutionContext arg0) throws JobExecutionException {
                stateFacade.checkCancardFeedback();
                stateFacade.checkComputerFeedback();
           }
      
      }
      

       

      And this is my SLBS:

      package vwg.audi.cancard.business.facade;
      
      import javax.annotation.PostConstruct;
      import javax.ejb.EJB;
      import javax.ejb.Local;
      import javax.ejb.Stateful;
      import javax.ejb.Stateless;
      import javax.interceptor.Interceptors;
      
      import org.apache.log4j.Logger;
      import org.jboss.spring.callback.SpringLifecycleInterceptor;
      
      import vwg.audi.cancard.dao.CancardDao;
      import vwg.audi.cancard.dao.ComputerDao;
      import vwg.audi.cancard.dao.DAOFactory;
      
      /**
       * Implementation of State facade
       * 
       * @author Michael Obster (michael.obster@epos-cat.de)
       *
       */
      @Stateless
      @Local({StateFacade.class})
      public class StateFacadeBean implements StateFacade {
           @SuppressWarnings("unused")
           private Logger log = Logger.getLogger(StateFacadeBean.class);
           
           private CancardDao cancardDao;
           private ComputerDao computerDao;
           
           @EJB
           private DAOFactory daoFactory;
           
           /**
            * Inits the daos.
            */
           @PostConstruct
           public void initDao() {
                cancardDao = daoFactory.getCancardDao();
                computerDao = daoFactory.getComputerDao();
           }
      
           @Override
           public void checkCancardFeedback() {
                cancardDao.checkState();
           }
      
           @Override
           public void checkComputerFeedback() {
                computerDao.checkState();
           }
      
           
      }
      

       

       

      Anyone who can help me and give me a hint, what I'm doing wrong?

       

      Regards,

      Michael