I'm working on PAX integration tests for our project and I'm facing few issues with regards to class loading.
I have deployed few bundles in PAX (used karaf container). Once the karaf is up, I could see my bundles and services are up and active. However, in my test cases, I've referred to a Class (not a service nor a component) which will used to during my test execution. The class is resided in the bundle and bundle is up and running successfully, but I'm getting ClassnotFoundError
while accessing the class in test case executionas below,
**java.lang.ClassNotFoundException: com.myproject.sample.bundle.DatabaseConfig
at** org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at com.integrationtest.testcases.internal.development.LaunchContainerTest.populateDBProfiles(LaunchContainerTest.java:189)
at com.integrationtest.testcases.internal.development.LaunchContainerTest.testLaunchOSGiContainerWithDefualtSettingsAndSleep(LaunchContainerTest.java:152)
Failed tests: LaunchContainerTest.testLaunchOSGiContainerWithDefualtSettingsAndSleep:152->populateDBProfiles:189 ▒ ClassNotFound
Is it something to do with the container?