Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem loading annotated class #22

Open
thombergs opened this issue Apr 21, 2014 · 0 comments
Open

Problem loading annotated class #22

thombergs opened this issue Apr 21, 2014 · 0 comments

Comments

@thombergs
Copy link
Member

Reported by mortendamby, Nov 20, 2013
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: , 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>
@thombergs thombergs modified the milestone: 1.6.0 Apr 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants