Statistical charts in JSP - problem

Statistical charts in JSP - problem

hey! i get this error when i run the code (with slight changes in query)!

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 9 in the generated java file Only a type can be imported. org.jfree.chart.ChartUtilities resolves to a package

An error occurred at line: 10 in the generated java file Only a type can be imported. org.jfree.chart.JFreeChart resolves to a package

An error occurred at line: 11 in the generated java file Only a type can be imported. org.jfree.chart.plot.PlotOrientation resolves to a package

An error occurred at line: 13 in the generated java file Only a type can be imported. org.jfree.data.jdbc.JDBCCategoryDataset resolves to a package

An error occurred at line: 11 in the jsp file: /BarChart.jsp JDBCCategoryDataset cannot be resolved to a type 8: <%@ page import="org.jfree.data.jdbc.JDBCCategoryDataset"%> 9: <% 10: String query="SELECT db2admin.NOMINALROLL.NARRESTS,db2admin.NOMINALROLL.FNAME FROM db2admin.NOMINALROLL"; 11: JDBCCategoryDataset dataset=new JDBCCategoryDataset("jdbc:db2://localhost:50000/FPARK","com.ibm.db2.jcc.DB2Driver","db2admin","admin"); 12: dataset.executeQuery(query); 13: JFreeChart chart = ChartFactory.createBarChart3D("Test", "name", "no of arrests", dataset, PlotOrientation.VERTICAL,true, true, false); 14: try

An error occurred at line: 11 in the jsp file: /BarChart.jsp JDBCCategoryDataset cannot be resolved to a type 8: <%@ page import="org.jfree.data.jdbc.JDBCCategoryDataset"%> 9: <% 10: String query="SELECT db2admin.NOMINALROLL.NARRESTS,db2admin.NOMINALROLL.FNAME FROM db2admin.NOMINALROLL"; 11: JDBCCategoryDataset dataset=new JDBCCategoryDataset("jdbc:db2://localhost:50000/FPARK","com.ibm.db2.jcc.DB2Driver","db2admin","admin"); 12: dataset.executeQuery(query); 13: JFreeChart chart = ChartFactory.createBarChart3D("Test", "name", "no of arrests", dataset, PlotOrientation.VERTICAL,true, true, false); 14: try

