6 Replies Latest reply on Nov 6, 2017 7:01 AM by pradeepmittal

    Attachments: ClassNotFoundException: org.jbpm.document.marshalling.DocumentMarshallingStrategy

    rogerparkinson

      I'm trying to follow the instructions on http://docs.jboss.org/jbpm/v6.1/userguide/chap-formmodeler.html#sect-formmodeler-attachments

      • added a Variable Definition 'document' with custom type org.jbpm.document.Document to my process
      • clicked on generate all forms: this put a document upload field onto the process form, but not the others. No problem, I can add those manually.
      • Added the reference to org.jbpm.document.marshalling.DocumentMarshallingStrategy into my kie-deployment-descriptor file
      • added the references to kie-api and jbpm-document to my pom.xml and rebuilt my war file
      • tried to build & deploy the process and I get ClassNotFound looking for org.jbpm.document.marshalling.DocumentMarshallingStrategy

      I've checked that the relevant jar files are in the WEB-INF/lib of the war file and redeployed it.

      I tried adding those dependencies to the pom file in the process: same error

      I also tried adding those jar file to the lib/ext of my wildfly server: same error

      Is there something else I need to do here? The docs suggest I ought to be writing my own version of DocumentMarshallingStrategy but it is unclear as to why I should, it is just a simple marshaling exercise. And as far as I can tell I just need to stick it on the classpath, and I have (3 times over) but it still doesn't find it.


      My environment is:

      jdk1.7.0_67

      Wildfly-8.1.0.Final

      kie-wb-6.1.0.Final-wildfly.war (I've built this from https://github.com/droolsjbpm/kie-wb-distributions.git, with some tweaks to make it use a postgres database)

        • 1. Re: Attachments: ClassNotFoundException: org.jbpm.document.marshalling.DocumentMarshallingStrategy
          swiderski.maciej

          best is to keep it only in WEB-INF/lib of kie workbench. Then define the marshaling strategy in deployment descriptor of your project and that should simply fine it.

           

          Since it does not could you please attach:

          - complete stacktrace

          - your project

           

          that way we can quickly verify it what might be the issue.

           

          HTH

          • 2. Re: Re: Attachments: ClassNotFoundException: org.jbpm.document.marshalling.DocumentMarshallingStrategy
            rogerparkinson

            Sure, thanks for the help.

            Attached is the stack trace and my project, which is just the kie-wb-distribution-wars maven project with the pom file changed to add the extra libraries, ie

            <dependency>

                  <groupId>org.kie</groupId>

                  <artifactId>kie-api</artifactId>

                </dependency>

                <dependency>

                  <groupId>org.jbpm</groupId>

                  <artifactId>jbpm-document</artifactId>

                </dependency>

            This pulls the webapp from the repo and repackages it for wildfly etc (you probably know this) and adding the libraries here seems to happily add the jar files to WEB-INF/lib.

            For completeness I ought to mention that I've altered my copy of kie-wb-webapp to use postgres rather than h2 and the copy in my local repo has those changes, but no others.

            I think the postgres thing is not relevant. I can send you that if you want, but I figure it will be easier for any testing you want to do to stick to h2.

             

            I've removed the other copies of the libraries, rebuilt this war this morning and redeployed it, and verified that I still get the error. I've also attached my process repository (R5.git.tar.bz2) which contains one simple process. The error I get is when I try and build&deploy that process.

             

            A ton of other errors come up when I run this but I'm ignoring these for now.

             

            Thanks again

            Roger

            • 3. Re: Attachments: ClassNotFoundException: org.jbpm.document.marshalling.DocumentMarshallingStrategy
              swiderski.maciej

              thanks for the details, I'll look into it later today.

              • 4. Re: Re: Re: Attachments: ClassNotFoundException: org.jbpm.document.marshalling.DocumentMarshallingStrategy
                swiderski.maciej

                Roger,

                 

                I believe the root cause is the white spaces in the deployment descriptor:

                  <marshalling-strategies>
                    <marshalling-strategy>
                      <resolver>reflection</resolver>
                      <identifier>
                        org.jbpm.document.marshalling.DocumentMarshallingStrategy
                      </identifier>
                    </marshalling-strategy>
                  </marshalling-strategies>
                

                could you give it a try with following config:

                  <marshalling-strategies>
                    <marshalling-strategy>
                      <resolver>reflection</resolver>
                      <identifier>org.jbpm.document.marshalling.DocumentMarshallingStrategy</identifier>
                    </marshalling-strategy>
                  </marshalling-strategies>
                

                with this we ensure that there is correct FQCN given.

                 

                P.S.

                in 6.2 there is dedicated editor for deployment descriptor so this sort of issues should not be valid any longer.

                 

                HTH

                • 5. Re: Attachments: ClassNotFoundException: org.jbpm.document.marshalling.DocumentMarshallingStrategy
                  rogerparkinson

                  Worked immediately, thanks.

                  • 6. Re: Attachments: ClassNotFoundException: org.jbpm.document.marshalling.DocumentMarshallingStrategy
                    pradeepmittal

                    Hi Maciej..

                     

                     

                    There is a need to add attachment to the process.  I have successfully created the marshall and configured as required.

                     

                     

                    Created a process variable named 'Document' of type 'Object' and custom type as 'org.jbpm.document.Document' .

                     

                     

                    While executing the prcess and trying to add the a file  to the process, I am getting the below error after submit.

                     

                     

                    Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to org.jbpm.document.Document

                    at org.jbpm.formModeler.fieldTypes.document.handling.JBPMDocumentFieldTypeHandler.getInputHTML(JBPMDocumentFieldTypeHandler.java:172) [jbpm-form-modeler-document-6.3.0.Final.jar:6.3.0.Final]

                    at org.jbpm.formModeler.core.processing.fieldHandlers.plugable.PlugableFieldHandlerFormatter.service(PlugableFieldHandlerFormatter.java:51) [jbpm-form-modeler-ui-6.3.0.Final.jar:6.3.0.Final]

                    at org.jbpm.formModeler.service.bb.mvc.taglib.formatter.FormatterTag.doAfterBody(FormatterTag.java:108).

                     

                     

                     

                    Please suggest on the same?

                     

                     

                    P.S. I am using version 6.3.0

                     

                     

                    Thanks in advance.