Announcement Announcement Module
Collapse
No announcement yet.
building from source with openjdk7 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • building from source with openjdk7

    I get these build errors at the Metadata project tests running:
    testToStringOfNewInstance(org.springframework.roo. metadata.DefaultMetadataServiceTest) Time elapsed: 0.216 sec <<< FAILURE!
    org.junit.ComparisonFailure: expected:<...faultMetadataService[:] validGets = 0, recu...> but was:<...faultMetadataService[@1b6d56] validGets = 0, recu...>
    Full error message at pastebin: Spring Roo 1.2 Build Source test error on openjdk7

    Any ideas what this could be? I'm going to try and build just this module.
    Last edited by MiB; Dec 12th, 2011, 06:26 PM.

  • #2
    The relevant test is failing in the toString method of DefaultMetadataService.java:
    Code:
    @Override
    	public final String toString() {
    		ToStringCreator tsc = new ToStringCreator(this);
    		tsc.append("validGets", validGets);
    		tsc.append("recursiveGets", recursiveGets);
    		tsc.append("cachePuts", cachePuts);
    		tsc.append("cacheHits", cacheHits);
    		tsc.append("cacheMisses", cacheMisses);
    		tsc.append("cacheEvictions", cacheEvictions);
    		tsc.append("cacheCurrentSize", getCacheSize());
    		tsc.append("cacheMaximumSize", getMaxCapacity());
    		return tsc.toString().replaceFirst("@[0-9a-f]{8}", ":");
    	}
    The relevant test in DefaultMetadataServiceTest.java:
    Code:
    private static final String TO_STRING_FOR_NEW_INSTANCE =
    		"[DefaultMetadataService:"  +
    		" validGets = 0," +
    		" recursiveGets = 0," +
    		" cachePuts = 0," +
    		" cacheHits = 0," +
    		" cacheMisses = 0," +
    		" cacheEvictions = 0," +
    		" cacheCurrentSize = 0," +
    		" cacheMaximumSize = 100000]";
    
    	@Test
    	public void testToStringOfNewInstance() {
    		assertEquals(TO_STRING_FOR_NEW_INSTANCE, new DefaultMetadataService().toString());
    	}
    It looks to me it's the replaceFirst call that fails in the regex evaluation for some reason as the hashcode with ":" isn't replaced. I'm not sure what it could be though.

    UPDATE
    There seems to be a problem with the toString method of the DefaultMetadataService class in my version of openjdk7 which causes a crash before returning. Possibly this is related to the hash not being replaced.
    Last edited by MiB; Dec 12th, 2011, 04:22 PM.

    Comment


    • #3
      I replaced the ":" in "TO_STRING_FOR_NEW_INSTANCE" in the testToStringOfNewInstance() method with the hashcode in the error report. The metadata project built successfully, proving this bit was the only faulty part.

      The regex "@[0-9a-f]{8}" seem to be able to match the hashcode: "@1b6d56" fine, so I don't see why this replaceFirst call would fail.
      Last edited by MiB; Dec 12th, 2011, 08:32 AM.

      Comment


      • #4
        After the above edit, I compiled Spring Roo Git source as of yesterday successfully. I can start the 1.2.0.BUILD-SNAPSHOT [rev 224082b] on openjdk7 on a Apple PowerPC Dual G5. On maven build however I get problems with generated "ToStringStyle" and some others.

        I'm pretty sure this is related to the toString() method I hacked as above, so I need this fixed. Any ideas on how to fix this seemingly simple problem with the old replaceFirst() method call?

        Comment


        • #5
          The DefaultMetadataServiceTest passes for me using OpenJDK 7 on Ubuntu 11.10. However, I get test failures in the WebXmlUtiltsTest.

          Comment


          • #6
            Alan, interesting. Does this mean you also didn't get a runnable Spring Roo out of your build?

            Comment


            • #7
              Actually all the tests pass in Eclipse with openjdk 7. It appears the issue is with Maven and openjdk 7.

              I just tried openjdk 6 with maven and all is OK and some Google searching shows others having issues with Maven 3.0.3 and openjdk 7. I won't pursue this anymore with openjdk 7 until a newer version of Maven and openjdk 7 comes out. I suggest you use openjdk 6 for now.

              Comment


              • #8
                glad to see you.going on :P

                Comment


                • #9
                  Alan, I don't have workable openjdk 1.6 for my machine. However, I'm glad to inform you that the snapshot source for Roo 1.2.1 both does compile and run on openjdk7. It seems someone fixed these problems.

                  I haven't evaluated if Roo 1.2.1 runs without errors on a real project, but I had a few problems on intial test running the roo-dev command. It runs fine but rendered one project uncompilable.
                  Perhaps it would be better with building the 1.2Release code instead. How do you git clone the source for 1.2Release?

                  Also, I've had problems like Ken Rimple and several others in assembling the spring roo project. Isn't mvn assembly:single the proper command?
                  Last edited by MiB; Dec 19th, 2011, 09:25 AM. Reason: more info

                  Comment

                  Working...
                  X