An error occurred at line: 13 in the jsp file: /BarChart.jsp JFreeChart cannot be resolved to a type 10: String query="SELECT db2admin.NOMINALROLL.NARRESTS,db2admin.NOMINALROLL.FNAME FROM db2admin.NOMINALROLL"; 11: JDBCCategoryDataset dataset=new JDBCCategoryDataset("jdbc:db2://localhost:50000/FPARK","com.ibm.db2.jcc.DB2Driver","db2admin","admin"); 12: dataset.executeQuery(query); 13: JFreeChart chart = ChartFactory.createBarChart3D("Test", "name", "no of arrests", dataset, PlotOrientation.VERTICAL,true, true, false); 14: try 15: { 16: org.jfree.chart.ChartUtilities.saveChartAsJPEG(new File("C:/chart.jpg"), chart, 400, 300);

An error occurred at line: 13 in the jsp file: /BarChart.jsp ChartFactory cannot be resolved 10: String query="SELECT db2admin.NOMINALROLL.NARRESTS,db2admin.NOMINALROLL.FNAME FROM db2admin.NOMINALROLL"; 11: JDBCCategoryDataset dataset=new JDBCCategoryDataset("jdbc:db2://localhost:50000/FPARK","com.ibm.db2.jcc.DB2Driver","db2admin","admin"); 12: dataset.executeQuery(query); 13: JFreeChart chart = ChartFactory.createBarChart3D("Test", "name", "no of arrests", dataset, PlotOrientation.VERTICAL,true, true, false); 14: try 15: { 16: org.jfree.chart.ChartUtilities.saveChartAsJPEG(new File("C:/chart.jpg"), chart, 400, 300);

An error occurred at line: 13 in the jsp file: /BarChart.jsp PlotOrientation.VERTICAL cannot be resolved to a type 10: String query="SELECT db2admin.NOMINALROLL.NARRESTS,db2admin.NOMINALROLL.FNAME FROM db2admin.NOMINALROLL"; 11: JDBCCategoryDataset dataset=new JDBCCategoryDataset("jdbc:db2://localhost:50000/FPARK","com.ibm.db2.jcc.DB2Driver","db2admin","admin"); 12: dataset.executeQuery(query); 13: JFreeChart chart = ChartFactory.createBarChart3D("Test", "name", "no of arrests", dataset, PlotOrientation.VERTICAL,true, true, false); 14: try 15: { 16: org.jfree.chart.ChartUtilities.saveChartAsJPEG(new File("C:/chart.jpg"), chart, 400, 300);

An error occurred at line: 16 in the jsp file: /BarChart.jsp org.jfree.chart.ChartUtilities cannot be resolved to a type 13: JFreeChart chart = ChartFactory.createBarChart3D("Test", "name", "no of arrests", dataset, PlotOrientation.VERTICAL,true, true, false); 14: try 15: { 16: org.jfree.chart.ChartUtilities.saveChartAsJPEG(new File("C:/chart.jpg"), chart, 400, 300); 17: } 18: catch (IOException e) 19: {

Stacktrace: org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439) org.apache.jasper.compiler.Compiler.compile(Compiler.java:349) org.apache.jasper.compiler.Compiler.compile(Compiler.java:327) org.apache.jasper.compiler.Compiler.compile(Compiler.java:314) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:326) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.

View Answers

March 25, 2011 at 3:10 PM

Before importing jfreechart package, you need to download the jfreechart api and put the jsr file inside the lib folder of apache tomcat. Then restart the tomcat server.









Related Tutorials/Questions & Answers:
statistical graph in jsp - JSP-Servlet
statistical graph in jsp  how to create a statistical graph to show the highest mark and the lowest mark of a table named test which consist of two fields id, and score is there any way to have the id's and the scores represented
java bar charts and jsp
java bar charts and jsp  Hi, Can any one help me out in how to create java bar charts using jsp with the help of data base table values? thanks.../jsp/draw-statistical-chart-jsp.shtml
Advertisements
Charts in JSP - JSP-Servlet
of charts in JSP.. So, Can i know the pre requirement for that? Do i need... the following link: http://www.roseindia.net/jsp/draw-statistical-chart...Charts in JSP  Hi Roseindia team, This is ragav.. I
Doubt regarding charts and jsp
-jsppage.shtml http://www.roseindia.net/jsp/draw-statistical-chart-jsp.shtml...Doubt regarding charts and jsp  Hi, I successfully executed... in web application(jsp). So,please help me out in how to connect the normal
generate charts using JSP
generate charts using JSP  any one know coding for generate bar chart or pie chart using JSP
java charts - JSP-Servlet
java charts  Hi,can any one tell me how to create dyanamic charts wrt database contents by using jsp-servlet
Bar charts and jsp
Bar charts and jsp  Hi, How to generate Dynamic Bar Chart Images using jsp with placing any image location in weebroots? Thanks in advance
Charts in JSP - JSP-Servlet
Charts in JSP  Hi, Thanks for replying for the chart query I made 2 days back.. Can u plz provide me an example for creating a series bar chart with the datas coming from the database? Series chart in the sense, If I have x
Doubt regarding charts and jsp
Doubt regarding charts and jsp  Hi in the http://www.roseindia.net/chartgraphs/barchart-jsppage.shtml of the code (new StandardEntityCollection()); final File file1 = new File("../webapps/jspchart/web/barchart.png
java with jsp and dynamic database retrival for bar charts
java with jsp and dynamic database retrival for bar charts  Hi, I am having a table name tablelogin,it consists of columns userid,logintime,sessionid,ip_address,logout. so,can any one help me out how to get the bar chart
graphs/charts - JSP-Servlet
); } catch (IOException e) { System.out.println("Problem in creating chart
graphs/charts - JSP-Servlet
); } catch (IOException e) { System.out.println("Problem in creating chart
statistical data analysis course
statistical data analysis course  Hi, I am beginner in Data Science...: statistical data analysis course Try to provide me good examples or tutorials links so that I can learn the topic "statistical data analysis course"
stanford statistical learning course
stanford statistical learning course  Hi, I am beginner in Data...: stanford statistical learning course Try to provide me good examples or tutorials links so that I can learn the topic "stanford statistical learning
statistical machine learning stanford
statistical machine learning stanford  Hi, I am beginner in Data...: statistical machine learning stanford Try to provide me good examples or tutorials links so that I can learn the topic "statistical machine learning
statistical learning coursera
statistical learning coursera  Hi, I am beginner in Data Science...: statistical learning coursera Try to provide me good examples or tutorials links so that I can learn the topic "statistical learning coursera". Also tell me
the elements of statistical learning course
the elements of statistical learning course  Hi, I am beginner... to learn: the elements of statistical learning course Try to provide me good... of statistical learning course". Also tell me which is the good training courses
advanced statistical learning
advanced statistical learning  Hi, I am beginner in Data Science... statistical learning Try to provide me good examples or tutorials links so that I can learn the topic "advanced statistical learning". Also tell me
statistical machine learning asu
statistical machine learning asu  Hi, I am beginner in Data Science...: statistical machine learning asu Try to provide me good examples or tutorials links so that I can learn the topic "statistical machine learning asu"
statistical learning for data science
statistical learning for data science  Hi, I am beginner in Data...: statistical learning for data science Try to provide me good examples or tutorials links so that I can learn the topic "statistical learning for data
ModuleNotFoundError: No module named 'Statistical_Computation'
ModuleNotFoundError: No module named 'Statistical_Computation'  Hi...: No module named 'Statistical_Computation' How to remove the ModuleNotFoundError: No module named 'Statistical_Computation' error? Thanks   
ModuleNotFoundError: No module named 'Statistical_Computation'
ModuleNotFoundError: No module named 'Statistical_Computation'  Hi...: No module named 'Statistical_Computation' How to remove the ModuleNotFoundError: No module named 'Statistical_Computation' error? Thanks   
statistical thinking for data science and analytics
statistical thinking for data science and analytics  Hi, I am... for the tutorials to learn: statistical thinking for data science and analytics Try to provide...;statistical thinking for data science and analytics". Also tell me which
Draw Statistical chart in jsp
Draw Statistical chart in jsp       This section illustrates you how to draw statistical chart in jsp by getting values from database.. To draw a bar chart, we have
ModuleNotFoundError: No module named 'my-statistical-distributions'
ModuleNotFoundError: No module named 'my-statistical-distributions'  ...: No module named 'my-statistical-distributions' How to remove the ModuleNotFoundError: No module named 'my-statistical-distributions' error
ModuleNotFoundError: No module named 'my-statistical-distributions'
ModuleNotFoundError: No module named 'my-statistical-distributions'  ...: No module named 'my-statistical-distributions' How to remove the ModuleNotFoundError: No module named 'my-statistical-distributions' error
ModuleNotFoundError: No module named 'statistical-clear-sky'
ModuleNotFoundError: No module named 'statistical-clear-sky'  Hi...: No module named 'statistical-clear-sky' How to remove the ModuleNotFoundError: No module named 'statistical-clear-sky' error? Thanks   Hi
ModuleNotFoundError: No module named 'statistical-clear-sky'
ModuleNotFoundError: No module named 'statistical-clear-sky'  Hi...: No module named 'statistical-clear-sky' How to remove the ModuleNotFoundError: No module named 'statistical-clear-sky' error? Thanks   Hi
ModuleNotFoundError: No module named 'Basic-Statistical-distributions'
ModuleNotFoundError: No module named 'Basic-Statistical-distributions' ...: ModuleNotFoundError: No module named 'Basic-Statistical-distributions' How to remove the ModuleNotFoundError: No module named 'Basic-Statistical-distributions' error
java charts - Development process
java charts  Hi,i want to create charts wrt database by using jsp?please help me
flow charts
flow charts   draw a flow chart program with a user prompt of 5 numbers computing the maximum, minimum and average
jree charts
jree charts  i have to use jfree charts how to download its api and where to keep it in jdk order to execute   Please visit the following link: Download JFreechart Download jfreechart-1.0.13.zip from the given link
fusion charts
fusion charts  hi i have to use the fusion chart. i don't know how to use and code in jsp and i have to create the chart by using the data from db. please help me doing that with exapmles. thank you
ModuleNotFoundError: No module named 'charts'
ModuleNotFoundError: No module named 'charts'  Hi, My Python... 'charts' How to remove the ModuleNotFoundError: No module named 'charts'... to install padas library. You can install charts python with following command
How to create charts in Java?
How to create charts in Java?  Is there any example of creating charts and graphs in Java? thanks   Hi, check the tutorial: Chart & Graphs Tutorials in Java Thanks
Doubt Regarding Charts
Doubt Regarding Charts  Hi, Can you please help me out by answering "hoe to include charts in core java code and struts code" thanks in advance... charts and graphs
Version of com.ahome-it>lienzo-charts dependency
List of Version of com.ahome-it>lienzo-charts dependency
Merge XYLine and XYArea Charts
Merge XYLine and XYArea Charts  I wonder how to merge two charts... (this website) how to use two XYLine Charts and display them. Please, see screenshot... appreciate any help. Please, bear in mind I am new to charts plotting in java
ModuleNotFoundError: No module named 'agate-charts'
ModuleNotFoundError: No module named 'agate-charts'  Hi, My Python... 'agate-charts' How to remove the ModuleNotFoundError: No module named 'agate-charts' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'djangocms-charts'
ModuleNotFoundError: No module named 'djangocms-charts'  Hi, My... named 'djangocms-charts' How to remove the ModuleNotFoundError: No module named 'djangocms-charts' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'plotly-charts'
ModuleNotFoundError: No module named 'plotly-charts'  Hi, My... 'plotly-charts' How to remove the ModuleNotFoundError: No module named 'plotly-charts' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'plotly-charts'
ModuleNotFoundError: No module named 'plotly-charts'  Hi, My... 'plotly-charts' How to remove the ModuleNotFoundError: No module named 'plotly-charts' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'pudzu-charts'
ModuleNotFoundError: No module named 'pudzu-charts'  Hi, My Python... 'pudzu-charts' How to remove the ModuleNotFoundError: No module named 'pudzu-charts' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'agate-charts'
ModuleNotFoundError: No module named 'agate-charts'  Hi, My Python... 'agate-charts' How to remove the ModuleNotFoundError: No module named 'agate-charts' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'django-charts'
ModuleNotFoundError: No module named 'django-charts'  Hi, My... 'django-charts' How to remove the ModuleNotFoundError: No module named 'django-charts' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'djangocms-charts'
ModuleNotFoundError: No module named 'djangocms-charts'  Hi, My... named 'djangocms-charts' How to remove the ModuleNotFoundError: No module named 'djangocms-charts' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'Flask-Charts'
ModuleNotFoundError: No module named 'Flask-Charts'  Hi, My Python... 'Flask-Charts' How to remove the ModuleNotFoundError: No module named 'Flask-Charts' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'helm-charts'
ModuleNotFoundError: No module named 'helm-charts'  Hi, My Python... 'helm-charts' How to remove the ModuleNotFoundError: No module named 'helm-charts' error? Thanks   Hi, In your python environment
Good Looking Java Charts and Graphs
Good Looking Java Charts and Graphs  Is there a java chart library that will generate charts and graphs with the quality of visifire or fusion charts? The JFreeChart graph quality is not professional looking. Unless it can
jsp
jsp  how jsp translated into servlets

Ads