tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrej Aschenbrenner (JIRA)" <...@tapestry.apache.org>
Subject [jira] Updated: (TAPESTRY-1432) Regression in the AssetFactory().createAsset()
Date Fri, 27 Apr 2007 11:34:15 GMT

     [ https://issues.apache.org/jira/browse/TAPESTRY-1432?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrej Aschenbrenner updated TAPESTRY-1432:
-------------------------------------------

    Description: 
In the latest snapshot of Tapestry it is impossible to create an Asset from Java code.

Previously this code snippet worked without problems:
/**
 * Returns the preview asset from the current report.
 *
 * @return The preview asset.
 */
public final IAsset getPreviewAsset() {
    if (getCurrentReport().getPreviewPath() != null) {
        Infrastructure infrastructure = getEngine().getInfrastructure();
        try {
            IAsset asset = infrastructure.getAssetFactory().createAsset(
                                              infrastructure.getContextRoot(),
                                              getCurrentReport().getPreviewPath(),
                                              getLocale(), getLocation());
            return asset;
        } catch (ApplicationRuntimeException e) {
            return getAsset("iPreviewEmpty");
        }
    }
   return getAsset("iPreviewEmpty");
}

getCurrentReport().getPreviewPath() contains "images/path/toanimage.png"

For the latest Tapestry snapshot I had to change the function call to
IAsset asset = infrastructure.getAssetFactory().createAsset(null,
                                      infrastructure.getContextRoot(),
                                      getCurrentReport().getPreviewPath(),
                                      getLocale(), getLocation());

I also tried
IAsset asset = infrastructure.getAssetFactory().createAsset(getSpecification(),
                                      infrastructure.getContextRoot(),
                                      getCurrentReport().getPreviewPath(),
                                      getLocale(), getLocation());

But a java.lang.NullPointerException is always thrown.

Stack Trace:
    * $AssetFactory_112326461ec._getStrategy($AssetFactory_112326461ec.java)
    * $AssetFactory_112326461ec.createAsset($AssetFactory_112326461ec.java)
    * $AssetFactory_11232646073.createAsset($AssetFactory_11232646073.java)
    * com.face.h4p.webreporting.pages.FinalStep.getPreviewAsset(FinalStep.java:113)
    * $$FinalStep_43$access_previewAsset_1123264622e.readProperty($$FinalStep_43$access_previewAsset_1123264622e.java)
    * com.javaforge.tapestry.prop.PropertyAccessorBinding.getObject(PropertyAccessorBinding.java:59)
    * org.apache.tapestry.binding.AbstractBinding.getObject(AbstractBinding.java:84)
    * $ReportInvoker_44.getPreviewImage($ReportInvoker_44.java)
    * 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:585)
    * ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:632)
    * ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java:1049)
    * ognl.ObjectPropertyAccessor.getPossibleProperty(ObjectPropertyAccessor.java:60)
    * ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:134)
    * ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1760)
    * ognl.ASTProperty.getValueBody(ASTProperty.java:109)
    * ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:200)
    * ognl.SimpleNode.getValue(SimpleNode.java:244)
    * ognl.Ognl.getValue(Ognl.java:376)
    * ognl.Ognl.getValue(Ognl.java:340)
    * org.apache.tapestry.services.impl.HiveMindExpressionCompiler.compileExpression(HiveMindExpressionCompiler.java:146)
    * ognl.OgnlRuntime.compileExpression(OgnlRuntime.java:387)
    * ognl.Ognl.compileExpression(Ognl.java:123)
    * org.apache.tapestry.services.impl.ExpressionCacheImpl.parse(ExpressionCacheImpl.java:129)
    * org.apache.tapestry.services.impl.ExpressionCacheImpl.getCompiledExpression(ExpressionCacheImpl.java:91)
    * $ExpressionCache_112326461a9.getCompiledExpression($ExpressionCache_112326461a9.java)
    * org.apache.tapestry.binding.ExpressionBinding.resolveExpression(ExpressionBinding.java:122)
    * org.apache.tapestry.binding.ExpressionBinding.getObject(ExpressionBinding.java:113)
    * org.apache.tapestry.binding.AbstractBinding.getObject(AbstractBinding.java:84)
    * $Image_30.getImage($Image_30.java)
    * org.apache.tapestry.html.Image.renderComponent(Image.java:46)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
    * org.apache.tapestry.link.DefaultLinkRenderer.renderLink(DefaultLinkRenderer.java:91)
    * org.apache.tapestry.link.AbstractLinkComponent.renderComponent(AbstractLinkComponent.java:94)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
    * org.apache.tapestry.components.ForBean.renderComponent(ForBean.java:181)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
    * org.apache.tapestry.components.RenderBody.renderComponent(RenderBody.java:41)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
    * org.apache.tapestry.form.FormSupportImpl.render(FormSupportImpl.java:514)
    * org.apache.tapestry.form.Form.renderComponent(Form.java:226)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
    * org.apache.tapestry.html.Body.renderComponent(Body.java:38)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
    * com.face.h4p.webreporting.tapestry.XMLShell.renderComponent(XMLShell.java:67)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:182)
    * org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:237)
    * org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:397)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.renderResponse(DefaultResponseBuilder.java:158)
    * org.apache.tapestry.services.impl.ResponseRendererImpl.renderResponse(ResponseRendererImpl.java:33)
    * $ResponseRenderer_11232646081.renderResponse($ResponseRenderer_11232646081.java)
    * org.apache.tapestry.engine.DirectService.service(DirectService.java:147)
    * $IEngineService_112326460f2.service($IEngineService_112326460f2.java)
    * org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:72)
    * org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:246)
    * org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:54)
    * $WebRequestServicer_112326460cb.service($WebRequestServicer_112326460cb.java)
    * $WebRequestServicer_112326460c7.service($WebRequestServicer_112326460c7.java)
    * org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:61)
    * $ServletRequestServicer_112326460ad.service($ServletRequestServicer_112326460ad.java)
    * org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
    * $ServletRequestServicerFilter_112326460a9.service($ServletRequestServicerFilter_112326460a9.java)
    * $ServletRequestServicer_112326460af.service($ServletRequestServicer_112326460af.java)
    * org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
    * $ServletRequestServicerFilter_112326460a7.service($ServletRequestServicerFilter_112326460a7.java)
    * $ServletRequestServicer_112326460af.service($ServletRequestServicer_112326460af.java)
    * org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
    * $ServletRequestServicerFilter_112326460ab.service($ServletRequestServicerFilter_112326460ab.java)
    * $ServletRequestServicer_112326460af.service($ServletRequestServicer_112326460af.java)
    * $ServletRequestServicer_112326460a1.service($ServletRequestServicer_112326460a1.java)
    * org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:123)
    * org.apache.tapestry.ApplicationServlet.doPost(ApplicationServlet.java:168)
    * javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    * javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    * org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    * org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    * org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    * org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    * org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    * org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    * org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    * org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    * org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
    * org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    * org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    * org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    * org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
    * org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:495)
    * org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    * org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    * org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    * org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    * org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    * org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    * java.lang.Thread.run(Thread.java:595)


  was:
