Problems with Tomcat 5.5.x and Java 1.5.0?

Help
DVader666
2006-03-01
2013-01-13
  • DVader666
    DVader666
    2006-03-01

    I had a functional webapp with some Cewolf pages working on Tomcat 4.1.x and java 1.4.2. I moved to Tomcat 5.5.12 and Java 1.5.0 and now I'm getting errors for all those pages where DatasetProducer in implemented directly in JSP page via scriptlets in the same way as sample Cewolf webapp. In fact, I can't run sample Cewolf webapp under that setup (Tomcat 5.5.12 and Java 1.5.0). Reported errors (in page and logs) are like:

    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: 19 in the jsp file: /cewolfset_inc.jsp
    Generated servlet error:
    The type new DatasetProducer(){} must implement the inherited abstract method DatasetProducer.hasExpired(Map, Date)

    An error occurred at line: 19 in the jsp file: /cewolfset_inc.jsp
    Generated servlet error:
    The type new DatasetProducer(){} must implement the inherited abstract method DatasetProducer.produceDataset(Map)

    The same unaltered sample webapp runs ok in Tomcat 4.1.x and java 1.4.2.

    Can anyone help?

     
    • DVader666
      DVader666
      2006-03-01

      Please?

       
    • Brian Fox
      Brian Fox
      2006-03-01

      Tomcat 5 uses a different servlet version 2.4 and cewolf probably doesn't support the changes. Tomcat 5.5 uses java 1.5 and I'm sure there will be issues there also.

       
      • Peter
        Peter
        2007-05-04

        This is really bad. I was enthusiastic when I read about Cewolf at first because I sounded exactly like the thing I looked for. Unfortunately I need Jboss 4.04 and Java 1.5, so I have problems with the servlet specification and the java version. Has anybody found a workaround for this? Or is it recommended to just stick to those old versions? And which versions are actually supported? Thanks!! :)

         
    • DVader666
      DVader666
      2006-03-01

      I have found that for those charts where I created my own implementations of de.laures.cewolf.DatasetProducer they work ok, like:

      public class CategoryData implements DatasetProducer, Serializable {...}

      In this case, if I use <jsp:useBean .../> to call my implemented CategoryData object the charts work (as I already said). Implementations of de.laures.cewolf.ChartPostProcessor work this way too in my current environment (Tomcat 5.5.x and Java 1.5.0).

      But then again, the problem appears whenever a DatasetProducer is implemented directly in JSP page using scriptlets as done in many JSP pages in the sample Cewolf webapp, as in (taken from cewolfset_inc.jsp in sample webapp):

      ...
          DatasetProducer categoryData = new DatasetProducer() {
              public Object produceDataset(Map params) {
                  final String[] categories = { "apples", "pies", "bananas", "oranges" };
                  final String[] seriesNames = { "Peter", "Helga", "Franz", "Olga" };
                  final Integer[][] startValues = new Integer[seriesNames.length][categories.length];
                  final Integer[][] endValues = new Integer[seriesNames.length][categories.length];
                  for (int series = 0; series < seriesNames.length; series++) {
                      for (int i = 0; i < categories.length; i++) {
                          int y = (int) (Math.random() * 10 + 1);
                          startValues[series][i] = new Integer(y);
                          endValues[series][i] = new Integer(y + (int) (Math.random() * 10));
                      }
                  }
                  DefaultIntervalCategoryDataset ds =
                      new DefaultIntervalCategoryDataset(seriesNames, categories, startValues, endValues);
                  return ds;
              }
              public String getProducerId() {
                  return "CategoryDataProducer";
              }
              public boolean hasExpired(Map params, Date since) {
                  return false;
              }
          };
          pageContext.setAttribute("categoryData", categoryData);
      ...

      As I said, the sample webapp is not even working under Tomcat 5.5.x and Java 1.5.0.

      So, is there no workaround other than to return to previous Tomcat and Java environment? Or trying to re-implement charts without using embedded Java code in JSP pages?

       
    • Chris
      Chris
      2006-03-22

      Thanks for this posting. I have got the same problem with TomCat 5.5.x

       
    • jmdiazlr
      jmdiazlr
      2007-07-04

      The solution to this is to target 1.4 vm with the next setting win $CATALINA_HOME/conf/web.xml, this example is from the default configuration to which I only added the two last init-param tags:

      *** I am not sure but probably the reason is the 1.5 compiler and runtime library support for generics in the collection classes because the library was compiled with 1.4 the internal signature of this collections classes is sligtly different from the corresponding classes in 1.5, maybe someone could asure this o explain it more precisely.

          <servlet>
              <servlet-name>jsp</servlet-name>
              <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
              <init-param>
                  <param-name>fork</param-name>
                  <param-value>false</param-value>
              </init-param>
              <init-param>
                  <param-name>xpoweredBy</param-name>
                  <param-value>false</param-value>
              </init-param>
              <init-param>
                  <param-name>compilerSourceVM</param-name>
                  <param-value>1.4</param-value>
              </init-param>
              <init-param>
                  <param-name>compilerTargetVM</param-name>
                  <param-value>1.4</param-value>
              </init-param>       
              <load-on-startup>3</load-on-startup>
          </servlet>