12 Replies Latest reply on Sep 23, 2008 7:10 AM by Ronald van Kuijk

    problems using jbpm 3.1 with jboss 4.0.0

    jainer eduardo quiceno Newbie


      hi, I have configured jboss with the following archives that says the starters kit:
      - In the folder deploy I created the file postgres-ds.xml.
      - In the folder jbpm.sar->meta-inf I configured the file jboss-service.xml.
      - In the file jbpm.sar.cfg.jar I configured the file hibernate.cfg.xml.

      The problem is when I use the console jbpm, because the data do not appear, and are no exceptions of datasource. Simply I can navigate between the jsp pages, but without the possibility to see the data.
      The other problem is when I try to deploy a definition of process in the editor; it appears the following exception:

      INFO [STDOUT] org.apache.commons.fileupload.FileUploadException: the request was rejected because n
      o multipart boundary was found
      at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:324)
      at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268)
      at org.jbpm.webapp.servlet.UploadServlet.handleRequest(UploadServlet.java:70)
      at org.jbpm.webapp.servlet.UploadServlet.service(UploadServlet.java:50)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.jbpm.webapp.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:55)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
      
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.jbpm.web.JbpmContextFilter.doFilter(JbpmContextFilter.java:83)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
      
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:59)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
      
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
      
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:44)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:169)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.
      java:705)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:595)
      



      i'm working with postgreSQL
      Any idea?
      thanx
      Regards!!

      ________________
      jainer eduardo

        • 1. Re: problems using jbpm 3.1 with jboss 4.0.0
          Koen Aers Master

          Jainer,

          Did you create the database schema in your PostgreSQL database?

          Regards,
          Koen

          • 2. Re: problems using jbpm 3.1 with jboss 4.0.0
            jainer eduardo quiceno Newbie

            hi koen

            I already had created the scheme of my data base in PostgreSQL, because first I worked with jboss that offers jbpm

            PD: I already fixed the problem that I had about deploy of the process definition, so only we can be concentrated in the problem of the data that do not appear.

            thanks for you attention
            Regards

            _______________________
            jainer eduardo

            • 3. Re: problems using jbpm 3.1 with jboss 4.0.0
              Koen Aers Master

              Do you see something when you connect to your database with a client such as DBVisualizer?
              Is there something in the JBPM_USER table?

              • 4. Re: problems using jbpm 3.1 with jboss 4.0.0
                jainer eduardo quiceno Newbie

                SURE!!

                From the first day the data base has had data, specially in table JBPM_ID_USER and as I had said to you before, I worked with the server that offers jbpm, and the console always showed the data with that server

                • 5. Re: problems using jbpm 3.1 with jboss 4.0.0
                  Koen Aers Master

                  Than I have no clue... Did you turn on Hibernate logging? What do you see there?

                  Regards,
                  Koen

                  • 6. Re: problems using jbpm 3.1 with jboss 4.0.0
                    jainer eduardo quiceno Newbie

                    Hi Koen,

                    I already solved my problem, was not something to make a contribution in the forum, thanks in any case

                    Regards!!!!
                    _______________
                    jainer quiceno

                    • 7. Re: problems using jbpm 3.1 with jboss 4.0.0
                      Olivier Debels Newbie

                      Hi,

                      I also stumbled on this problem and did find it interesting enough to share. It seems to be correlated with the use of commons-fileupload jar.

                      The starters kit is using commons-fileupload-1.0 jar. When trying to use commons-fileupload-1.1.1 jar you will get the exception "the request was rejected because no multipart boundary was found".

                      The reason here is that at deployment (using the gpd designer tool) the content type is filled in as 'multipart/form-data, boundary=AaB03x'. This will be correctly parsed by the 1.0 jar but not by the 1.1.1 jar. You need to convert it to 'multipart/form-data; boundary=AaB03x' in order to make it work with the 1.1.1 stuff (or stick with the 1.0 jar if you choose to do so...).

                      As for as I can see according to RFC1341 the 1.1.1 version of the jar is doing the right thing, so this is actually a bug in the designer when calling the upload servlet.

                      Olivier.

                      • 8. Re: problems using jbpm 3.1 with jboss 4.0.0
                        Ronald van Kuijk Master

                        Olivier,

                        Thanks for pointing this out. It is indeed insteresting.

                        Kan you file a jira issue for this? Assign it to the GPD but put a reference in there that the correct commons-fileupload should be available in the webapp. I wonder if the ; is accepted by the 1.0 version of commons-fileupload as well. Can you try that?

                        • 9. Re: problems using jbpm 3.1 with jboss 4.0.0
                          Olivier Debels Newbie

                          The ; will work with the 1.0 version.

                          The 1.0 version is using indexOf("boundary=") to get the boundary part from the content type. So it will work whatever independent of the separator you use.

                          The 1.1.1 version is using a parser which ';' as separator. It is filling up a map with found properties. When using a ',' instead of a ';' the property with name "boundary" is not found (it will contain a property with name "multipart/form-data, boundary" instead ;-)).

                          I filed a jira issue for this: http://jira.jboss.com/jira/browse/JBPM-698

                          greetz,

                          Olivier.

                          • 10. Re: problems using jbpm 3.1 with jboss 4.0.0
                            Koen Aers Master

                            Olivier,

                            Thanks for reporting!

                            Regards,
                            Koen

                            • 11. Re: problems using jbpm 3.1 with jboss 4.0.0
                              Rishikesh Dagwal Newbie

                              Hi All,

                              I am getting the same problem with HttpClient 3.1 and fileupload 1.0. I have also tried fileupload 1.2.1. But I am getting the same message as

                              "the request was rejected because no multipart boundary was found"

                              Servlet is running on Tomcat 4.1 and I have Standalone java application as client.

                              I am writing some code for understanding

                              At client side [HttpClient 3.1]
                              ===============================================

                              final String CONTENT_TYPE = "Content-type";
                              final String MULTI_PART_FORM = "multipart/form-data";
                              
                              File file = new File( "c:\\sample.txt);
                              HttpClient httpClient = new HttpClient();
                              PostMethod postMethod = new PostMethod( url );
                              postMethod.setRequestHeader( CONTENT_TYPE, MULTI_PART_FORM );
                              Part[] parts = { new FilePart( file.getName(), file ) };
                              postMethod.setRequestEntity( new MultipartRequestEntity( parts,
                               postMethod.getParams() ) );
                              
                              HttpClientParams params = new HttpClientParams();
                              httpClient.getHttpConnectionManager().getParams().setConnectionTimeout( 10000 );
                              httpClient.setParams( params );
                              httpClient.executeMethod( postMethod );

                              ===============================================

                              At Server Side[Tomcat + fileupload 1.0]
                              ===============================================
                              File file = new File( "D:\\UploadedFiles\\sample.txt" );
                              DiskFileUpload diskFileUpload = new DiskFileUpload();
                              List fileItems = diskFileUpload.parseRequest( request );
                              diskFileUpload.setSizeMax( -1 ); // No limit on upload.
                              Iterator iterator = fileItems.iterator();
                               while( iterator.hasNext() ) {
                               FileItem fileItem = ( FileItem )iterator.next();
                               if( ! fileItem.isFormField() ) {
                               fileItem.write( file );
                               }
                               }

                              ===============================================

                              At Server Side[Tomcat + fileupload 1.2.1]
                              ===============================================
                              File file = new File( "D:\\UploadedFiles\\sample.txt" );
                              DiskFileItemFactory factory = new DiskFileItemFactory();
                              ServletFileUpload servletFileUpload = new ServletFileUpload( factory );
                              List fileItems = servletFileUpload.parseRequest( request );
                              servletFileUpload.setSizeMax( -1 ); // No limit on upload.
                              Iterator iterator = fileItems.iterator();
                              while( iterator.hasNext() ) {
                               FileItem fileItem = ( FileItem )iterator.next();
                               if( ! fileItem.isFormField() ) {
                               fileItem.write( file );
                               }
                              }

                              ===============================================

                              If I dont use fileupload api and uses inputstrem of request to save file to disk then I get xml file that has additional text. Both code and file contents are shown below.

                              Code without fileupload API
                              ===============================================
                              File file = new File( "D:\\UploadedFiles\\sample.txt" );
                              InputStream inputStream = request.getInputStream();
                              BufferedInputStream bufferedInputStream = new BufferedInputStream( inputStream );
                              byte abyte0[] = new byte[ 4096 ];
                              int i;
                              FileOutputStream fileOutputStream = new FileOutputStream( file );
                              
                              while ( ( i = bufferedInputStream.read( abyte0, 0, 4096 ) ) != -1 ) {
                               fileOutputStream.write( abyte0, 0, i );
                              }
                              
                              bufferedInputStream.close();
                              fileOutputStream.close();

                              ===============================================

                              Original file
                              ===============================================
                              0001
                              BINARY
                              FALSE
                              0002
                              BINARY
                              FALSE

                              ===============================================

                              File after upload
                              ===============================================
                              --modMHyNHWzdAQArk5xE5VmXXJAs-dx_A9Au
                              Content-Disposition: form-data; name="file.xml"; filename="file.xml"
                              Content-Type: application/octet-stream; charset=ISO-8859-1
                              Content-Transfer-Encoding: binary
                              
                              0001
                              BINARY
                              FALSE
                              0002
                              BINARY
                              FALSE
                              
                              --modMHyNHWzdAQArk5xE5VmXXJAs-dx_A9Au--

                              ===============================================

                              any idea why this happening?

                              Thanks in Advance!

                              Regards,
                              Rishikesh Dagwal,
                              Senior Software Engineer,
                              Geometric Limited, Pune[India]