Results 1 to 7 of 7

Thread: cannot get sample code to build

  1. #1
    Join Date
    Apr 2009
    Posts
    6

    Default 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. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Apr 2009
    Posts
    6

    Default

    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. #4
    Join Date
    Apr 2009
    Posts
    6

    Default

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

    Default 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] ------------------------------------------------------------------------

  6. #6
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  7. #7

    Default

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •