aspose file tools*
The moose likes Other Open Source Projects and the fly likes de.flaures.cewolf.PreProcessorException Error. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "de.flaures.cewolf.PreProcessorException Error." Watch "de.flaures.cewolf.PreProcessorException Error." New topic
Author

de.flaures.cewolf.PreProcessorException Error.

Vazzdoin Rocko
Ranch Hand

Joined: Feb 24, 2010
Posts: 40
Hello,
I'm trying to plot a line graph using cewolf library in my JSP page. But i'm getting the error and the stack trace is mentioned below in the end.
The datasource is being fetched from a java file where all the processing is being done.
The bar graph is plotted when i use the same code with the following tag

But this code gives error whenever i replace "verticalbar3d" with the "line" in the 'type' parameter. i.e.


i can't figure out where the problem is.
The below written is the JSP code i'm using.



Whenever i execute this code , no line graph comes up and the graph area is replaced by an error image showing text "de.laures.cewolf.PreProcessingException raised"

PRINT STACK :

SEVERE: CewolfServlet: java.lang.ClassCastException raised by post processor 'graph.Dbdataprovider@15e2075'.
Post processing of this post processor has been ignored.
de.laures.cewolf.PostProcessingException: java.lang.ClassCastException raised by post processor 'graph.Dbdataprovider@15e2075'.
Post processing of this post processor has been ignored.
at de.laures.cewolf.taglib.AbstractChartDefinition.getChart(AbstractChartDefinition.java:161)
at de.laures.cewolf.taglib.ChartImageDefinition.ensureRendered(ChartImageDefinition.java:137)
at de.laures.cewolf.taglib.ChartImageDefinition.getSize(ChartImageDefinition.java:146)
at de.laures.cewolf.CewolfRenderer.doGet(CewolfRenderer.java:153)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:558)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
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:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Sounds like the postprocessor makes an incorrect assumption as to the type of chart it gets - line charts are different than bar charts. Does it maybe perform a cast without checking for the appropriate type first?
Vazzdoin Rocko
Ranch Hand

Joined: Feb 24, 2010
Posts: 40
Then do it requires to type cast first.. if yes then how can i do it ?? i can also post my Java code if you require to review it., just ask.
Thanks for the reply.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Not sure what you mean by "Then do it requires to type cast first". Seeing the code would definitely help.
Vazzdoin Rocko
Ranch Hand

Joined: Feb 24, 2010
Posts: 40
Well the problem has been resolved. Now the line graph is getting plotted but when i try to plot graph with some other values/parametres(date,to-from) then it again shows the graph with the previously provided parametres only... unless i logout and login again and come to the graph page and provide new values. I'm unable to understand where the problem is.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Sounds like some caching is going on. I seem to recall that there's a method in the Java class that you'd implement that determines whether to cache or not ... ah yes, it's called DatasetProducer.hasExpired.
Vazzdoin Rocko
Ranch Hand

Joined: Feb 24, 2010
Posts: 40
Wohh...Thanks for the advice, here i was on mistake. I had put the cache="true". now changed it to "false" and the cache problem is over now. But now i'm again not able to draw line graph again though
i'm pretty much able to draw bar graph but when i try to plot line graph it comes up with the error image instead of graph image as below
screenshot
May be some problem with the de.laures.cewolf Library ?? please help.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
You're better off attaching the screenshot here; I'm not about to visit some random site. Other people probably won't either. If it's an error message then it's better to post its text here anyway.
Vazzdoin Rocko
Ranch Hand

Joined: Feb 24, 2010
Posts: 40
Well it's an error message in the image. can't copy it. And i tried to put the screenshot and previewed it before posting it but the screenshot is shown kind of broken and not opening that's why
i put the URL. anyways i'm trying to put the screenshot let's see if it opens.
Vazzdoin Rocko
Ranch Hand

Joined: Feb 24, 2010
Posts: 40
Here it is....

Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
That's the same as before, isn't it? So we're back to post #2, 3 and 4 in this thread...
Vazzdoin Rocko
Ranch Hand

Joined: Feb 24, 2010
Posts: 40
Exactly.. the problem is the same.I'm unable to get the line graph :-(
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
So what happened to your offer in your 2nd post (which i said might be helpful in my 2nd post) ?
Vazzdoin Rocko
Ranch Hand

Joined: Feb 24, 2010
Posts: 40
Okay Here is the code

JAVA CODE



JSP PAGE



I think that should make you more clear where the problem is... Thanks in advance.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Is the plot a CategoryPlot? Is the domain axis a CategoryAxis? Is the range axis a NumberAxis? Those are the questions you need to answer to track down a ClassCastException. Keep in mind that we don't know in which line of your code this problem occurs.
Vazzdoin Rocko
Ranch Hand

Joined: Feb 24, 2010
Posts: 40
The range axis is showing a number count with respect to the dates on the domain axis. And i don't understand what do you mean by "Is plot a category plot?" Please brief it a bit so that i can answer it.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Your code performs 4 casts. Since the problem is a ClassCastException it's likely that one of those casts causes the problerm. So you need to check whether the objects you're casting from are indeed the type you're casting to.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: de.flaures.cewolf.PreProcessorException Error.