doolse / sbt-osgi-felix

Library and sbt tasks for dealing with OSGi bundles
Apache License 2.0
5 stars 2 forks source link

Why do I get failed to find package with errors for OrientDB? #4

Open PhilAndrew opened 8 years ago

PhilAndrew commented 8 years ago

Why do I get failed to find package errors when I add:

"com.orientechnologies" % "orientdb-graphdb" % "2.2.8"

To my sbt project dependencies.

What can I do to fix the problem?

Errors as shown.

[error] Failed to find package with (&(package=javax.servlet)) for org.apache.co
mmons.configuration
[error] Failed to find package with (&(package=org.apache.log)) for jump_micro_c
ore.commons-logging
[error] Failed to find package with (&(package=javax.annotation.meta)) for com.o
rientechnologies.orientdb-core
[error] Failed to find package with (&(package=org.apache.commons.jxpath.ri)) fo
r org.apache.commons.configuration
[error] Failed to find package with (&(package=org.apache.tools.ant.taskdefs)) f
or org.apache.commons.configuration
[error] Failed to find package with (&(package=org.apache.avalon.framework.logge
r)) for jump_micro_core.commons-logging
[error] Failed to find package with (&(package=org.apache.commons.codec.binary))
 for org.apache.commons.configuration
[error] Failed to find package with (&(package=org.apache.commons.jxpath.ri.mode
l)) for org.apache.commons.configuration
[error] Failed to find package with (&(package=com.google.common.base)) for jump
_micro_core.hppc
[error] Failed to find package with (&(package=org.apache.commons.jxpath)) for o
rg.apache.commons.configuration
[error] Failed to find package with (&(package=javax.servlet)) for jump_micro_co
re.commons-logging
[error] Failed to find package with (&(package=org.apache.commons.jxpath.ri.comp
iler)) for org.apache.commons.configuration

Full errors.

C:\home\projects\git\JumpMicro\core>sbt compile
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; sup
port was removed in 8.0
[info] Loading project definition from C:\home\projects\git\JumpMicro\core\proje
ct
[info] Set current project to jump_micro_core (in build file:/C:/home/projects/g
it/JumpMicro/core/)
[info] Updating {file:/C:/home/projects/git/JumpMicro/core/}core...
[info] Resolving org.apache.aries.blueprint#org.apache.aries.blueprint.cm;1.0.8
[info] Resolving org.apache.aries.blueprint#org.apache.aries.blueprint.api;1.0.0
[info] Resolving org.apache.aries.blueprint#org.apache.aries.blueprint.core;1.2.
[info] Resolving org.apache.aries.quiesce#org.apache.aries.quiesce.api;1.0.0 ...
[info] Resolving com.googlecode.concurrentlinkedhashmap#concurrentlinkedhashmap-
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[info] Rewriting commons-logging-1.1.1.jar (jump_micro_core.commons-logging_1.1.
1.201609030333)
[info] Rewriting commons-beanutils-core-1.8.0.jar (jump_micro_core.commons-beanu
tils-core_1.8.0.201609030333)
[info] Rewriting commons-beanutils-1.7.0.jar (jump_micro_core.commons-beanutils_
1.7.0.201609030333)
[info] Rewriting commons-digester-1.8.jar (jump_micro_core.commons-digester_1.8.
0.201609030333)
[info] Using commons-lang-2.4.jar (org.apache.commons.lang_2.4.0)
[info] Using commons-configuration-1.6.jar (org.apache.commons.configuration_1.6
.0)
[info] Rewriting hppc-0.6.0.jar (jump_micro_core.hppc_0.6.0.201609030333)
[info] Rewriting stax-api-1.0.1.jar (jump_micro_core.stax-api_1.0.1.201609030333
)
[info] Using jettison-1.3.3.jar (org.codehaus.jettison.jettison_1.3.3)
[info] Using commons-collections-3.2.2.jar (org.apache.commons.collections_3.2.2
)
[info] Rewriting activation-1.1.jar (jump_micro_core.activation_1.1.0.2016090303
33)
[info] Using mail-1.4.7.jar (javax.mail_1.4.7)
[info] Using jackson-core-2.6.0.jar (com.fasterxml.jackson.core.jackson-core_2.6
.0)
[info] Using jackson-annotations-2.6.0.jar (com.fasterxml.jackson.core.jackson-a
nnotations_2.6.0)
[info] Using jackson-databind-2.6.0.jar (com.fasterxml.jackson.core.jackson-data
bind_2.6.0)
[info] Rewriting blueprints-core-2.6.0.jar (jump_micro_core.blueprints-core_2.6.
0.201609030333)
[info] Using concurrentlinkedhashmap-lru-1.4.1.jar (com.googlecode.concurrentlin
kedhashmap.lru_1.4.1)
[info] Using snappy-java-1.1.0.1.jar (org.xerial.snappy.snappy-java_1.1.0.1)
[info] Using orientdb-core-2.2.8.jar (com.orientechnologies.orientdb-core_2.2.8)

