10 Replies Latest reply on Sep 28, 2005 9:49 AM by jaikiran

    What does no classloaders found mean ?

    andrewi

      what does this mean ?

      05:24:29,546 WARN [ServiceController] Problem starting service jboss.j2ee:service=EJB3,module=jfrentity.ejb3
      java.lang.RuntimeException: java.lang.ClassNotFoundException: No ClassLoaders found for: com.meerkat.jfr.par.Address
      at org.jboss.ejb3.Ejb3Module.createHibernateSessionFactory(Ejb3Module.java:218)
      at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:263)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
      at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      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:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:897)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:418)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      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:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy16.start(Unknown Source)
      at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:166)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
      at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      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:121)
      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:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy8.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:325)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:501)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:277)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
      at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      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:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:897)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:418)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      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:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:273)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:722)
      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.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:121)
      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:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:434)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:315)
      at org.jboss.Main.boot(Main.java:195)
      at org.jboss.Main$1.run(Main.java:463)
      at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: com.meerkat.jfr.par.Address
      at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:198)
      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(Unknown Source)
      at org.jboss.ejb3.Ejb3Module.createHibernateSessionFactory(Ejb3Module.java:214)

        • 1. Re: What does no classloaders found mean ?
          gulaplaarajasekhar

          The container is not able to load com.meerkat.jfr.par.Address class and so the ClassNotFound Exception
          It might be due to various reasons. Few which I know are

          1. If we user more than 1 container, then there should be mapping in one container saying the path of the other container.

          2. If using only one container, then the path is not set correctly..


          Rajasekhar

          • 2. Re: What does no classloaders found mean ?
            andrewi

             

            "gulaplaarajasekhar" wrote:
            The container is not able to load com.meerkat.jfr.par.Address class and so the ClassNotFound Exception
            It might be due to various reasons. Few which I know are

            1. If we user more than 1 container, then there should be mapping in one container saying the path of the other container.

            2. If using only one container, then the path is not set correctly..


            Rajasekhar


            Hi Rajasekhar,

            can you give me more info ?

            Thanks
            Andrew

            • 3. Re: What does no classloaders found mean ?
              gulaplaarajasekhar

              Hi Andrew,

              For the first case,
              Assume we have 2 webserver/appserver for e.g., jboss and tomcat, then it is not possible to access a file present in tomcat under a.b.c.Src where a.b.c.Src is a class from jboss by default.

              Because the jboss classloader doesn't know anything about it.
              But if we are able to tell the jboss classloader to see even in the other classloader(the path is given in some files), then we can have a case where we deploy our classfiles in tomcat and can able to access it in the jboss also, without any duplicate classes.

              In the second case,
              the classpath has to be set correctly. -- If you need some more information about this you shld the documnetation of that particular server.

              • 4. Re: What does no classloaders found mean ?
                twojenski

                Hello gulapalarajasekhar

                Thank you for your response to the above question, however if you could be more specific that would be very much appreciated.

                I have a situation where I have a (1) and web application and (1) ejb module inside of the Enterprise App (.ear). The 2 problems that I have are:
                1) If i use Class.forName("foo") from inside of the main jar of the web app to call "foo" class inside a different package in a different jar of the same web application, I get the "java.lang.ClassNotFoundException: No ClassLoaders found for: foo" error. If I re-jar the web application and create one big jar, this is no longer a problem. As you can imagine this is not a practical solution. If I just deploy my web app by itself in tomcat, I do not have a problem.

                2) I want to call an EJB from the web application in the ejb module. From your explanation above, I'm certainly crossing over the container spaces.

                Would you be able to give us concrete instructions as to how to solve the 2 problems? If you can point me to some examples or files where this addressability it shown that would be great.

                Thanks

                Tek

                • 5. Re: What does no classloaders found mean ?
                  raja05

                  Regarding your point No. 1 above, you should *never* use Class.forName unless u want to load one of the standard java classes. Loading classes dynamically should be done using
                  Thread.currentThread().getContextClassLoader().getClass("foo").

                  Please refer to http://wiki.jboss.org/wiki/Wiki.jsp?page=HowCanIDynamicallyLoadClassesWithinAnMBean

                  • 6. Re: What does no classloaders found mean ?
                    twojenski

                    Thanks Raja05

                    Thank you for putting me on the right path. By using currentThread() I was able to resolve my immediate problem.

                    Maybe you can answer another question that I have with this deployment. As I described above I have the Duke's Bank with 1 EBJ project and 2 web app projects. I have added a new web project that is why there are 2 web apps and not one. My intention is to call an EJB from my new web app in the EJB project. I used the Duke's Bank web app project as a model. The main difference Duke's Bank web project and my web app project is that I want to have a back end java class call an EJB with generating any JSP code. So the problem that I'm running into is that when the call to the EJB is made JBoss can not locate the users.properties file. Now I have placed the users.properties file in the WEB-INF/classes dir of my web app, and still the same problem. Also, I do not have code in my web app that authenticates the user (do I absolutely need it?), and I also tried to make the org.jboss.security.ClientLoginModule optional in the config files. Is there any easy way to allow the web module not be authenticated before calling the EJBs? If authentication is required how is it done? Can it be done with config files, or is it done with java code, or both?

                    Any suggestions? Below is a JBoss error message:

                    09:34:58,796 ERROR [UsersRolesLoginModule] Failed to load users/passwords/role files
                    java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found
                    at org.jboss.security.auth.spi.Util.loadProperties(Util.java:249)
                    at org.jboss.security.auth.spi.UsersRolesLoginModule.loadUsers(UsersRolesLoginModule.java:164)
                    at org.jboss.security.auth.spi.UsersRolesLoginModule.initialize(UsersRolesLoginModule.java:111)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:585)
                    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:756)
                    at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
                    at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
                    at java.security.AccessController.doPrivileged(Native Method)
                    at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
                    at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
                    at org.jboss.security.plugins.JaasSecurityManager.defaultLogin(JaasSecurityManager.java:483)
                    at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:425)
                    at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:251)
                    at org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityAssociation(SecurityInterceptor.java:180)
                    at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:106)
                    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:212)
                    at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invokeHome(StatefulSessionInstanceInterceptor.java:127)
                    at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
                    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
                    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
                    at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:146)
                    at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
                    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
                    at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:613)
                    at org.jboss.ejb.Container.invoke(Container.java:894)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    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:249)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
                    at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
                    at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
                    at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
                    at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
                    at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
                    at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
                    at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
                    at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
                    at $Proxy79.create(Unknown Source)
                    at com.itgp.bank.DataModel.getAccounts(DataModel.java:152)

                    • 7. Re: What does no classloaders found mean ?
                      raja05

                      Again, how are you loading the property file? You should use something like
                      Thread.currentThread().getContextClassLoader().getResource("users.properties")

                      That should get you the users.properties if its in the WEB-INF/classes. As far your other question, i havent done much JAAS programming , you might get some answers if u ask the question in the jaas forum for jboss.

                      • 8. Re: What does no classloaders found mean ?
                        twojenski

                        I'm not loading the user.properties file directly, JBoss does that and not my code.

                        I think what I'm asking is JBoss specific, right?

                        Tek

                        • 9. Re: What does no classloaders found mean ?
                          jaikiran

                          Have you packaged your web apps and EJBs in an ear? If yes, then place the users.properties directly under the ear

                          • 10. Re: What does no classloaders found mean ?
                            jaikiran

                            As far as diabling the authentication is concerned, i guess you can remove the following statement from the jboss.xml of your EJB module:

                            <security-domain>java:/jaas/http-invoker</security-domain>