>>>>> Steinar Bang <[email protected]>:

> The next problem is problem resolving a type from a wrapped jar file
> when activating the component:
> 2018-09-09T16:36:41,324 | ERROR | Thread-97        | karaf                    
>         | 56 - no.priv.bang.neo4j.karaf - 1.0.0.SNAPSHOT | 
> BundleComponentActivator : Bundle [56] Unexpected failure enabling component 
> holder no.priv.bang.neo4j.karaf.Neo4jServer
> java.lang.NoClassDefFoundError: org/neo4j/graphdb/ResourceIterable
[snip!]
> Caused by: java.lang.ClassNotFoundException: 
> org.neo4j.graphdb.ResourceIterable not found by 
> wrap_file__home_sb_.m2_repository_org_neo4j_neo4j-graphdb-api_3.4.7_neo4j-graphdb-api-3.4.7.jar
>  [108]
>       at 
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1639)
>  ~[?:?]
[snip!]

My bundle, ie. the bundle containing the failing component, contains an
import-package for org.neo4j.graphdb.

But the bundle where the error occurs, ie. 
wrap_file__home_sb_.m2_repository_org_neo4j_neo4j-graphdb-api_3.4.7_neo4j-graphdb-api-3.4.7.jar
does *not* contain an import-package for org.neo4j.graphdb.

Is there a way to force-add an import-package for a wrapped jar?

Here are the output of bundle:headers for the various bundles.

 1. My bundle, ie. an actual bundle that contains the DS component that
    fails during start
     karaf@root()> bundle:headers no.priv.bang.neo4j.karaf

     neo4j karaf feature (56)
     ------------------------
     Bnd-LastModified = 1536510486935
     Build-Jdk = 1.8.0_181
     Built-By = sb
     Created-By = Apache Maven Bundle Plugin
     Manifest-Version = 1.0
     Service-Component = OSGI-INF/no.priv.bang.neo4j.karaf.Neo4jServer.xml
     Tool = Bnd-3.5.0.201709291849

     Bundle-Description = An apache karaf feature to load Neo4J into karaf and 
a bundle with a DS component to receive Neo4J config from karaf and start a 
Neo4J server inside karaf
     Bundle-ManifestVersion = 2
     Bundle-Name = neo4j karaf feature
     Bundle-SymbolicName = no.priv.bang.neo4j.karaf
     Bundle-Version = 1.0.0.SNAPSHOT

     Provide-Capability =
             
osgi.service;objectClass:List<String>=org.neo4j.graphdb.GraphDatabaseService
     Require-Capability =
             
osgi.extender;filter:=(&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0))),
             
osgi.service;effective:=active;filter:=(objectClass=org.apache.karaf.system.SystemService),
             
osgi.service;effective:=active;filter:=(objectClass=org.osgi.service.log.LogService),
             osgi.ee;filter:=(&(osgi.ee=JavaSE)(version=1.8))

     Import-Package =
             org.apache.karaf.system;version="[4.1,5)",
             org.neo4j.graphdb,
             org.neo4j.graphdb.event,
             org.neo4j.graphdb.factory,
             org.neo4j.graphdb.index,
             org.neo4j.graphdb.schema,
             org.neo4j.graphdb.traversal,
             org.osgi.service.log;version="[1.3,2)"


 2. The bundle containing the missing class
     karaf@root()> bundle:headers 120

     
wrap_file__home_sb_.m2_repository_org_neo4j_neo4j-resource_3.4.7_neo4j-resource-3.4.7.jar
 (120)
     
-----------------------------------------------------------------------------------------------
     Automatic-Module-Name = org.neo4j.graphdb.resourse
     Bnd-LastModified = 1536510664853
     Build-Jdk = 1.8.0_181
     Built-By = teamcity
     Created-By = 1.8.0_181 (Oracle Corporation)
     Generated-By-Ops4j-Pax-From = 
