Hi, 

I want to start a Derby Network Embedded Database as part of my PAX-EXAM 
integration test with Karaf (4.2.0).  No matter what I do, I am always getting 
this class not found error:

java.lang.ClassNotFoundException: 
org.apache.derby.iapi.services.property.PropertyUtil not found by 
wrap_file__Users_asoto_.m2_repository_org_apache_derby_derbynet_10.13.1.1_derbynet-10.13.1.1.jar_overwrite_full
 [199]

I am deploying all bundles I think I need:

        wrappedBundle(mavenBundle()
                .groupId("org.apache.derby")
                .artifactId("derby")
                .versionAsInProject().getURL() + "$overwrite=full"),
        wrappedBundle(mavenBundle()
                .groupId("org.apache.derby")
                .artifactId("derbyclient")
                .versionAsInProject().getURL() + "$overwrite=full"),
        wrappedBundle(mavenBundle()
                .groupId("org.apache.derby")
                .artifactId("derbynet")
                .versionAsInProject().getURL() + "$overwrite=full"),
        wrappedBundle(mavenBundle()
                .groupId("org.apache.derby")
                .artifactId("derbytools")
                .versionAsInProject().getURL() + "$overwrite=full"),


Notice I am wrapping all the jars and overriding their manifests to force 
export-everything, just as a precaution.  I may not need to do this, but since 
it was not working, I am forcing it.  The error comes from this line of code:

NetworkServerControl server = new 
NetworkServerControl(InetAddress.getByName("localhost"), 1527);
                

Karaf starts, normally,  i.e., there are no unresolved bundle errors. Inspect 
the Karaf directory created by PAX-EXAM, I see the under the data/tmp the 
various derby jars. The derby.jar is exporting everything including the package 
in question:

org.apache.derby.iapi.services.property;uses:="org.apache.derby.iapi.error,org.apache.derby.iapi.services.daemon,org.apache.derby.iapi.store.access"


On the other hand, the derbynet.jar has the Import-Package with the 
aforementioned package:

org.apache.derby.iapi.services.property;resolution:=optional,org.apache.derby.iapi.services.stream;resolution:=optional

If I run Karaf interactively  from the directory created by PAX-EXAM, I can see 
all the bundles are deployed, and I can find the class in question:

karaf@root()> bundle:find-class 
org.apache.derby.iapi.services.property.PropertyUtil
Apache Derby 10.13 (197)
org/apache/derby/iapi/services/property/PropertyUtil.class


I’ve checked everything I can think of.  What am I missing?  What could be 
causing this?

Best regards,
Alex soto




Reply via email to