In the latest snapshot of Tapestry it is impossible to create an Asset from Java code.

Previously this code snippet worked without problems:
{code:title=Working}
/**
 * Returns the preview asset from the current report.
 *
 * @return The preview asset.
 */
public final IAsset getPreviewAsset() {
    if (getCurrentReport().getPreviewPath() != null) {
        Infrastructure infrastructure = getEngine().getInfrastructure();
        try {
            IAsset asset = infrastructure.getAssetFactory().createAsset(
                                              infrastructure.getContextRoot(),
                                              getCurrentReport().getPreviewPath(),
                                              getLocale(), getLocation());
            return asset;
        } catch (ApplicationRuntimeException e) {
            return getAsset("iPreviewEmpty");
        }
    }
   return getAsset("iPreviewEmpty");
}
{code}

getCurrentReport().getPreviewPath() contains "images/path/toanimage.png"

For the latest Tapestry snapshot I had to change the function call to
{code:title=NotWorking}
IAsset asset = infrastructure.getAssetFactory().createAsset(null,
                                      infrastructure.getContextRoot(),
                                      getCurrentReport().getPreviewPath(),
                                      getLocale(), getLocation());
{code}

I also tried
{code:title=NotWorking}
IAsset asset = infrastructure.getAssetFactory().createAsset(getSpecification(),
                                      infrastructure.getContextRoot(),
                                      getCurrentReport().getPreviewPath(),
                                      getLocale(), getLocation());
{code}

But a java.lang.NullPointerException is always thrown.

