[ 
https://issues.apache.org/jira/browse/TRINIDAD-1645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783417#action_12783417
 ] 

Bart Kummel commented on TRINIDAD-1645:
---------------------------------------

A work around for this issue is to use an EL literal, like this: 
<uploaded-file-max-disk-space>#{1024}</uploaded-file-max-disk-space>.

> New upload settings in trinidad-config.xml do not accept literals
> -----------------------------------------------------------------
>
>                 Key: TRINIDAD-1645
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1645
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions:  1.2.12-core
>         Environment: Facelets 1.1.14, Glassfish v2.1
>            Reporter: Bart Kummel
>            Priority: Minor
>
> Since Trinidad 1.2.12, upload limits can be configured in 
> trinidad-config.xml. (See issue TRINIDAD-1464.) The intended use is that the 
> values are being provided by a bean, that is referenced via EL in 
> trinidad-config.xml, like this: 
> <uploaded-file-max-disk-space>#{preferences.maxUploadDiskSpace}</uploaded-file-max-disk-space>.
>  However, it should be possible to use literals as well here, for example: 
> <uploaded-file-max-disk-space>102400</uploaded-file-max-disk-space> (max size 
> 100kB). However, using a literal value here, results in the stack tract as 
> displayed below. Not that this also applies to the <uploaded-file-max-memory> 
> setting.
> java.lang.ClassCastException: java.lang.String cannot be cast to 
> java.lang.Long
>       at 
> org.apache.myfaces.trinidadinternal.context.RequestContextImpl.getUploadedFileMaxDiskSpace(RequestContextImpl.java:177)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleInputFileRenderer.encodeAllAsElement(SimpleInputFileRenderer.java:157)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.FormElementRenderer.encodeAll(FormElementRenderer.java:109)
>       at 
> org.apache.myfaces.trinidad.render.CoreRenderer.delegateRenderer(CoreRenderer.java:446)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputLabelAndMessageRenderer.renderFieldCellContents(InputLabelAndMessageRenderer.java:146)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.LabelAndMessageRenderer._renderFieldCell(LabelAndMessageRenderer.java:470)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.LabelAndMessageRenderer.encodeAll(LabelAndMessageRenderer.java:340)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputLabelAndMessageRenderer.encodeAll(InputLabelAndMessageRenderer.java:124)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputFileRenderer.encodeAll(InputFileRenderer.java:69)
>       at 
> org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
>       at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
>       at 
> org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer._encodeFormItem(PanelFormLayoutRenderer.java:889)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer.access$100(PanelFormLayoutRenderer.java:47)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1397)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1316)
>       at 
> org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
>       at 
> org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
>       at 
> org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer._encodeChildren(PanelFormLayoutRenderer.java:311)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer.encodeAll(PanelFormLayoutRenderer.java:136)
>       at 
> org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
>       at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
>       at 
> org.apache.myfaces.trinidad.render.RenderUtils.encodeRecursive(RenderUtils.java:70)
>       at 
> org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:410)
>       at 
> org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:432)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.renderContent(PanelPartialRootRenderer.java:69)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.renderContent(BodyRenderer.java:142)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:151)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.encodeAll(BodyRenderer.java:78)
>       at 
> org.apache.myfaces.trinidad.render.CoreRenderer.delegateRenderer(CoreRenderer.java:446)
>       at 
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.DocumentRenderer.encodeAll(DocumentRenderer.java:80)
>       at 
> org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
>       at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
>       at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1494)
>       at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComponentBase.java:771)
>       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
>       at 
> com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
>       at 
> javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:48)
>       at 
> org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
>       at 
> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
>       at 
> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
>       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:155)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:333)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
>       at 
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
>       at 
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
>       at 
> org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
>       at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:313)
>       at 
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
>       at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
>       at 
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
>       at 
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
>       at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
>       at 
> com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
>       at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
>       at 
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
>       at 
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
>       at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
>       at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
>       at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
>       at 
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
>       at 
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
>       at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
>       at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
>       at 
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
>       at 
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
>       at 
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
>       at 
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
>       at 
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
>       at 
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
>       at 
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
>       at 
> com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
>       at 
> com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to