wrap:file:/home/sb/.m2/repository/org/neo4j/neo4j-resource/3.4.7/neo4j-resource-3.4.7.jar
     Implementation-Title = Neo4j - Resource interface
     Implementation-URL = http://components.neo4j.org/neo4j-resource/3.4.7
     Implementation-Vendor = The Neo4j Graph Database Project
     Implementation-Vendor-Id = org.neo4j
     Implementation-Version = 3.4.7
     Manifest-Version = 1.0
     Originally-Created-By = Apache Maven 3.5.4
     Tool = Bnd-2.3.0.201405100607
     Url = https://neo4j.com/

     Bundle-ManifestVersion = 2
     Bundle-Name = 
wrap_file__home_sb_.m2_repository_org_neo4j_neo4j-resource_3.4.7_neo4j-resource-3.4.7.jar
     Bundle-SymbolicName = 
wrap_file__home_sb_.m2_repository_org_neo4j_neo4j-resource_3.4.7_neo4j-resource-3.4.7.jar
     Bundle-Version = 0

     Require-Capability =
             osgi.ee;filter:=(&(osgi.ee=JavaSE)(version=1.8))

     Export-Package =
             org.neo4j.graphdb

 3. The bundle where the error occurs
     karaf@root()> bundle:headers 108

     
wrap_file__home_sb_.m2_repository_org_neo4j_neo4j-graphdb-api_3.4.7_neo4j-graphdb-api-3.4.7.jar
 (108)
     
-----------------------------------------------------------------------------------------------------
     Automatic-Module-Name = org.neo4j.graphdb
     Bnd-LastModified = 1536510663369
     Build-Jdk = 1.8.0_181
     Built-By = teamcity
     Created-By = 1.8.0_181 (Oracle Corporation)
     Generated-By-Ops4j-Pax-From = 
wrap:file:/home/sb/.m2/repository/org/neo4j/neo4j-graphdb-api/3.4.7/neo4j-graphdb-api-3.4.7.jar
     Implementation-Title = Neo4j - Graph Database API
     Implementation-URL = http://components.neo4j.org/neo4j-graphdb-api/3.4.7
     Implementation-Vendor = The Neo4j Graph Database Project
     Implementation-Vendor-Id = org.neo4j
     Implementation-Version = 3.4.7
     Manifest-Version = 1.0
     Originally-Created-By = Apache Maven 3.5.4
     Tool = Bnd-2.3.0.201405100607
     Url = https://neo4j.com/

     Bundle-ManifestVersion = 2
     Bundle-Name = 
wrap_file__home_sb_.m2_repository_org_neo4j_neo4j-graphdb-api_3.4.7_neo4j-graphdb-api-3.4.7.jar
     Bundle-SymbolicName = 
wrap_file__home_sb_.m2_repository_org_neo4j_neo4j-graphdb-api_3.4.7_neo4j-graphdb-api-3.4.7.jar
     Bundle-Version = 0

     Require-Capability =
             osgi.ee;filter:=(&(osgi.ee=JavaSE)(version=1.8))

     Export-Package =
             
org.neo4j.graphdb;uses:="org.neo4j.graphdb.event,org.neo4j.graphdb.index,org.neo4j.graphdb.schema,org.neo4j.graphdb.traversal,org.neo4j.kernel.api.exceptions",
             org.neo4j.graphdb.config,
             org.neo4j.graphdb.event;uses:=org.neo4j.graphdb,
             
org.neo4j.graphdb.impl;uses:="org.neo4j.graphdb,org.neo4j.graphdb.traversal",
             
org.neo4j.graphdb.impl.traversal;uses:="org.neo4j.graphdb,org.neo4j.graphdb.traversal",
             org.neo4j.graphdb.index;uses:=org.neo4j.graphdb,
             
org.neo4j.graphdb.schema;uses:="org.neo4j.graphdb,org.neo4j.graphdb.index",
             
org.neo4j.graphdb.security;uses:="org.neo4j.graphdb.config,org.neo4j.kernel.api.exceptions",
             org.neo4j.graphdb.spatial,
             
org.neo4j.graphdb.traversal;uses:="org.neo4j.graphdb,org.neo4j.graphdb.impl.traversal"
     Import-Package =
             org.neo4j.collection.primitive;resolution:=optional,
             org.neo4j.function;resolution:=optional,
             org.neo4j.helpers;resolution:=optional,
             org.neo4j.helpers.collection;resolution:=optional,
             org.neo4j.kernel.api.exceptions;resolution:=optional

Reply via email to