[info] Using orientdb-client-2.2.8.jar (com.orientechnologies.orientdb-client_2.
2.8)
[info] Using orientdb-tools-2.2.8.jar (com.orientechnologies.orientdb-tools_2.2.
8)
[info] Using orientdb-server-2.2.8.jar (com.orientechnologies.orientdb-server_2.
2.8)
[info] Using orientdb-graphdb-2.2.8.jar (com.orientechnologies.orientdb-graphdb_
2.2.8)
[info] Rewriting paranamer-2.4.1.jar (jump_micro_core.paranamer_2.4.1.2016090303
33)
[info] Rewriting test-interface-1.0.jar (jump_micro_core.test-interface_1.0.0.20
1609030333)
[info] Rewriting javax.inject-1.jar (jump_micro_core.javax.inject_1.0.0.20160903
0333)
[info] Rewriting uncommons-maths-1.2.2a.jar (jump_micro_core.uncommons-maths_0.0
.0.201609030333)
[info] Using netty-3.10.6.Final.jar (org.jboss.netty_3.10.6.Final)
[info] Using org.osgi.compendium-4.3.1.jar (osgi.cmpn_4.3.1.201210102024)
[info] Using org.osgi.core-4.3.1.jar (osgi.core_4.3.1.201210102023)
[info] Using config-1.3.0.jar (com.typesafe.config_1.3.0)
[info] Using jaxb-impl-2.2.11.jar (com.sun.xml.bind.jaxb-impl_2.2.11)
[info] Using jaxb-core-2.2.11.jar (com.sun.xml.bind.jaxb-core_2.2.11)
[info] Using org.apache.aries.proxy-1.0.1.jar (org.apache.aries.proxy_1.0.1)
[info] Using org.apache.aries.quiesce.api-1.0.0.jar (org.apache.aries.quiesce.ap
i_1.0.0)
[info] Using org.apache.aries.util-1.0.0.jar (org.apache.aries.util_1.0.0)
[info] Using org.apache.aries.proxy.api-1.0.0.jar (org.apache.aries.proxy.api_1.
0.0)
[info] Using org.apache.aries.blueprint.api-1.0.0.jar (org.apache.aries.blueprin
t.api_1.0.0)
[info] Using org.apache.aries.blueprint.core-1.2.0.jar (org.apache.aries.bluepri
nt.core_1.2.0)
[info] Using org.apache.aries.blueprint.cm-1.0.8.jar (org.apache.aries.blueprint
.cm_1.0.8)
[info] Using slf4j-api-1.7.21.jar (slf4j.api_1.7.21)
[info] Using log4j-over-slf4j-1.7.21.jar (log4j.over.slf4j_1.7.21)
[info] Using jcl-over-slf4j-1.7.21.jar (jcl.over.slf4j_1.7.21)
[info] Using camel-core-2.17.3.jar (org.apache.camel.camel-core_2.17.3)
[info] Using camel-scala-2.17.3.jar (org.apache.camel.camel-scala_2.17.3)
[info] Rewriting camel-core-xml-2.17.3.jar (jump_micro_core.camel-core-xml_2.17.
3.201609030333)
[info] Using camel-core-osgi-2.17.3.jar (org.apache.camel.camel-core-osgi_2.17.3
)
[info] Using camel-blueprint-2.17.3.jar (org.apache.camel.camel-blueprint_2.17.3
)
[info] Using slf4j-simple-1.7.21.jar (slf4j.simple_1.7.21)
[info] Using scala-library-2.11.8.jar (org.scala-lang.scala-library_2.11.8.v2016
0304-115712-1706a37eb8)
[info] Using scala-parser-combinators_2.11-1.0.1.jar (org.scala-lang.modules.sca
la-parser-combinators_1.0.1)
[info] Using akka-protobuf_2.11-2.4.8.jar (com.typesafe.akka.protobuf_2.4.8)
[info] Using scala-xml_2.11-1.0.3.jar (org.scala-lang.modules.scala-xml_1.0.3)
[info] Rewriting scalacheck_2.11-1.12.5.jar (jump_micro_core.scalacheck_2.11_1.1
2.5.201609030333)
[info] Rewriting graph-core_2.11-1.11.0.jar (jump_micro_core.graph-core_2.11_1.1
1.0.201609030333)
[info] Rewriting graph-dot_2.11-1.11.0.jar (jump_micro_core.graph-dot_2.11_1.11.
0.201609030333)
[info] Using scala-java8-compat_2.11-0.7.0.jar (org.scala-lang.modules.scala-jav
a8-compat_0.7.0)
[info] Using akka-actor_2.11-2.4.8.jar (com.typesafe.akka.actor_2.4.8)
[info] Using akka-osgi_2.11-2.4.8.jar (com.typesafe.akka.osgi_2.4.8)
[info] Using akka-remote_2.11-2.4.8.jar (com.typesafe.akka.remote_2.4.8)
[info] Using akka-slf4j_2.11-2.4.8.jar (com.typesafe.akka.slf4j_2.4.8)
[info] Using akka-camel_2.11-2.4.8.jar (com.typesafe.akka.camel_2.4.8)
[info] Using scala-reflect-2.11.1.jar (org.scala-lang.scala-reflect_2.11.1.v2014
0519-130118-1e1defd99c)
[info] Using scala-compiler-2.11.1.jar (org.scala-lang.scala-compiler_2.11.1.v20
140519-130118-1e1defd99c)
[info] Rewriting scalap-2.11.1.jar (jump_micro_core.scalap_2.11.1.201609030333)
[info] Rewriting lift-json_2.11-2.6.2.jar (jump_micro_core.lift-json_2.11_2.6.2.
201609030333)
[info] Rewriting graph-json_2.11-1.11.0.jar (jump_micro_core.graph-json_2.11_1.1
1.0.201609030333)
[info] Rewriting graph-constrained_2.11-1.11.0.jar (jump_micro_core.graph-constr
ained_2.11_1.11.0.201609030333)
[error] Failed to find package with (&(package=javax.servlet)) for org.apache.co
mmons.configuration
[error] Failed to find package with (&(package=org.apache.log)) for jump_micro_c
ore.commons-logging
[error] Failed to find package with (&(package=javax.annotation.meta)) for com.o
rientechnologies.orientdb-core
[error] Failed to find package with (&(package=org.apache.commons.jxpath.ri)) fo
r org.apache.commons.configuration
[error] Failed to find package with (&(package=org.apache.tools.ant.taskdefs)) f
or org.apache.commons.configuration
[error] Failed to find package with (&(package=org.apache.avalon.framework.logge
r)) for jump_micro_core.commons-logging
[error] Failed to find package with (&(package=org.apache.commons.codec.binary))
 for org.apache.commons.configuration
