#102 JDK 7 Compatibility Problem - ParamTag

open-works-for-me
nobody
None
7
2015-02-03
2012-02-28
Lawful
No

There seems to be a severe problem with the cewolf:param tag when running Tomcat 7 (7.0.22 x64) under JDK 7.0.3.

Extract from a huge stack trace, relevant lines are:

org.apache.jasper.JasperException: Unable to convert string "#009900" to class "java.io.Serializable" for attribute "value": Property Editor not registered with the PropertyEditorManager
at org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager(JspRuntimeLibrary.java:846)

JSP code is:

<cw:chartpostprocessor id="seriesPaint">
<cw:param name="0" value="#009900"/>
<cw:param name="2" value="#ff0000"/>
<cw:param name="1" value="#3399ff"/>
</cw:chartpostprocessor>

It does not make any difference what the parameter value exactly is, the problem occurs also when passing number (strings), eg. for the Title Enhancer. Switching back to JDK 6.026, everything works fine again.

Apparently Java 7 has Problems converting a string value to Serializable. Part of the problem may be that the setValue() method of ParamTag is overloaded, taking either a String or Serializable as a parameter. I've read somewhere that this may be forbidden by the specs, but didn't look further into this.

Unfortunately, this is kind of a showstopper bug in this scenario, as the entire page fails, and we cannot easily live without the chart postprocessors :-) Meanwhile, we'll stick to Java 6, but we cannot for long, as Oracle announced to terminate support for it in mid-2012. Any help would be greatly appreciated, as this may well also affect others, and CeWolf live charts are quite a great feature.

Discussion

  • Lawful

    Lawful - 2012-02-28
    • priority: 5 --> 7
     
  • Lawful

    Lawful - 2012-02-29

    Think I found a solution that works for me at least. Solution is to simply comment out the Serializabe variant of setValue() in ParamTag. There already is an overloaded setter taking a String value that works perfectly with JDK 7. Probably this could be changed to Object, as that is how the value is stored internally, but I didn't try. Day saved, at least :-)

     
  • Lawful

    Lawful - 2012-02-29
    • status: open --> open-works-for-me
     
  • Ulf Dittmer

    Ulf Dittmer - 2013-02-09

    I had at the time ignored this issue since you figured out a solution quickly on your on. That solution, however, is not perfect, e.g. it breaks one of the "complex" charts in the example web app. And of course it requires a code change that makes upgrading difficult.

    I have now uploaded a beta version of cewolf that I hope will address this issue, although at the cost of trivially adapting any postprocessors you may have written. I can't test it directly due to lack of access to Java 7 (it works fine on Java 6, though), but if you don't mind a little experimenting, get the cewolf-1.2.2-b1.jar from the "beta" directory and see if that fixes the problem. There's more detail about the change in the release notes on that page. Feel free to hit me with any questions.

     
  • Ben Nzewi

    Ben Nzewi - 2015-02-03

    Hello,

    We recently upgraded to JDK 1.8 from 1.6 and had this same problem: org.apache.jasper.JasperException: Unable to convert string "#FF0000" to class "java.io.Serializable" for attribute "value": Property Editor not registered with the PropertyEditorManager

    JSP Code:

    <cewolf:chartpostprocessor id="seriesPaint">
    <cewolf:param name="0" value="#FF0000"/>
    <cewolf:param name="1" value="#FFA500"/>
    <cewolf:param name="2" value="#9504AE"/>
    <cewolf:param name="3" value="#088A08"/>
    </cewolf:chartpostprocessor>

    We currently have the latest version of cewolf i.e. 1.2.4.

    Can you please advice on if you managed to verify your changes on JDK 1.7?

    Thanks

    Ben

     
  • Ulf Dittmer

    Ulf Dittmer - 2015-02-03

    Ben, judging by "JasperException", the problem may not be in cewolf, but in JasperReports: cewolf no longer uses Serializable for setting the "value" attribute. Maybe Jasper ships with an older cewolf version which is used instead? Post the full stack trace, so we can see where the problem occurs.

     
  • Adithya

    Adithya - 2015-02-03

    Hello,

    Below is the complete stack trace

    org.apache.jasper.JasperException: Unable to convert string "#FF0000" to class "java.io.Serializable" for attribute "value": Property Editor not registered with the PropertyEditorManager
    org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager(JspRuntimeLibrary.java:873)
    org.apache.jsp.WEB_002dINF.jsp.lastrunstatus_jsp._jspx_meth_cewolf_005fparam_005f0(lastrunstatus_jsp.java:772)
    org.apache.jsp.WEB_002dINF.jsp.lastrunstatus_jsp._jspx_meth_cewolf_005fchartpostprocessor_005f0(lastrunstatus_jsp.java:729)
    org.apache.jsp.WEB_002dINF.jsp.lastrunstatus_jsp._jspx_meth_cewolf_005fchart_005f0(lastrunstatus_jsp.java:637)
    org.apache.jsp.WEB_002dINF.jsp.lastrunstatus_jsp._jspService(lastrunstatus_jsp.java:510)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
    org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
    org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:264)
    org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208)
    org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:816)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)

    Thanks,
    Adithya

     
  • Ulf Dittmer

    Ulf Dittmer - 2015-02-03

    I see. Ignore my comment about JasperReports, I was thrown off by "JasperException" - the Jasper in question is just Tomcat's JSP engine.

    Strange thing is, it works fine for me on Java 7, and cewolf doesn't use Serializable for parameters any more. Please download java7test.jsp.txt from https://sourceforge.net/projects/cewolf/files/beta/, rename it to *.jsp, and see what happens if you access it directly as part of your web app. You may have to change the URL in the cewolf:img tag, since your web app likely isn't called "cewolf".

    I wonder if Spring somehow interferes with this; I don't use it, so I have no idea of what interactions there might be.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks