0

I use osgi container (virgo) [i'm not very good in that].

I added a dependency to my pom.xml

<dependency>
    <groupId>com.typesafe.akka</groupId>
    <artifactId>akka-osgi_2.10</artifactId>
    <version>2.2-M3</version>
</dependency>

I put akka-osgi_2.10-2.2-M3.jar to my lib/deploy folder to OSGI server (to myserver/repository/usr).

I added dummy actor to my code base:

import akka.actor.UntypedActor;

public class ManagerActor extends UntypedActor {
    @Override
    public void onReceive(Object o) throws Exception {
        // ...
    }
}

I build and start my application.

And as result I have the following exceptions in my log (it complains to version="0.0.0"):

.. failed. org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'com.
com.mycompnay.mything-security' at version '1.0.1.BUILD-SNAPSHOT': Cannot resolve: com.mycompany.mything-security
    Resolver report:
        An Import-Package could not be resolved. Resolver error data <Import-Package: akka.actor; version="0.0.0">. Caused by missing constrai
nt in bundle <com.mycompany.mything-security_1.0.1.BUILD-SNAPSHOT>
             constraint: <Import-Package: akka.actor; version="0.0.0">

I go to my template.mf file, which is used to generate final MANIFEST.MF file. To specify the range of versions for AKKA lib I use. Putting there:

Import-Template: 
 akka.actor.*;version="[2.2.0.M3, 2.3)"

Import-Package: 
 akka.actor;version="[2.2.0.M3, 2.3)"

Then rebuild and start app.

But in console it complains to akka versions (complains to version="[2.2.0.M3,2.3.0)" now):

        An Import-Package could not be resolved. Resolver error data <Import-Package: akka.actor; version="[2.2.0.M3,2.3.0)">. Caused by missi
ng constraint in bundle <com.mycompany.mything-security_1.0.1.BUILD-SNAPSHOT>
             constraint: <Import-Package: akka.actor; version="[2.2.0.M3,2.3.0)">

Q: what's wrong?


Also I tried to add this line: to Import-Bundle:

Import-Bundle: 
 ...
 com.typesafe.akka.osgi;version="[2.2.0.M3, 2.3)"

Then I have it in the log (now it complains to com.typesafe.akka.osgi version):

.. failed. org.eclipse.virgo.kernel.deployer.core.DeploymentException: Unable to satisfy dependencies of bundle 'com.mycompany.mything-security
' at version '1.0.1.BUILD-SNAPSHOT': Import-Bundle with symbolic name 'com.typesafe.akka.osgi' in version range '[2.2.0.M3, oo)' could not be
satisfied
ses
  • 13,174
  • 31
  • 123
  • 226

1 Answers1

0

The reason was:

I need to put akka-actor_2.10-2.2-M3.jar (along with akka-osgi_2.10-2.2-M3.jar) to my osgi (virgo) deploy folder.

So, we should NOT do it manually but with help of maven (in order not to miss some jar that comes along with expecting one).

ses
  • 13,174
  • 31
  • 123
  • 226