Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2004

Tapestry-Ioc fails to build on Windows (ReloadTest.java)


    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.3
    • Fix Version/s: 5.4
    • Component/s: tapestry-ioc
    • Labels:


      When building Tapestry itself on a Windows box, 5 tests fail in the ioc module:

      org.apache.tapestry5.ioc.internal.OperationException: Unable to load class com.example.ReloadableServiceImpl: URI is not hierarchical
      at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:121)
      at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:88)
      at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
      at org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124)
      at org.apache.tapestry5.ioc.internal.AbstractReloadableObjectCreator.createInstance(AbstractReloadableObjectCreator.java:126)
      at org.apache.tapestry5.ioc.internal.AbstractReloadableObjectCreator.createObject(AbstractReloadableObjectCreator.java:118)
      at $ReloadableService_f12317cafcd3.delegate(Unknown Source)
      at $ReloadableService_f12317cafcd3.getStatus(Unknown Source)
      at $ReloadableService_f12317cafcd1.getStatus(Unknown Source)
      at org.apache.tapestry5.ioc.ReloadTest.delete_class(ReloadTest.java:158)

      As Chris Poulsen reported on Jun 29, 2011 at http://tapestry.1045711.n5.nabble.com/gradle-test-troubles-when-building-tapestry-ioc-from-trunk-td4536955.html:

      > It turns out that the creation of the temp-dir in ReloadTest.java doesn't
      > work 100% like expected on windows. The generated url ends up as:
      > "file:c:/blahblah/xxxx/" while it should be "file:/c:/blahblah/xxxx/" (slash
      > before the drive letter).

      Chris' fix is simple enough, and I've verified that it resolves the problem (the build on Windows has 5 failures without this change, and 0 failures with the change in place):


      • URL classesURL = new URL("file:" + classesDir.getCanonicalPath() + "/");
        + URL classesURL = new URL(classesDir.toURI().toString()+"/");

      I'll gladly commit the fix if I can get at least one person on Linux and/or Mac to verify that this change doesn't break the tests there. (I have only a Windows box currently.)




            • Assignee:
              bobharner Bob Harner
              bobharner Bob Harner
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: