kurtomerfaruk / wicked-charts

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

Problem loading annotated class #55

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an Eclipse JSF 2.1 project using wicked-charts-highcharts-1.4.2.jar 
in your classpath
2. Run the project on a Tomcat 7 server
3. The JSF page comes up blank due to a "java.lang.NoClassDefFoundError

What is the expected output? What do you see instead?
There should be no error and the JSF page should load correctly. Instead the 
page comes up blank and the console displays: "SEVERE: Unable to load annotated 
class: <myBeanClass> , reason: java.lang.NoClassDefFoundError: 
com/googlecode/wickedcharts/highcharts/options/color/ColorReference"

What version of the product are you using? On what operating system?
Using wicked-charts-jsf21-1.5.0 on Windows 7

Please provide any additional information below.

I've double chekked web.xml and faces-config, both of them are as they should 
be.
My bean class looks like this:

package Charts;

import java.util.Arrays;

import javax.faces.bean.ManagedBean;

import com.googlecode.wickedcharts.highcharts.options.*;
import com.googlecode.wickedcharts.highcharts.options.series.*;

@ManagedBean(name="chart")
public class WickedCharts {

    private Options options;

    public Options getOptions(){
        createChart();
        return options;
    }

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

    public void createChart(){

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

    options
        .setTitle(new Title("My very own chart."));

    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 })));
    }
}

and the html file:

<?xml version='1.0' encoding='UTF-8' ?>
<h:html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:wc="http://googlecode.com/wickedcharts">
  <h:head>
    <script src="jquery.js" type="text/javascript"></script>
  </h:head>
  <h:body>
    <script src="highcharts.js" type="text/javascript"></script>
    <wc:chart id="chart1" options="#{chart.options}" />
  </h:body>
</h:html>

Original issue reported on code.google.com by mortenda...@gmail.com on 21 Nov 2013 at 12:58

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

Original comment by tom.homb...@gmail.com on 21 Apr 2014 at 12:03