Stack Trace:
    * $AssetFactory_112326461ec._getStrategy($AssetFactory_112326461ec.java)
    * $AssetFactory_112326461ec.createAsset($AssetFactory_112326461ec.java)
    * $AssetFactory_11232646073.createAsset($AssetFactory_11232646073.java)
    * com.face.h4p.webreporting.pages.FinalStep.getPreviewAsset(FinalStep.java:113)
    * $$FinalStep_43$access_previewAsset_1123264622e.readProperty($$FinalStep_43$access_previewAsset_1123264622e.java)
    * com.javaforge.tapestry.prop.PropertyAccessorBinding.getObject(PropertyAccessorBinding.java:59)
    * org.apache.tapestry.binding.AbstractBinding.getObject(AbstractBinding.java:84)
    * $ReportInvoker_44.getPreviewImage($ReportInvoker_44.java)
    * 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:585)
    * ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:632)
    * ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java:1049)
    * ognl.ObjectPropertyAccessor.getPossibleProperty(ObjectPropertyAccessor.java:60)
    * ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:134)
    * ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1760)
    * ognl.ASTProperty.getValueBody(ASTProperty.java:109)
    * ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:200)
    * ognl.SimpleNode.getValue(SimpleNode.java:244)
    * ognl.Ognl.getValue(Ognl.java:376)
    * ognl.Ognl.getValue(Ognl.java:340)
    * org.apache.tapestry.services.impl.HiveMindExpressionCompiler.compileExpression(HiveMindExpressionCompiler.java:146)
    * ognl.OgnlRuntime.compileExpression(OgnlRuntime.java:387)
    * ognl.Ognl.compileExpression(Ognl.java:123)
    * org.apache.tapestry.services.impl.ExpressionCacheImpl.parse(ExpressionCacheImpl.java:129)
    * org.apache.tapestry.services.impl.ExpressionCacheImpl.getCompiledExpression(ExpressionCacheImpl.java:91)
    * $ExpressionCache_112326461a9.getCompiledExpression($ExpressionCache_112326461a9.java)
    * org.apache.tapestry.binding.ExpressionBinding.resolveExpression(ExpressionBinding.java:122)
    * org.apache.tapestry.binding.ExpressionBinding.getObject(ExpressionBinding.java:113)
    * org.apache.tapestry.binding.AbstractBinding.getObject(AbstractBinding.java:84)
    * $Image_30.getImage($Image_30.java)
    * org.apache.tapestry.html.Image.renderComponent(Image.java:46)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
    * org.apache.tapestry.link.DefaultLinkRenderer.renderLink(DefaultLinkRenderer.java:91)
    * org.apache.tapestry.link.AbstractLinkComponent.renderComponent(AbstractLinkComponent.java:94)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
    * org.apache.tapestry.components.ForBean.renderComponent(ForBean.java:181)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
    * org.apache.tapestry.components.RenderBody.renderComponent(RenderBody.java:41)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
    * org.apache.tapestry.form.FormSupportImpl.render(FormSupportImpl.java:514)
    * org.apache.tapestry.form.Form.renderComponent(Form.java:226)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
    * org.apache.tapestry.html.Body.renderComponent(Body.java:38)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
    * com.face.h4p.webreporting.tapestry.XMLShell.renderComponent(XMLShell.java:67)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
    * org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
    * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:182)
    * org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:237)
    * org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:397)
    * org.apache.tapestry.services.impl.DefaultResponseBuilder.renderResponse(DefaultResponseBuilder.java:158)
    * org.apache.tapestry.services.impl.ResponseRendererImpl.renderResponse(ResponseRendererImpl.java:33)
    * $ResponseRenderer_11232646081.renderResponse($ResponseRenderer_11232646081.java)
    * org.apache.tapestry.engine.DirectService.service(DirectService.java:147)
    * $IEngineService_112326460f2.service($IEngineService_112326460f2.java)
    * org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:72)
    * org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:246)
    * org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:54)
    * $WebRequestServicer_112326460cb.service($WebRequestServicer_112326460cb.java)
    * $WebRequestServicer_112326460c7.service($WebRequestServicer_112326460c7.java)
    * org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:61)
    * $ServletRequestServicer_112326460ad.service($ServletRequestServicer_112326460ad.java)
    * org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
    * $ServletRequestServicerFilter_112326460a9.service($ServletRequestServicerFilter_112326460a9.java)
    * $ServletRequestServicer_112326460af.service($ServletRequestServicer_112326460af.java)
    * org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
    * $ServletRequestServicerFilter_112326460a7.service($ServletRequestServicerFilter_112326460a7.java)
    * $ServletRequestServicer_112326460af.service($ServletRequestServicer_112326460af.java)
    * org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
    * $ServletRequestServicerFilter_112326460ab.service($ServletRequestServicerFilter_112326460ab.java)
    * $ServletRequestServicer_112326460af.service($ServletRequestServicer_112326460af.java)
    * $ServletRequestServicer_112326460a1.service($ServletRequestServicer_112326460a1.java)
    * org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:123)
    * org.apache.tapestry.ApplicationServlet.doPost(ApplicationServlet.java:168)
    * javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    * javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    * org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    * org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    * org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    * org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    * org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    * org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    * org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    * org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    * org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
    * org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    * org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    * org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    * org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
    * org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:495)
    * org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    * org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    * org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    * org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    * org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    * org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    * java.lang.Thread.run(Thread.java:595)



