Tapestry
  1. Tapestry
  2. TAPESTRY-1520

Tapestry 4.1 is no longer jdk 1.4 compatible - compiled by java 5

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 4.1.2
    • Fix Version/s: 4.1.2
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Running cygwin on a windows XP platform - using maven 2.0.5

      Description

      Tapestry 4.1 seems to be compiled by java 5 and is no longer java 1.4 compatible. And I haven't seen a statement telling that it shouldn't be.

      I have a simple test case build and run by maven to reproduce my assumption. I also have a .zip file containing the full example if needed:
      http://www.jacobve.dk/blog/tapestry/jira/tapestry-4.1-jira.zip

      Regards
      Jacob von Eyben
      blog: http://ancientprogramming.blogspot.com/

      Log showing the issue:
      jeyben@vilfortpark /cygdrive/c/projects/sandbox/tapestry-jira
      $ echo $JAVA_HOME
      C:\jdk\j2sdk1.4.2_10

      jeyben@vilfortpark /cygdrive/c/projects/sandbox/tapestry-jira
      $ mvn
      [INFO] Scanning for projects...
      [INFO] ----------------------------------------------------------------------------
      [INFO] Building Prove JDK issue
      [INFO] task-segment: [install]
      [INFO] ----------------------------------------------------------------------------
      [INFO] [resources:resources]
      [INFO] Using default encoding to copy filtered resources.
      [INFO] [compiler:compile]
      [INFO] No sources to compile
      [INFO] [resources:testResources]
      [INFO] Using default encoding to copy filtered resources.
      [INFO] [compiler:testCompile]
      [INFO] Compiling 1 source file to c:\projects\sandbox\tapestry-jira\target\test-classes
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Compilation failure
      c:\projects\sandbox\tapestry-jira\src\test\java\org\apache\tapestry\components\TestJdkIssue.java:[4,-1] cannot access org.apache.tapestry.engine.RequestCycle
      bad class file: C:\Documents and Settings\jeyben\.m2\repository\org\apache\tapestry\tapestry-framework\4.1\tapestry-framework-4.1.jar(org/apache/tapestry/engine/RequestCycle.class)
      class file has wrong version 49.0, should be 48.0

      c:\projects\sandbox\tapestry-jira\src\test\java\org\apache\tapestry\components\TestJdkIssue.java:[4,-1] cannot access org.apache.tapestry.engine.RequestCycle
      bad class file: C:\Documents and Settings\jeyben\.m2\repository\org\apache\tapestry\tapestry-framework\4.1\tapestry-framework-4.1.jar(org/apache/tapestry/engine/RequestCycle.class)
      class file has wrong version 49.0, should be 48.0

      [INFO] ------------------------------------------------------------------------
      [INFO] For more information, run Maven with the -e switch
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 2 seconds
      [INFO] Finished at: Sat May 26 17:49:22 CEST 2007
      [INFO] Final Memory: 6M/14M
      [INFO] ------------------------------------------------------------------------

      jeyben@vilfortpark /cygdrive/c/projects/sandbox/tapestry-jira
      $ export JAVA_HOME=C:\\jdk
      jdk1.5.0_06

      jeyben@vilfortpark /cygdrive/c/projects/sandbox/tapestry-jira
      $ mvn
      [INFO] Scanning for projects...
      [INFO] ----------------------------------------------------------------------------
      [INFO] Building Prove JDK issue
      [INFO] task-segment: [install]
      [INFO] ----------------------------------------------------------------------------
      [INFO] [resources:resources]
      [INFO] Using default encoding to copy filtered resources.
      [INFO] [compiler:compile]
      [INFO] No sources to compile
      [INFO] [resources:testResources]
      [INFO] Using default encoding to copy filtered resources.
      [INFO] [compiler:testCompile]
      [INFO] Compiling 1 source file to c:\projects\sandbox\tapestry-jira\target\test-classes
      [INFO] [surefire:test]
      [INFO] Surefire report directory: c:\projects\sandbox\tapestry-jira\target\surefire-reports

      -------------------------------------------------------
      T E S T S
      -------------------------------------------------------
      Running org.apache.tapestry.components.TestJdkIssue
      Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.063 sec

      Results :

      Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

      [INFO] [jar:jar]
      [WARNING] JAR will be empty - no content was marked for inclusion!
      [INFO] Building jar: c:\projects\sandbox\tapestry-jira\target\tapestry-jdk-issue-1.0.0-SNAPSHOT.jar
      [INFO] [install:install]
      [INFO] Installing c:\projects\sandbox\tapestry-jira\target\tapestry-jdk-issue-1.0.0-SNAPSHOT.jar to C:\Documents and Settings\jeyben\.m2\repository\com\nordija\tapestry\issue\tapestry-jdk-issue\1.0.0-SNAPSHOT\tapestry-jdk-issue-1.0.0-SNAPSHOT.jar
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 3 seconds
      [INFO] Finished at: Sat May 26 17:50:05 CEST 2007
      [INFO] Final Memory: 8M/14M
      [INFO] ------------------------------------------------------------------------

      The Testcase:
      package org.apache.tapestry.components;

      import junit.framework.TestCase;
      import org.apache.tapestry.engine.RequestCycle;
      import org.apache.tapestry.markup.AsciiMarkupFilter;
      import org.apache.tapestry.markup.MarkupWriterImpl;

      import java.io.PrintWriter;
      import java.io.StringWriter;
      import java.text.Format;

      /**

      • Simple testcase demonstrating that Tapestry 4.1 is no longer java 1.4 compatible.
        *
      • @author Jacob von Eyben - Nordija A/S
        */
        public class TestJdkIssue extends TestCase {

      public void testLimitOutputWithNoMarker()

      { String result = "1234567890qwerty"; Insert insert = new MyInsert(result); StringWriter strwriter = new StringWriter(); PrintWriter writer = new PrintWriter(strwriter); insert.renderComponent(new MarkupWriterImpl("UTF-8", writer, new AsciiMarkupFilter()), new RequestCycle()); writer.flush(); assertEquals(result, strwriter.toString()); }

      private class MyInsert extends Insert {

      private Object value;

      public MyInsert(Object value)

      { this.value = value; }

      public Object getValue()

      { return value; }

      public Format getFormat()

      { return null; }

      public String getStyleClass() { return null; }

      public boolean getRaw()

      { return true; }

      }
      }

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            Jacob von Eyben
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development