8 Replies Latest reply on Mar 10, 2008 5:50 PM by Uros Majeric

    s:graphicImage input == null!

    Uros Majeric Newbie

      Did anyone have a problem with s:graphicImage?
      I have a problem when I put in value path to my picture:


      <s:graphicImage value="/pictures/#{user.picturePath}" />


      if there is no picture in this path it says


      input == null!



      Thanks,
      Uros


        • 2. Re: s:graphicImage input == null!
          Keith Naas Novice

          Uros,


          What is the "it" in this statement, "if there is no picture in this path it says input == null!"?


          A stack trace?  The rendered image tag?  A log file message? 



          Keith

          • 3. Re: s:graphicImage input == null!
            Uros Majeric Newbie

            Sorry, I wasn't specific enough:


            Stack trace is:


            java.lang.IllegalArgumentException: input == null!
                 at javax.imageio.ImageIO.createImageInputStream(Unknown Source)
                 at org.jboss.seam.ui.graphicImage.Image.readImage(Image.java:440)
                 at org.jboss.seam.ui.graphicImage.Image.readImage(Image.java:394)
                 at org.jboss.seam.ui.graphicImage.Image.setInput(Image.java:141)
                 at org.jboss.seam.ui.graphicImage.GraphicImageRendererBase.doEncodeBegin(GraphicImageRendererBase.java:31)
                 at org.jboss.seam.ui.util.cdk.RendererBase.encodeBegin(RendererBase.java:79)
                 at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:788)
                 at org.jboss.seam.ui.util.cdk.RendererBase.renderChild(RendererBase.java:184)
                 at org.jboss.seam.ui.util.cdk.RendererBase.renderChildren(RendererBase.java:166)
                 at org.jboss.seam.ui.renderkit.FragmentRendererBase.doEncodeChildren(FragmentRendererBase.java:29)
                 at org.jboss.seam.ui.util.cdk.RendererBase.encodeChildren(RendererBase.java:92)
                 at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
                 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
                 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
                 at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
                 at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                 at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
                 at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
                 at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                 at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                 at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
                 at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
                 at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                 at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                 at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                 at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                 at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                 at java.lang.Thread.run(Unknown Source)
            



            and facelets says:



            An Error Occurred:
            input == null!



            • 4. Re: s:graphicImage input == null!
              Christian Bauer Master

              You want h:graphicImage, not s:graphicImage.

              • 5. Re: s:graphicImage input == null!
                Keith Naas Novice

                Also, if you don't want to render the picture when its not in the path, use the rendered attribute. 


                Cheers

                • 6. Re: s:graphicImage input == null!
                  Uros Majeric Newbie


                  You want h:graphicImage, not s:graphicImage.

                  In this case I can not use


                  <s:transformImageSize width="xxx" />





                  Also, if you don't want to render the picture when its not in the path, use the rendered attribute.

                  How to test if path exists with EL?


                  Uros

                  • 7. Re: s:graphicImage input == null!
                    Christian Bauer Master

                    You can not use s:graphicImage to transform arbitrary files loaded from your filesystem (unless you provide a java.io.File handle through a backing bean). You can however load and transform them from the classpath as a resource.

                    • 8. Re: s:graphicImage input == null!
                      Uros Majeric Newbie

                      But it works if I give a path to picture and transformImageSize. Picture size is actualy xxx px wide.


                      Uros