Tapestry
  1. Tapestry
  2. TAPESTRY-995

Overriding maximum file upload size throws Hivemind exception

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 4.0.2
    • Fix Version/s: 4.1
    • Labels:
      None
    • Environment:
      Linux, Tomcat 5.5.17, Hivemind 1.1.1

      Description

      The example on the Tapestry web site of how to override the maximum file upload size (in the documentation of the Upload component) does not work. I added the example code to my webapp's hivemodule.xml:

      <?xml version="1.0"?>
      <module id="app" version="1.0.0" package="services">

      [...]

      <implementation service-id="tapestry.multipart.MultipartDecoder">
      <create-instance class="org.apache.tapestry.multipart.MultipartDecoderImpl,maxSize=-1" model="threaded" />
      </implementation>

      </module>

      When the app. is then deployed in Tomcat, an exception is thrown during initialization:

      2006-06-28 11:14:08,135 [main] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/test] - Servlet /test threw load() exception
      org.apache.hivemind.ApplicationRuntimeException: Error at context:/WEB-INF/hivemodule.xml, line 53, column 109: Module app contributed to unknown service point tapestry.multipart.MultipartDecoder. The contribution has been ignored. [context:/WEB-INF/hivemodule.xml, line 53, column 109]
      at org.apache.hivemind.impl.StrictErrorHandler.error(StrictErrorHandler.java:39)
      at org.apache.hivemind.impl.RegistryInfrastructureConstructor.addServiceInstanceBuilder(RegistryInfrastructureConstructor.java:568)
      at org.apache.hivemind.impl.RegistryInfrastructureConstructor.addImplementations(RegistryInfrastructureConstructor.java:544)
      at org.apache.hivemind.impl.RegistryInfrastructureConstructor.addImplementations(RegistryInfrastructureConstructor.java:423)
      at org.apache.hivemind.impl.RegistryInfrastructureConstructor.addImplementationsAndContributions(RegistryInfrastructureConstructor.java:399)
      at org.apache.hivemind.impl.RegistryInfrastructureConstructor.constructRegistryInfrastructure(RegistryInfrastructureConstructor.java:176)
      at org.apache.hivemind.impl.RegistryBuilder.constructRegistry(RegistryBuilder.java:151)
      at org.apache.tapestry.ApplicationServlet.constructRegistry(ApplicationServlet.java:253)
      at org.apache.tapestry.ApplicationServlet.init(ApplicationServlet.java:194)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
      at org.apache.catalina.core.StandardService.start(StandardService.java:450)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        17d 2h 48m 1 Jesse Kuhnert 15/Jul/06 20:15
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12568905 ] jira [ 12590175 ]
        Mark Thomas made changes -
        Workflow jira [ 12374554 ] Default workflow, editable Closed status [ 12568905 ]
        Hide
        Claudiu Dobre added a comment -

        It is not a bug of Tapestry 4.0.2!

        The documentation of Upload component has a wrong service ID to the Decoder service.

        The documentation looks like:

        <implementation service-id="tapestry.multipart.MultipartDecoder">
        <create-instance class="org.apache.tapestry.multipart.MultipartDecoderImpl,maxSize=-1" model="threaded" />
        </implementation>

        and it should be
        <implementation service-id="tapestry.multipart.ServletMultipartDecoder">
        <create-instance class="org.apache.tapestry.multipart.MultipartDecoderImpl,maxSize=-1" model="threaded" />
        </implementation>

        So the service ID is "tapestry.multipart.ServletMultipartDecoder".
        You can take a look at tapestry-4.0.2.jar/META-INF/tapestry.multipart.xml

        Show
        Claudiu Dobre added a comment - It is not a bug of Tapestry 4.0.2! The documentation of Upload component has a wrong service ID to the Decoder service. The documentation looks like: <implementation service-id="tapestry.multipart.MultipartDecoder"> <create-instance class="org.apache.tapestry.multipart.MultipartDecoderImpl,maxSize=-1" model="threaded" /> </implementation> and it should be <implementation service-id="tapestry.multipart.ServletMultipartDecoder"> <create-instance class="org.apache.tapestry.multipart.MultipartDecoderImpl,maxSize=-1" model="threaded" /> </implementation> So the service ID is "tapestry.multipart.ServletMultipartDecoder". You can take a look at tapestry-4.0.2.jar/META-INF/tapestry.multipart.xml
        Jesse Kuhnert made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 4.1 [ 12310632 ]
        Resolution Fixed [ 1 ]
        Hide
        Jesse Kuhnert added a comment -

        Fixed

        Show
        Jesse Kuhnert added a comment - Fixed
        Mathijs den Burger created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Mathijs den Burger
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development