7 Replies Latest reply on Oct 9, 2009 8:50 AM by Latchezar Marinkov

    deploy examples error, classcastexception

    tony nys Newbie

      jbpm 4.1
      jbos 5.0GA
      hsqldb
      linux


      launched deploy from ant task
      then went to the jbpm-console to list the pd's...


      18:39:21,033 INFO [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl@de96e1
      java.lang.ClassCastException: org.jbpm.jpdl.internal.model.JpdlProcessDefinition cannot be cast to java.util.List
      at org.jbpm.pvm.internal.repository.ProcessDeployer.deploy(ProcessDeployer.java:64)
      at org.jbpm.pvm.internal.repository.DeployerManager.deploy(DeployerManag

        • 1. Re: deploy examples error, classcastexception
          Ronald van Kuijk Master

          is this the full stacktrace? Strange that this is on the level 'INFO'.

          Can you raise (lower?) the log level to debug and see what happens and post that.

          • 2. Re: deploy examples error, classcastexception
            tony nys Newbie

            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.ProcessDefinitionQueryImpl.list(ProcessDefinitionQueryImpl.java:141)
            org.jbpm.integration.console.ProcessManagementImpl.getProcessDefinitions(ProcessManagementImpl.java:61)
            org.jboss.bpm.console.server.ProcessMgmtFacade.getDefinitionsJSON(ProcessMgmtFacade.java:107)
            sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            java.lang.reflect.Method.invoke(Method.java:597)
            org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)
            org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)
            org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)
            org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)
            org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)
            org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
            org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
            org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
            org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
            org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

            • 3. Re: deploy examples error, classcastexception
              tony nys Newbie

              is there a specific log properties file in jbpm ?

              • 4. Re: deploy examples error, classcastexception
                Ronald van Kuijk Master

                no, jdk logging is used, but I think it ends up in the log4j of jboss

                • 5. Re: deploy examples error, classcastexception
                  tony nys Newbie

                  did the same thing, undeploy , deploy (is ok)
                  but as soon I connect with the jbpm console i have this error

                  • 6. Re: deploy examples error, classcastexception
                    Bob Milstead Newbie

                    I get the same thing trying to run a ProcessDefinitionQuery:

                    org.jbpm.jpdl.internal.model.JpdlProcessDefinition cannot be cast to java.util.List
                     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
                     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
                     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
                     at java.security.AccessController.doPrivileged(Native Method)
                     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
                     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
                     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
                     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
                     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
                     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
                     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
                     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
                     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
                     at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
                     at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
                     at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
                     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830)
                     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)
                     at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1237)
                     at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:591)
                     at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:128)
                     at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
                     at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
                     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
                     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
                     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
                     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                     at java.lang.Thread.run(Thread.java:637)
                    Caused by: java.lang.ClassCastException: org.jbpm.jpdl.internal.model.JpdlProcessDefinition cannot be cast to java.util.List
                     at org.jbpm.pvm.internal.repository.ProcessDeployer.deploy(ProcessDeployer.java:64)
                     at org.jbpm.pvm.internal.repository.DeployerManager.deploy(DeployerManager.java:46)
                     at org.jbpm.pvm.internal.repository.RepositorySessionImpl.getObject(RepositorySessionImpl.java:120)
                     at org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.execute(ProcessDefinitionQueryImpl.java:72)
                     at org.jbpm.pvm.internal.query.AbstractQuery.execute(AbstractQuery.java:81)
                     at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
                     at org.jbpm.pvm.internal.spring.CommandTransactionCallback.doInTransaction(CommandTransactionCallback.java:50)
                     at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
                     at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:77)
                     at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:46)
                     at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
                     at org.jbpm.pvm.internal.query.AbstractQuery.untypedList(AbstractQuery.java:62)
                     at org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.list(ProcessDefinitionQueryImpl.java:141)
                    
                    


                    • 7. Re: deploy examples error, classcastexception
                      Latchezar Marinkov Newbie

                      Envoronment:
                      windows vista
                      apache-tomcat-6.0.20
                      jbpm 4.1
                      hsqldb

                      If one replaces the line 64 in the org.jbpm.pvm.internal.repository.ProcessDeployer:

                      List<ProcessDefinitionImpl> processDefinitions = (List<ProcessDefinitionImpl>) parse.getDocumentObject();


                      with the following code then the deployment of the processes from the jbpm examples under the jbpm console will be successful:

                      List<ProcessDefinitionImpl> processDefinitions = new java.util.ArrayList<ProcessDefinitionImpl>();
                      Object obj = parse.getDocumentObject();
                      if (obj instanceof java.util.ArrayList)
                      {
                       processDefinitions = (List<ProcessDefinitionImpl>)obj;
                      }
                      else
                      {
                       processDefinitions.add((ProcessDefinitionImpl)obj);
                      }
                      


                      I' am not advocating this code as a solution for the class cast exception, but my opinion on class casting in java is that it brings more problems then it solves! I will suggest that the author of this cast should look again at the code and try to solve the problem without using class casting.