8 Replies Latest reply on Apr 9, 2008 2:16 AM by Miguel Marques

    No class loaders found

    mailinator Novice

      Hi,
      i'm back !!!
      With a new issue.

      Here it is :
      when trying to end a taskinstance, i got this exception :

      java.lang.ClassCastException: org.jbpm.scheduler.ejbtimer.EjbSchedulerServiceFactory

      This is because i have multiple deployment of jbpm jar.
      When deleting this jbpm-jpdl.jar from the /WEB-INF/lib of my webapp,
      i have an exception earlier in the process !!
      I cant even access the variable instance that i put with the task. (i can when i put the jar in the webapp but later in the process when trying to end the task it fail).

      I have this exception :

      javax.servlet.ServletException: org.jbpm.JbpmException: couldn't deserialize object

      caused by :

      org.jbpm.JbpmException: couldn't deserialize object


      caused by :

      java.lang.ClassNotFoundException: No ClassLoaders found for: com.it.model.User

      Any help would be greatly appreciated.

      Regards,

      O.M.

        • 1. Re: No class loaders found
          mailinator Novice

          Hi,
          i have some more information.
          jbpm is trying to end the process when this error occurs.

          Stack

          java.lang.ClassCastException: org.jbpm.scheduler.ejbtimer.EjbSchedulerServiceFactory
          org.jbpm.svc.Services.getServiceFactory(Services.java:122)
          org.jbpm.svc.Services.getService(Services.java:139)
          org.jbpm.svc.Services.getCurrentService(Services.java:88)
          org.jbpm.graph.exe.ProcessInstance.end(ProcessInstance.java:328)


          thanks for helping,

          regards,

          O.M.

          • 2. Re: No class loaders found
            mailinator Novice

            Hi again,
            i wwas wondering : what is the relation beetween the EjbSchedulerService and ending a process instance ?

            I'm wondering because it's seems that its related to my problem.

            Regards,

            O.M.

            • 3. Re: No class loaders found
              Edward Staub Expert

              It's trying to instantiate a scheduler in order to kill off all the timers in use by the process.

              (I know, there probably aren't any timers in your case.)

              It looks like the underlying problem is this:

              java.lang.ClassNotFoundException: No ClassLoaders found for: com.it.model.User


              I don't recognize the class. Do you know what it is?

              -Ed Staub

              • 4. Re: No class loaders found
                mailinator Novice

                Hi Ed,
                thanks for helping.
                the class you are refering to is mine.
                Its my User class.
                What i am trying to do is : putting that user in the variable instance. Doing my things. Taking back the user.


                LAST developpements :
                i took the part of code which was suspicious :

                taskInstance.end

                and i put it somewhere else in my action.

                and i have only one exception now :

                java.lang.ClassCastException: org.jbpm.scheduler.ejbtimer.EjbSchedulerServiceFactory
                org.jbpm.svc.Services.getServiceFactory(Services.java:122)
                org.jbpm.svc.Services.getService(Services.java:139)
                org.jbpm.svc.Services.getCurrentService(Services.java:88)
                org.jbpm.graph.exe.ProcessInstance.end(ProcessInstance.java:328)

                Its seems that jbpm is trying to end the process instance (wich is nice) but fail to do so. It try to end the instance because my task is the last one of he process.

                I cant seem to understand why jbpm cant find the right class for that EjbSchedulerService thing.

                Regards,

                O.M.

                • 5. Re: No class loaders found
                  Edward Staub Expert

                  I said earlier that it was failing trying to instantiate the ServiceFactory. That's not exactly right. It's failing in casting it to a ServiceFactory.
                  "org.jbpm.scheduler.ejbtimer.EjbSchedulerServiceFactory" is indeed a ServiceFactory, the only thing I can think of is that ServiceFactory and EjbSchedulerServiceFactory are being loaded by two different classloaders that are fetching them from different places. So I'd be looking for "competing" deployments of the jbpm jarfiles.

                  -Ed Staub

                  • 6. Re: No class loaders found
                    mailinator Novice

                    Hi Ed,
                    thanks again for helping,
                    i searched that way and i found multiple deployment of the jbpm-jpdl.jar.
                    While removing that redundant deployement i got another exception (i'm trying to read some instance variable of type com.it.model.User) :

                    javax.servlet.ServletException: org.jbpm.JbpmException: couldn't deserialize object

                    caused by :

                    org.jbpm.JbpmException: couldn't deserialize object
                    org.jbpm.context.exe.converter.SerializableToByteArrayConverter.revert(SerializableToByteArrayConverter.java:66)
                    org.jbpm.context.exe.VariableInstance.getValue(VariableInstance.java:147)


                    caused by :

                    java.lang.ClassNotFoundException: No ClassLoaders found for: com.it.model.User
                    org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
                    org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:514)
                    org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:408)
                    java.lang.ClassLoader.loadClass(ClassLoader.java:251)
                    java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
                    java.lang.Class.forName0(Native Method)
                    java.lang.Class.forName(Class.java:242)


                    Regards,

                    O.M.

                    • 7. Re: No class loaders found
                      Edward Staub Expert

                      com.it.model.User must be serializable. Is it?

                      The code for it must be accessible in either the process deployment or in the JBPM classpath. Is it?

                      -Ed Staub

                      • 8. Re: No class loaders found
                        Miguel Marques Newbie

                        hi,

                        have you found a solution to your problem?
                        because i've the same problem...
                        thanks