Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
cannot get sample code to build Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • cannot get sample code to build

    Hi all,

    I am having a multitude of problems getting the 1.2.0 sample code to build. I have tried both the equinox and felix profiles, and each has its own set of problems. My environment is Windows XP, Sun JDK 1.6.0_13, maven 2.1.0. My classpath variable is empty.

    I am invoking the build from the src directory of spring-osgi-1.2.0, with "mvn -P equinox,samples clean install". It fails during the tests, it looks like it can't find a config file src//samples//weather//wiring-bundle//target/classes/spring.xml:

    Tests in error:
    testOSGiStartedOk(org.springframework.osgi.samples .weather.test.WeatherService
    BundleTest)
    testWeatherServiceExported(org.springframework.osg i.samples.weather.test.Weath
    erServiceBundleTest)

    (Sorry, the forum is disallowing my posting of the build output)

    If I use the felix profile, it fails with 34 test errors due to complaints about undefined properties and missing classes.

    Thanks for any help.

    Brian Smith

  • #2
    Brian, sorry to hear about your problem. The errors that you report are new to me - several users tested the sample days before the release and everything worked nicely.
    I assume the extra / in the path is causing some problems - are you using cygwin or something similar?
    I'm using XP, JDK 5/6 as well but Maven 2.0.9 not 2.1.0 - could you give that a try and see how it goes. As a side note, the samples also run as part of the nightly build on Linux on Maven 2.0.x.

    Comment


    • #3
      Hi Costin,
      Thanks for your help. I got the sample code to build and tests to pass on linux and Windows using maven 2.1.0 and the following commands from the src dirrectory:

      mvn -P equinox install
      mvn -P equinox,samples install

      Installing within the equinox profile appears to be required before installing equinox,samples.

      Comment


      • #4
        Hi Costin,
        Per your request, I cleared out my m2 repository and did the build with maven 2.0.9 in a clean spring-osgi directory. "mvn -P equinox,samples install" worked fine without first executing "mvn -P equinox install".

        Comment


        • #5
          Re: cannot get sample code to build

          Hi All,
          I am a newbee to Spring DM and OSGi.. I downloaded spring-osgi-1.2.0 and am trying to run the samples, but getting the following error ... Any help will be much appreciated.. Thanks
          Running org.springframework.osgi.samples.simpleservice.tes t.SimpleServiceBundleTest
          org.apache.maven.surefire.booter.SurefireExecution Exception: org/osgi/framework/BundleException; nested exception is java.lang.NoClassDefFou
          ndError: org/osgi/framework/BundleException
          java.lang.NoClassDefFoundError: org/osgi/framework/BundleException
          at java.lang.Class.getDeclaredMethods0(Native Method)
          at java.lang.Class.privateGetDeclaredMethods(Class.ja va:2395)
          at java.lang.Class.getMethod0(Class.java:2642)
          at java.lang.Class.getMethod(Class.java:1579)
          at org.apache.maven.surefire.junit.JUnitTestSet.creat eInstanceFromSuiteMethod(JUnitTestSet.java:176)
          at org.apache.maven.surefire.junit.JUnitTestSet.const ructTestObject(JUnitTestSet.java:140)
          at org.apache.maven.surefire.junit.JUnitTestSet.execu te(JUnitTestSet.java:197)
          at org.apache.maven.surefire.suite.AbstractDirectoryT estSuite.executeTestSet(AbstractDirectoryTestSuite .java:140)
          at org.apache.maven.surefire.suite.AbstractDirectoryT estSuite.execute(AbstractDirectoryTestSuite.java:1 65)
          at org.apache.maven.surefire.Surefire.run(Surefire.ja va:107)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.apache.maven.surefire.booter.SurefireBooter.ru nSuitesInProcess(SurefireBooter.java:289)
          at org.apache.maven.surefire.booter.SurefireBooter.ma in(SurefireBooter.java:1005)
          [INFO] ------------------------------------------------------------------------
          [ERROR] BUILD FAILURE
          [INFO] ------------------------------------------------------------------------
          [INFO] There are test failures.

          Please refer to D:\spring-osgi-1.2.0\src\samples\simple-service\simple-service-integration-test\target\surefire-reports for the individual t
          est results.
          [INFO] ------------------------------------------------------------------------
          [INFO] For more information, run Maven with the -e switch
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 2 minutes 1 second
          [INFO] Finished at: Tue Apr 21 00:13:23 GMT+05:30 2009
          [INFO] Final Memory: 20M/36M
          [INFO] ------------------------------------------------------------------------

          Comment


          • #6
            The readme for simple-service misses the profile that needs to be passed to maven (see the readme for the rest of the projects):

            Code:
            mvn -P equinox ...
            Additionally, you could use knopflerfish or felix.

            Comment


            • #7
              Thanks Costin Leau. I was able to successfully test by giving this command.
              "mvn -P equinox integration-test"

              Comment

              Working...
              X