2 Replies Latest reply on Sep 29, 2005 1:10 AM by Pieter-Jan Malfait

    EJB3.0   No ClassLoaders Problem, what a mess

    Martin Heinemann Newbie

      Hi there,

      i'm trying to get in JBoss 4.0.3-RC2 and EJB3.0 for a couple of days now.
      I just want to deploy a simlpe Session Bean but there is something living inside JBoss that beats me up.
      First my Session Bean

      package org.jboss.tutorial.stateless.beans;
      
      import javax.ejb.Stateless;
      
      @Stateless(name="Calculator")
      public class CalculatorBean
       implements Calculator, RemoteCalculator {
      
       public double calculate (int start, int end,
       double growthrate, double saving) {
       double tmp = Math.pow(1. + growthrate / 12.,
       12. * (end - start) + 1);
       return saving * 12. * (tmp - 1) / growthrate;
       }
       public String getServerInfo () {
       return "This is the JBoss EJB 3.0 TrailBlazer";
       }
      
      }
      


      The interface:
      package org.jboss.tutorial.stateless.beans;
      
      public interface Calculator {
      
       public double calculate (int start, int end,
       double growthrate, double saving);
      
       }
      


      This is the example bean from the trailhead demo.
      Ok, i use eclipse to build an ejb3 file from this with only the class files packed in.
      Jboss is up and running. While hot delpoying there are the following exceptions within JBoss and i can't figure out why tehy happen:

      11:50:45,064 INFO [JaccHelper] Initialising JACC Context for deployment: JBossTutorialStatelessBean.ejb3
      11:50:45,068 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=JBossTutorialStatelessBean.ejb3
      java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.tutorial.stateless.beans.CalculatorBean
       at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:292)
       at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:475)
       at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:377)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at org.jboss.ejb3.Ejb3AnnotationHandler.populateBaseInfo(Ejb3AnnotationHandler.java:157)
       at org.jboss.ejb3.Ejb3AnnotationHandler.getContainers(Ejb3AnnotationHandler.java:86)
       at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:289)
       at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:277)
       at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:259)
       at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:230)
       at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:217)
       at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:34)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:252)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:234)
       at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:974)
       at $Proxy0.create(Unknown Source)
       at org.jboss.system.ServiceController.create(ServiceController.java:356)
       at org.jboss.system.ServiceController.create(ServiceController.java:295)
       at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy17.create(Unknown Source)
       at org.jboss.ejb3.EJB3Deployer.create(EJB3Deployer.java:178)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:919)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:773)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:737)
       at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy9.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
      11:50:45,070 INFO [EJB3Deployer] Deployed: file:/home/heinemam/software/jbosses/jboss-4.0.3RC2/server/default/deploy/JBossTutorialStatelessBean.ejb3
      11:50:45,074 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
      
      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.j2ee:service=EJB3,module=JBossTutorialStatelessBean.ejb3
       State: FAILED
       Reason: java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.tutorial.stateless.beans.CalculatorBean
      
      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.j2ee:service=EJB3,module=JBossTutorialStatelessBean.ejb3
       State: FAILED
       Reason: java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.tutorial.stateless.beans.CalculatorBean
      


      I assume that i am not the first with this problem.
      The paradox thing is, that i build the complete TrailHead application deployed it and it worked proper.
      I've read the wiki pages concering UCL but could not find any workarounds for my problem.
      My conclusion up to now is, that there is a config file somewhere in the TrailHead Source which defines something in the jboss to not let the exception take place. But where?!

      Thanks for your help

      Martin