{code} tags did not work...

> Regression in the AssetFactory().createAsset()
> ----------------------------------------------
>
>                 Key: TAPESTRY-1432
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1432
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.1.2
>         Environment: Windows XP, jboss-4.0.5.GA, JRE 1.5.0_11
>            Reporter: Andrej Aschenbrenner
>
> In the latest snapshot of Tapestry it is impossible to create an Asset from Java code.
> Previously this code snippet worked without problems:
> /**
>  * Returns the preview asset from the current report.
>  *
>  * @return The preview asset.
>  */
> public final IAsset getPreviewAsset() {
>     if (getCurrentReport().getPreviewPath() != null) {
>         Infrastructure infrastructure = getEngine().getInfrastructure();
>         try {
>             IAsset asset = infrastructure.getAssetFactory().createAsset(
>                                               infrastructure.getContextRoot(),
>                                               getCurrentReport().getPreviewPath(),
>                                               getLocale(), getLocation());
>             return asset;
>         } catch (ApplicationRuntimeException e) {
>             return getAsset("iPreviewEmpty");
>         }
>     }
>    return getAsset("iPreviewEmpty");
> }
> getCurrentReport().getPreviewPath() contains "images/path/toanimage.png"
> For the latest Tapestry snapshot I had to change the function call to
> IAsset asset = infrastructure.getAssetFactory().createAsset(null,
>                                       infrastructure.getContextRoot(),
>                                       getCurrentReport().getPreviewPath(),
>                                       getLocale(), getLocation());
> I also tried
> IAsset asset = infrastructure.getAssetFactory().createAsset(getSpecification(),
>                                       infrastructure.getContextRoot(),
>                                       getCurrentReport().getPreviewPath(),
>                                       getLocale(), getLocation());
> But a java.lang.NullPointerException is always thrown.
> Stack Trace:
>     * $AssetFactory_112326461ec._getStrategy($AssetFactory_112326461ec.java)
>     * $AssetFactory_112326461ec.createAsset($AssetFactory_112326461ec.java)
>     * $AssetFactory_11232646073.createAsset($AssetFactory_11232646073.java)
>     * com.face.h4p.webreporting.pages.FinalStep.getPreviewAsset(FinalStep.java:113)
>     * $$FinalStep_43$access_previewAsset_1123264622e.readProperty($$FinalStep_43$access_previewAsset_1123264622e.java)
>     * com.javaforge.tapestry.prop.PropertyAccessorBinding.getObject(PropertyAccessorBinding.java:59)
>     * org.apache.tapestry.binding.AbstractBinding.getObject(AbstractBinding.java:84)
>     * $ReportInvoker_44.getPreviewImage($ReportInvoker_44.java)
>     * 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:585)
>     * ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:632)
>     * ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java:1049)
>     * ognl.ObjectPropertyAccessor.getPossibleProperty(ObjectPropertyAccessor.java:60)
>     * ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:134)
>     * ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1760)
>     * ognl.ASTProperty.getValueBody(ASTProperty.java:109)
>     * ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:200)
>     * ognl.SimpleNode.getValue(SimpleNode.java:244)
>     * ognl.Ognl.getValue(Ognl.java:376)
>     * ognl.Ognl.getValue(Ognl.java:340)
>     * org.apache.tapestry.services.impl.HiveMindExpressionCompiler.compileExpression(HiveMindExpressionCompiler.java:146)
>     * ognl.OgnlRuntime.compileExpression(OgnlRuntime.java:387)
>     * ognl.Ognl.compileExpression(Ognl.java:123)
>     * org.apache.tapestry.services.impl.ExpressionCacheImpl.parse(ExpressionCacheImpl.java:129)
>     * org.apache.tapestry.services.impl.ExpressionCacheImpl.getCompiledExpression(ExpressionCacheImpl.java:91)
>     * $ExpressionCache_112326461a9.getCompiledExpression($ExpressionCache_112326461a9.java)
>     * org.apache.tapestry.binding.ExpressionBinding.resolveExpression(ExpressionBinding.java:122)
>     * org.apache.tapestry.binding.ExpressionBinding.getObject(ExpressionBinding.java:113)
>     * org.apache.tapestry.binding.AbstractBinding.getObject(AbstractBinding.java:84)
>     * $Image_30.getImage($Image_30.java)
>     * org.apache.tapestry.html.Image.renderComponent(Image.java:46)
>     * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
>     * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
>     * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
>     * org.apache.tapestry.link.DefaultLinkRenderer.renderLink(DefaultLinkRenderer.java:91)
>     * org.apache.tapestry.link.AbstractLinkComponent.renderComponent(AbstractLinkComponent.java:94)
>     * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
>     * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
>     * org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
>     * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
>     * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
>     * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
>     * org.apache.tapestry.components.ForBean.renderComponent(ForBean.java:181)
>     * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
>     * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
>     * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
>     * org.apache.tapestry.components.RenderBody.renderComponent(RenderBody.java:41)
>     * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
>     * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
>     * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
>     * org.apache.tapestry.form.FormSupportImpl.render(FormSupportImpl.java:514)
>     * org.apache.tapestry.form.Form.renderComponent(Form.java:226)
>     * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
>     * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
>     * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
>     * org.apache.tapestry.html.Body.renderComponent(Body.java:38)
>     * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
>     * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
>     * org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:525)
>     * com.face.h4p.webreporting.tapestry.XMLShell.renderComponent(XMLShell.java:67)
>     * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
>     * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
>     * org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
>     * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
>     * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
>     * org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
>     * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:712)
>     * org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:182)
>     * org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:237)
>     * org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:397)
>     * org.apache.tapestry.services.impl.DefaultResponseBuilder.renderResponse(DefaultResponseBuilder.java:158)
>     * org.apache.tapestry.services.impl.ResponseRendererImpl.renderResponse(ResponseRendererImpl.java:33)
>     * $ResponseRenderer_11232646081.renderResponse($ResponseRenderer_11232646081.java)
>     * org.apache.tapestry.engine.DirectService.service(DirectService.java:147)
>     * $IEngineService_112326460f2.service($IEngineService_112326460f2.java)
>     * org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:72)
>     * org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:246)
>     * org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:54)
>     * $WebRequestServicer_112326460cb.service($WebRequestServicer_112326460cb.java)
>     * $WebRequestServicer_112326460c7.service($WebRequestServicer_112326460c7.java)
>     * org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:61)
>     * $ServletRequestServicer_112326460ad.service($ServletRequestServicer_112326460ad.java)
>     * org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
>     * $ServletRequestServicerFilter_112326460a9.service($ServletRequestServicerFilter_112326460a9.java)
>     * $ServletRequestServicer_112326460af.service($ServletRequestServicer_112326460af.java)
>     * org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
>     * $ServletRequestServicerFilter_112326460a7.service($ServletRequestServicerFilter_112326460a7.java)
>     * $ServletRequestServicer_112326460af.service($ServletRequestServicer_112326460af.java)
>     * org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
>     * $ServletRequestServicerFilter_112326460ab.service($ServletRequestServicerFilter_112326460ab.java)
>     * $ServletRequestServicer_112326460af.service($ServletRequestServicer_112326460af.java)
>     * $ServletRequestServicer_112326460a1.service($ServletRequestServicer_112326460a1.java)
>     * org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:123)
>     * org.apache.tapestry.ApplicationServlet.doPost(ApplicationServlet.java:168)
>     * javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>     * javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
>     * org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>     * org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>     * org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
>     * org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>     * org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>     * org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>     * org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>     * org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
>     * org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
>     * org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
>     * org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>     * org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>     * org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
>     * org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:495)
>     * org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>     * org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>     * org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>     * org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>     * org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>     * org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
>     * java.lang.Thread.run(Thread.java:595)

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Mime
View raw message