kurtomerfaruk / wicked-charts

Automatically exported from code.google.com/p/wicked-charts
0 stars 0 forks source link

When trying to create a simple chart, a class javax.faces.FacesException is thrown #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We tried to create a simple chart from a JSF project (2.1.6 is the JSF 
version). We included the .jar dependency in the pom.xml file. We also followed 
the presented steps. Unfortunately, we receive an error.

Here are the simple files that are involved:

<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
    xmlns:wc="http://googlecode.com/wickedcharts"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core">
<f:view>
    <h:head>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
    </h:head>
    <h:body>
        <script src="http://code.highcharts.com/highcharts.js" type="text/javascript"></script>
        <wc:chart id="chart1" options="#{wickedChartsBean.options}" />
    </h:body>
</f:view>
</html>

@ManagedBean(name = "wickedChartsBean")
public class WickedChartsBean  {

    private Options options;

    public WickedChartsBean() {
        options = new Options();

        options.setChartOptions(new ChartOptions().setType(SeriesType.LINE));

        options.setTitle(new Title("Chart 1"));

        options.setxAxis(new Axis().setCategories(Arrays.asList(new String[] {
                "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep",
                "Oct", "Nov", "Dec" })));

        options.setyAxis(new Axis().setTitle(new Title("Temperature (C)")));

        options.setLegend(new Legend().setLayout(LegendLayout.VERTICAL)
                .setAlign(HorizontalAlignment.RIGHT)
                .setVerticalAlign(VerticalAlignment.TOP).setX(-10).setY(100)
                .setBorderWidth(0));

        options.addSeries(new SimpleSeries().setName("Tokyo").setData(
                Arrays.asList(new Number[] { 7.0, 6.9, 9.5, 14.5, 18.2, 21.5,
                        25.2, 26.5, 23.3, 18.3, 13.9, 9.6 })));

        options.addSeries(new SimpleSeries().setName("New York").setData(
                Arrays.asList(new Number[] { -0.2, 0.8, 5.7, 11.3, 17.0, 22.0,
                        24.8, 24.1, 20.1, 14.1, 8.6, 2.5 })));
    }

    public Options getOptions() {
        return options;
    }

    public void setOptions(Options options) {
        this.options = options;
    }   
}

When invoking the page we receive the following error:

Exception type  class javax.faces.FacesException
Exception message   com.sun.faces.NAMED_OBJECT_NOT_FOUND_ERROR
Stack trace     

javax.faces.FacesException: com.sun.faces.NAMED_OBJECT_NOT_FOUND_ERROR
    at com.sun.faces.application.ApplicationImpl.createComponentApplyAnnotations(ApplicationImpl.java:1910)
    at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:1164)
    at org.springframework.faces.webflow.Jsf2FlowApplication.createComponent(Jsf2FlowApplication.java:64)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.createComponent(ComponentTagHandlerDelegateImpl.java:510)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:157)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:107)
    at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:178)
    at com.sun.faces.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:395)
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:366)
    at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:112)

......

Could you give us a clue on what might be wrong?

Thank you in advance,
Horatiu

Original issue reported on code.google.com by horati...@gmail.com on 15 May 2013 at 3:05

GoogleCodeExporter commented 9 years ago
Hi Horatiu,

might be a difference between the sun implementation of JSF you used and the 
MyFaces implementation we used in our tests.

Can you provide the source of a one page "mini application" producing this 
error? I will have a look at it then to find out what the problem is.

Thanks and Regards,
Tom

Original comment by tom.homb...@gmail.com on 17 May 2013 at 7:27

GoogleCodeExporter commented 9 years ago
Please have a look at 
http://wicked-charts.2319560.n4.nabble.com/Error-with-jsf-td7.html for a 
solution to this problem.

Original comment by tom.homb...@gmail.com on 19 Aug 2013 at 8:27

GoogleCodeExporter commented 9 years ago
moved to github at https://github.com/thombergs/wicked-charts/issues/8

Original comment by tom.homb...@gmail.com on 21 Apr 2014 at 11:36

GoogleCodeExporter commented 9 years ago

Original comment by tom.homb...@gmail.com on 21 Apr 2014 at 11:38