1 2 Previous Next 23 Replies Latest reply on Nov 9, 2009 5:51 AM by sebastian.s

    JpdlProcessDefinition cannot be cast to java.util.List

    remiel512

      === Environment ==============================
      - jBPM Version : 4.1
      - Database : oracle
      - JDK : 1.6
      - Container : which Java version are you using? use 'java -version' to find out
      - Configuration : no
      - Libraries : no

      === Process ==================================
      none

      === API ===================================

      ProcessDefinition pd = repositoryService.createProcessDefinitionQuery().processDefinitionId(historyService.createHistoryProcessInstanceQuery().processInstanceId(pid).uniqueResult().getProcessDefinitionId()).uniqueResult();


      === Stacktrace ==============================
      java.lang.ClassCastException: org.jbpm.jpdl.internal.model.JpdlProcessDefinition cannot be cast to java.util.List
       org.jbpm.pvm.internal.repository.ProcessDeployer.deploy(ProcessDeployer.java:64)
       org.jbpm.pvm.internal.repository.DeployerManager.deploy(DeployerManager.java:46)
       org.jbpm.pvm.internal.repository.RepositorySessionImpl.getObject(RepositorySessionImpl.java:120)
       org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.execute(ProcessDefinitionQueryImpl.java:72)
       org.jbpm.pvm.internal.query.AbstractQuery.execute(AbstractQuery.java:81)
       org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
       org.jbpm.pvm.internal.tx.jta.JtaTransactionInterceptor.executeInNewTx(JtaTransactionInterceptor.java:79)
       org.jbpm.pvm.internal.tx.jta.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:61)
       org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
       org.jbpm.pvm.internal.tx.jta.JtaRetryInterceptor.executeWithRetry(JtaRetryInterceptor.java:52)
       org.jbpm.pvm.internal.tx.jta.JtaRetryInterceptor.execute(JtaRetryInterceptor.java:45)
       org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:46)
       org.jbpm.pvm.internal.query.AbstractQuery.untypedList(AbstractQuery.java:62)
       org.jbpm.pvm.internal.query.AbstractQuery.untypedUniqueResult(AbstractQuery.java:69)
       org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.uniqueResult(ProcessDefinitionQueryImpl.java:145)
       com.gaia.jbpm.core.ProcessManager.getProcessDefinitionByProcessInstanceId(ProcessManager.java:398)
       com.gaia.jbpm.core.ProcessManager.getActivityCoordinatesInfo(ProcessManager.java:349)
       com.gaia.jbpm.action.GetActiveNodeInfo.execute(GetActiveNodeInfo.java:66)
       com.gaia.dispatcher.ActionDispatcher.process(ActionDispatcher.java:35)
       com.sol2.web.dispatcher.SOL2_ActionDispatcher.processRequest(SOL2_ActionDispatcher.java:69)
       com.sol2.web.dispatcher.SOL2_ActionDispatcher.doGet(SOL2_ActionDispatcher.java:52)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       com.gaia.filter.ActionFilter.doFilter(ActionFilter.java:129)
       org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)



      === Debug logs ==============================
      past debug logs here

      === Problem description =========================

      Please help me to find out what's the metter of my app. Thanks all.

        • 1. Re: JpdlProcessDefinition cannot be cast to java.util.List
          sebastian.s

          How does the process definition look like? For me this is somehow not enough information to help you. I encountered this problem already when browsing process definitions with the console and I had java classes referenced in the process definition which were missing in the classpath.

          • 2. Re: JpdlProcessDefinition cannot be cast to java.util.List

            Usually when I've gotten this error I can resolve it by deleting all the process definitions that are in my database, then redeploying the process definition. Possibly I had an old process definition in my database that refers to a Java class that no longer exists?

            Not that this fix is practical to do in a production environment, but it might help as a short term fix while looking into the root cause.

            • 3. Re: JpdlProcessDefinition cannot be cast to java.util.List

              Actually, I ran into one of these errors just now (java.lang.ClassCastException: org.jbpm.jpdl.internal.model.JpdlProcessDefinition cannot be cast to j
              ava.util.List) and clearing the database didn't solve it.

              Digging a little deeper, it looks like (at least when a model is deployed in a JUnit environment) when the jBPM parser parses a model file, if there's an error (such as a java class is defined that can't be found, or a class cast exception), the exception is thrown to the console but parsing continues on. This leads to the above (hard to understand) error message occurring. If you look at your system console, you hopefully will see an exception just prior to the above one, which is more informative.

              • 4. Re: JpdlProcessDefinition cannot be cast to java.util.List
                jbarrez

                @bwestrich: indeed, that's a good analysis :-)

                We've changed the error message in 4.2 into something more meaningful, because we also had trouble interpreting it ;-)

                • 5. Re: JpdlProcessDefinition cannot be cast to java.util.List

                  awesome! Thanks for the heads up on this upcoming improvement.

                  • 6. Re: JpdlProcessDefinition cannot be cast to java.util.List
                    sebastian.s

                    I am facing a similiar problem but I can't identify the cause. I am trying to deploy a process definition and the exception is thrown. The prior exception identified is

                    deploy.seminar:
                    [jbpm-deploy] java.util.zip.ZipException: error in opening zip file
                    [jbpm-deploy] at java.util.zip.ZipFile.open(Native Method)
                    [jbpm-deploy] at java.util.zip.ZipFile.<init>(ZipFile.java:114)
                    [jbpm-deploy] at java.util.zip.ZipFile.<init>(ZipFile.java:131)
                    [jbpm-deploy] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoa
                    der.java:1028)
                    [jbpm-deploy] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNe
                    xtResource(AntClassLoader.java:147)
                    [jbpm-deploy] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.<init>
                    (AntClassLoader.java:109)
                    [jbpm-deploy] at org.apache.tools.ant.AntClassLoader.findResources(AntClassLoad
                    er.java:975)
                    [jbpm-deploy] at java.lang.ClassLoader.getResources(ClassLoader.java:1016)
                    [jbpm-deploy] at org.apache.commons.logging.LogFactory$4.run(LogFactory.java:13
                    17)
                    [jbpm-deploy] at java.security.AccessController.doPrivileged(Native Method)
                    [jbpm-deploy] at org.apache.commons.logging.LogFactory.getResources(LogFactory.
                    java:1336)
                    [jbpm-deploy] at org.apache.commons.logging.LogFactory.getConfigurationFile(Log
                    Factory.java:1398)
                    
                    .. much longer
                    


                    So what's wrong with ant or my *.jar or *.bar file??
                    I am not understading the problem since the classpath should be fine with the *.jar created correctly.

                    • 7. Re: JpdlProcessDefinition cannot be cast to java.util.List
                      kukeltje

                      could be that the zip is being copied there and opened before it is finished copying

                      • 8. Re: JpdlProcessDefinition cannot be cast to java.util.List
                        sebastian.s

                        https://jira.jboss.org/jira/browse/JBPM-2281

                        It's basically the same problem as stated in the new comment here.

                        • 9. Re: JpdlProcessDefinition cannot be cast to java.util.List
                          sebastian.s

                          I have created a unit test and I am facing the same problem when trying to deploy so it's not the ant task's fault.

                          • 10. Re: JpdlProcessDefinition cannot be cast to java.util.List
                            sebastian.s

                            I managed to get rid of the problem. There was a classpath / buildpath problem and a wrong spelled package name when referencing a class in the process definition. I'm glad about the change to a more meaningful error message because I basically had 2 different problems but this wasn't clear to me so I searched at wrong place. Deployment using the unit tests now works. On Monday I will have to see if it also works with ant deployment task.

                            • 11. Re: JpdlProcessDefinition cannot be cast to java.util.List
                              sebastian.s

                              It seems this Exception is haunting me. I am able to deploy my process definition and there is no exception thrown when viewing the list of process definitions but as soon as I want to start an instance of the process. I tried to follow bwestrich's advice and searched for the actual cause but I could not find any.

                              • 12. Re: JpdlProcessDefinition cannot be cast to java.util.List
                                sebastian.s

                                Starting a new instance of this process succeeds but throws an exception. Could there be anything wrong with the process definition which is not detected during deployment but just during run time?

                                • 13. Re: JpdlProcessDefinition cannot be cast to java.util.List
                                  jbarrez

                                  @Sebastian: can you provide the stacktrace when starting a new instance?

                                  • 14. Re: JpdlProcessDefinition cannot be cast to java.util.List
                                    sebastian.s

                                    I'll double check this to see if I can trust me. I was facing too many different problems on the same time today. So it's difficult to distinguish and to reproduce theme. If I'll face the same problem I'll provide the stacktrace.

                                    Seems that this happened to me when I was testing for the right expressions to be used for my arguments. Sometimes it seemed as if they weren't correct but regardless I could deploy the process and I earned the exception when starting process instances.

                                    Maybe another case where this exception is seen but the actual one is hard to find because it's in somewhere in the cause.

                                    "bwestrich" wrote:

                                    Actually, I ran into one of these errors just now (java.lang.ClassCastException: org.jbpm.jpdl.internal.model.JpdlProcessDefinition cannot be cast to j
                                    ava.util.List) and clearing the database didn't solve it.

                                    Digging a little deeper, it looks like (at least when a model is deployed in a JUnit environment) when the jBPM parser parses a model file, if there's an error (such as a java class is defined that can't be found, or a class cast exception), the exception is thrown to the console but parsing continues on. This leads to the above (hard to understand) error message occurring. If you look at your system console, you hopefully will see an exception just prior to the above one, which is more informative.


                                    1 2 Previous Next