[error] Failed to find package with (&(package=org.apache.commons.jxpath.ri.mode
l)) for org.apache.commons.configuration
[error] Failed to find package with (&(package=com.google.common.base)) for jump
_micro_core.hppc
[error] Failed to find package with (&(package=org.apache.commons.jxpath)) for o
rg.apache.commons.configuration
[error] Failed to find package with (&(package=javax.servlet)) for jump_micro_co
re.commons-logging
[error] Failed to find package with (&(package=org.apache.commons.jxpath.ri.comp
iler)) for org.apache.commons.configuration
java.lang.RuntimeException: Failed consistency check
        at scala.sys.package$.error(package.scala:27)
        at osgifelix.OsgiTasks$$anonfun$cachedRepoLookupTask$1$$anonfun$apply$12
$$anonfun$apply$13.apply(OsgiTasks.scala:198)
        at osgifelix.OsgiTasks$$anonfun$cachedRepoLookupTask$1$$anonfun$apply$12
$$anonfun$apply$13.apply(OsgiTasks.scala:188)
        at osgifelix.FelixRepositories$$anon$1.apply(FelixRepositories.scala:46)

        at osgifelix.OsgiTasks$$anonfun$cachedRepoLookupTask$1$$anonfun$apply$12
.apply(OsgiTasks.scala:188)
        at osgifelix.OsgiTasks$$anonfun$cachedRepoLookupTask$1$$anonfun$apply$12
.apply(OsgiTasks.scala:177)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
        at sbt.std.Transform$$anon$4.work(System.scala:63)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:22
8)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:22
8)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.Execute.work(Execute.scala:237)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
        at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestric
tions.scala:159)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51
1)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:617)
        at java.lang.Thread.run(Thread.java:745)
[error] (compile:osgiRepositories) Failed consistency check
[error] Total time: 7 s, completed Sep 3, 2016 11:33:46 AM

C:\home\projects\git\JumpMicro\core>
doolse commented 8 years ago

Well the missing dependency for orientdb-graphdb is:

[error] Failed to find package with (&(package=javax.annotation.meta)) for com.o rientechnologies.orientdb-core

Which means there's a dependency on javax.annotation.meta which wasn't listed in the POM metadata, so you'll need to find a maven dependency that has that package, a quick google says jsr305 is the jar you'll need to add.

You have to follow the same process for the other missing dependencies too, or add rewrite rules to ignore the packages which aren't actually required (could be for testing for example).

PhilAndrew commented 8 years ago

Thanks, I'm starting to get to understand this. The rewrite is useful.

PhilAndrew commented 8 years ago

I found that the easiest way for me to resolve dependency issues for situations which seem complicated is to first create a small SBT app which only uses the library which is the one I want to use which is a problem library.

Then my sample project I publish to local repo.

Then I import it using SBT and rewrite if necessary.

This is because its so complicated for me to work out the dependency issues,this is my lazy solution for which I have most success.

For example, I wanted to use Neo4J OGM in OSGi, it has a few problems, I created a sample app project here https://github.com/PhilAndrew/neo4j-ogm-osgi where I adapted its code and now it works in OSGi. In my project I import as SBT and rewrite if necessary to rewrite.