2 Replies Latest reply on Sep 1, 2006 11:48 PM by jaikiran pai

    java.lang.ClassNotFoundException: No ClassLoaders found

    charlie cha Newbie

      I try to call a class which is not in ejb-jar.xml using Class.forName() from whithin EJB session bean as below.
      But it give me the ClassNotFoundException error.

      Any idea to overcome this ???

      try {
       v = (PromoValidator) Class.forName("rpc.util.validators.Validator" + promoCode).newInstance();
       }
       catch (Exception e) {
       System.out.println("=== PromoValidator for " + promoCode + " was not created");
       e.printStackTrace();
      
       }
      


      16:54:49,156 ERROR [STDERR] java.lang.ClassNotFoundException: No ClassLoaders found for: rpc.util.validators.ValidatorFMP2004
      16:54:49,156 ERROR [STDERR] at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
      16:54:49,156 ERROR [STDERR] at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:511)
      16:54:49,156 ERROR [STDERR] at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
      16:54:49,156 ERROR [STDERR] at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
      16:54:49,156 ERROR [STDERR] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
      16:54:49,156 ERROR [STDERR] at java.lang.Class.forName0(Native Method)
      16:54:49,156 ERROR [STDERR] at java.lang.Class.forName(Class.java:141)
      16:54:49,171 ERROR [STDERR] at rpc.util.PromoValidator.getValidator(PromoValidator.java:35)
      16:54:49,171 ERROR [STDERR] at rpc.services.promotion.ejb.PromotionEJB.getPromoStatusString(PromotionEJB.java:839)
      16:54:49,171 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      16:54:49,171 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      16:54:49,171 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      16:54:49,171 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
      16:54:49,171 ERROR [STDERR] at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
      16:54:49,171 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
      16:54:49,171 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
      16:54:49,171 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
      16:54:49,171 ERROR [STDERR] at org.jboss.ws.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:64)
      16:54:49,171 ERROR [STDERR] at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
      16:54:49,171 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
      16:54:49,187 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
      16:54:49,187 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
      16:54:49,187 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
      16:54:49,187 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
      16:54:49,187 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
      16:54:49,187 ERROR [STDERR] at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
      16:54:49,187 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:954)
      16:54:49,187 ERROR [STDERR] at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430)
      16:54:49,203 ERROR [STDERR] at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)
      16:54:49,203 ERROR [STDERR] at $Proxy145.getPromoStatusString(Unknown Source)
      16:54:49,203 ERROR [STDERR] at rpc.de.web.struts.action.subscriber.UpdateSubscriberAction.doExecute(UpdateSubscriberAction.java:63)
      16:54:49,203 ERROR [STDERR] at rpc.de.web.struts.action.BaseAction.execute(BaseAction.java:64)
      16:54:49,203 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
      16:54:49,203 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
      16:54:49,203 ERROR [STDERR] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
      16:54:49,203 ERROR [STDERR] at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
      16:54:49,218 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
      16:54:49,218 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      16:54:49,218 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      16:54:49,218 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      16:54:49,218 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      16:54:49,218 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      16:54:49,218 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      16:54:49,218 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      16:54:49,218 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      16:54:49,218 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      16:54:49,218 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      16:54:49,218 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      16:54:49,500 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      16:54:49,500 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      16:54:49,500 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      16:54:49,500 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      16:54:49,500 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      16:54:49,500 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      16:54:49,500 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      16:54:49,500 ERROR [STDERR] at java.lang.Thread.run(Thread.java:534)