Announcement Announcement Module

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
Conversation Detail Module
  • 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

    (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.


    • #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.


      • #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".


        • #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(
          at java.lang.Class.getMethod(
          at org.apache.maven.surefire.junit.JUnitTestSet.creat eInstanceFromSuiteMethod(
          at org.apache.maven.surefire.junit.JUnitTestSet.const ructTestObject(
          at org.apache.maven.surefire.junit.JUnitTestSet.execu te(
          at org.apache.maven.surefire.suite.AbstractDirectoryT estSuite.executeTestSet(AbstractDirectoryTestSuite .java:140)
          at org.apache.maven.surefire.suite.AbstractDirectoryT estSuite.execute( 65)
          at va:107)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Native
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(De
          at java.lang.reflect.Method.invoke(
          at nSuitesInProcess(
          at in(
          [INFO] ------------------------------------------------------------------------
          [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] ------------------------------------------------------------------------


          • #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):

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


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