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
ClassNotFoundException in spring dm integration test, wierd! Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • ClassNotFoundException in spring dm integration test, wierd!

    In my integration test cases, if test methods are in one test class, it works well. But if I seperate them into many test classes, the first test class works well, but the others failed for ClassNotFoundExceptions, and in fact the bundles are really in osgi container.

    codes like this:
    [base abstract class]
    public abstract class AbstractBaseProcessorTest extends AbstractConfigurableBundleCreatorTests {
    protected String[] getTestBundlesNames() {
    return new String[] {
    "org.springframework,org.springframework.context,3 .0.0.RC1",
    "org.springframework,org.springframework.context.s upport,3.0.0.RC1",
    "org.springframework,org.springframework.asm,3.0.0 .RC1",

    [first test class to run, and works well]
    public class ATest extends AbstractBaseProcessorTest {
    public void test1() throws Exception {
    public void test3() throws Exception {
    System.out.println((new Bundle1()).getClass().getName());

    [second test class to run, and failed]
    public class ProcessorChainTest extends AbstractBaseProcessorTest {
    public void test1() throws Exception {
    Bundle[] bs = this.bundleContext.getBundles();
    System.out.println("覧覧覧覧bundle start覧覧覧覧");
    for(Bundle b: bs){
    System.out.print(" " + b.getSymbolicName());

    System.out.println("覧覧覧覧bundle end覧覧覧覧");
    if (StringUtils.isBlank("")){
    } else {
    System.out.println("not Blank");
    System.out.println(DateFormatUtils.format(new Date(), "HH:mm:ssZZ"));


    [and error log as below]
    java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
    at inTest.test1(
    Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
    at org.eclipse.osgi.internal.loader.BundleLoader.find ClassInternal(
    at org.eclipse.osgi.internal.loader.BundleLoader.find Class(
    at org.eclipse.osgi.internal.loader.BundleLoader.find Class(
    at org.eclipse.osgi.internal.baseadaptor.DefaultClass Loader.loadClass(
    at java.lang.ClassLoader.loadClass( 48)
    ... 45 more

    if I move the failed test method into first test class, or remove the first class, the failed one will pass. I am confused by this, need help!

    PS: I use equinox3.5.1.R35x_v20090827, spring3.0.0.RC1, spring-dm2.0.0.M1.