Sigmaaldrich / jsfcal

Automatically exported from code.google.com/p/jsfcal
0 stars 0 forks source link

null pointer exception #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
i am using tomcat 6.0

ÑÏÖØ: Error Rendering View[/monthlyViewCalendar.xhtml]
java.lang.NullPointerException
    at java.io.Reader.<init>(Reader.java:61)
    at java.io.InputStreamReader.<init>(InputStreamReader.java:55)
    at
tr.richfacesext.components.jsfcal.month.MonthViewRenderer.renderLocaleIfApplicab
le(MonthViewRenderer.java:86)
    at
tr.richfacesext.components.jsfcal.month.MonthViewRenderer.encodeWidget(MonthView
Renderer.java:79)
    at
tr.richfacesext.components.jsfcal.month.MonthViewRenderer.encodeEnd(MonthViewRen
derer.java:32)
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
    at
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
    at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
    at
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110
)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:290)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:206)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2
33)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:1
91)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109
)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
    at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Pr
otocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
    at java.lang.Thread.run(Thread.java:619)

Original issue reported on code.google.com by d0u...@gmail.com on 30 Sep 2009 at 8:18

GoogleCodeExporter commented 9 years ago
hello
I'm resolved this problem. You need change renderLocaleIfApplicable method in 
MonthViewRenderer.java the following:

    private void renderLocaleIfApplicable(ResponseWriter writer, MonthView monthView) throws IOException {
        if (!MonthViewConstants.LOCALE_EN.equals(monthView.getLanguage())) {
            InputStream reader = this.getClass().getResourceAsStream(MonthViewConstants.SCRIPT_LOCALE_PREFIX + monthView.getLanguage()  + MonthViewConstants.SCRIPT_LOCALE_SUFFIX);
            // don't have localized monthView, using the default language
            if(reader == null ) {
                return;
            }
            BufferedReader bin = new BufferedReader(new InputStreamReader(reader));
            String str;
            StringBuffer localeStr = new StringBuffer();
            while ((str = bin.readLine()) != null) {
                localeStr.append(str).append("\n");
            }
            writer.write(localeStr.toString());
        }
    }

Original comment by abogna...@gmail.com on 11 Feb 2012 at 4:32