Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account
List archives

Unresolved constraint package; (&(package=org.osgi.framework)(version>=1.5.0))

Maven bundle plugin trace log
(10 lines)
Error in felix bundle plugin documentation
(96 lines)
May 27, 2010
Miroslav Šulc
Miroslav Šulc
hello,

i am very new to osgi so maybe my issue is something trivial, but i did
not find solution for it while googling.

i have basic webapp that works fine if i install there felix osgi log
implementation and other felix bundles. i decided to try to code my own
implementation of osgi log service. i think i did all correctly, but
when i try to start my webapp with my implementation of log service, i
get this error:

ERROR: Error starting
jndi:/localhost/webapp/WEB-INF/bundles/commons-logservice-osgi-1.0-SNAPSHOT.jar
(org.osgi.framework.BundleException: Unresolved constraint in bundle
cz.startnet.commons-logservice-osgi [2]: package;
(&(package=org.osgi.framework)(version>=1.5.0)))
org.osgi.framework.BundleException: Unresolved constraint in bundle
cz.startnet.commons-logservice-osgi [2]: package;
(&(package=org.osgi.framework)(version>=1.5.0))
        at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3299)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1657)
        at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1128)
        at
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
        at java.lang.Thread.run(Thread.java:619)

manifest of commons-logservice-osgi contains this (and ofc other lines):
Export-Package: cz.startnet.commons.org.osgi.service.log,org.osgi.serv
 ice.log;uses:="org.osgi.framework";version="1.3"
Import-Package: cz.startnet.commons.org.osgi.service.log,org.osgi.fram
 ework;version="1.5",org.osgi.service.log;version="1.3"

manifest was generated by maven-bundle-plugin.

this is structure of my webapp:

target/
|-- bundles
|   |-- commons-logservice-osgi-1.0-SNAPSHOT.jar
|   |-- org.apache.felix.http.bridge-2.0.4.jar
|   `-- org.apache.felix.webconsole-3.0.0.jar
|-- classes
|   `-- cz
|       `-- startnet
|           `-- webapp
|               |-- FrameworkService.class
|               |-- ProvisionActivator.class
|               `-- StartupListener.class
|-- felix-cache
|   |-- bundle0
|   |   `-- bundle.id
|   |-- bundle1
|   |   |-- bundle.id
|   |   |-- bundle.lastmodified
|   |   |-- bundle.location
|   |   |-- bundle.startlevel
|   |   |-- bundle.state
|   |   `-- version0.0
|   |       |-- bundle.jar
|   |       |-- bundle.jar-embedded
|   |       |   |-- commons-fileupload-1.1.1.jar
|   |       |   |-- commons-io-1.4.jar
|   |       |   `-- json-20070829.jar
|   |       `-- revision.location
|   |-- bundle2
|   |   |-- bundle.id
|   |   |-- bundle.lastmodified
|   |   |-- bundle.location
|   |   |-- bundle.startlevel
|   |   |-- bundle.state
|   |   `-- version0.0
|   |       |-- bundle.jar
|   |       `-- revision.location
|   `-- bundle3
|       |-- bundle.id
|       |-- bundle.lastmodified
|       |-- bundle.location
|       |-- bundle.startlevel
|       |-- bundle.state
|       `-- version0.0
|           |-- bundle.jar
|           `-- revision.location
|-- maven-archiver
|   `-- pom.properties
|-- war
|   `-- work
|       `-- webapp-cache.xml
|-- webapp
|   |-- META-INF
|   |   `-- context.xml
|   `-- WEB-INF
|       |-- bundles
|       |   |-- commons-logservice-osgi-1.0-SNAPSHOT.jar
|       |   |-- org.apache.felix.http.bridge-2.0.4.jar
|       |   `-- org.apache.felix.webconsole-3.0.0.jar
|       |-- classes
|       |   `-- cz
|       |       `-- startnet
|       |           `-- webapp
|       |               |-- FrameworkService.class
|       |               |-- ProvisionActivator.class
|       |               `-- StartupListener.class
|       |-- framework.properties
|       |-- lib
|       |   |-- org.apache.felix.framework-2.0.5.jar
|       |   |-- org.apache.felix.http.proxy-2.0.4.jar
|       |   |-- org.osgi.compendium-4.2.0.jar
|       |   `-- org.osgi.core-4.2.0.jar
|       `-- web.xml
`-- webapp.war

26 directories, 47 files


anyone knows what i am doing wrong that commons-logservice-osgi cannot
be started? thx for any hints.

Miroslav


Reply
Tags: felixosgidecidedbundles
Similar Threads
Missing Constraint: Import-Package
I am trying to build my maven project into a bundle using the
maven-bundle-plugin with all its dependencies (it depends on
guice-2.0.jar). In my pom file I have:

   <build>
    <plugins>
        <plugin>
        	<groupId>org.apache.felix</groupId>
        	<artifactId>maven-bundle-plugin</artifactId>
        	<version>2.1.0</version>
           <extensions>true</extensions>
           <configuration>
              <instructions>

<Bundle-SymbolicName>${pom.groupId}.${pom.artifactId}</Bundle-SymbolicName>
                  <Bundle-Name>${pom.name}</Bundle-Name>
                 
<Bundle-Version>${pom.version}</Bundle-Version>
                 
<Bundle-Activator>com.generator.Activator</Bundle-Activator>
                 
<Private-Package>com.generator</Private-Package>
                  <Embed-Transitive>true</Embed-Transitive>
	         
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
              </instructions>
           </configuration>         	
        </plugin>
    </plugins>
   </build>

After building the project using mvn install I get a jar file with all
the dependencies. I then try to run it through the OSGI console after
installing it but I get the error:

osgi> start 15
org.osgi.framework.BundleException: The bundle
"com.generator_1.1.1.SNAPSHOT [15]" could not be resolved. Reason:
Missing Constraint: Import-Package:
com.google.inject.internal.asm.util; version="0.0.0"
        at
org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)
        at
org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301)
        at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:319)
        at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
        at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:276)
        at
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:252)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
        at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:156)
        at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:141)
        at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:105)
        at java.lang.Thread.run(Unknown Source)

osgi>

The problem seems to be related to the
com.google.inject.internal.asm.util package but I have not been able
to find that package anywhere (not even in  guice-2.0.jar). Any ideas
on how to solve this problem?


Created: (FELIX-2481) Renaming a package via refactoring should update any workspace package exports
Renaming a package via refactoring should update any workspace package
exports/imports

Retrieving the framework extensions with package admin
This is a multi-part message in MIME format.Hi all,

I'm asking why we can not retrieve the framework extensions, when using
the method PackageAdmin#getFragments with the system bundle. Is there a
standard way to retrieve the extensions?

Regards,
Loris


Created: (CXF-2885) Wrong import package version for javax.servlet
Wrong import package version for javax.servlet

Getting rid of Import-Package and Export-Package
I am trying simple osgi bundle which has every dependency embedded 
inside my bundle. By default, bundle-plugin creates several entries in 
Import-Package and Export-Package . I want to get rid of them 
completely. I tried several ways . If I try giving empty Import-Package 
, it fails at build. I tried blank _exportcontents, does not work too !

Any clue ?


Created: (FELIX-2388) Karaf feature validate plugin should take the osgi system package into conside
Karaf feature validate plugin should take the osgi system package into
consideration

Created: (FELIX-2456) Framework no longer fires UNRESOLVED event when a bundle is explicitly refresh
Framework no longer fires UNRESOLVED event when a bundle is explicitly
refreshed

Re: do X if package Y is installed?
On 6/25/2010 12:03 AM, Bill Weiss wrote:
 My problem is, in this case, there are machines that need X but not
 Y, Y but not X, X and Y, or neither.  I can obviously write all of
 those cases out separately, but that means duplication of code for
 setting up the parts of X and Y that aren't dependant.

 Custom facts are probably the best way for me to do this, but I'd
 love to hear that there's a simpler way.


If you can decide in your node source (site.pp or external) which 
components are needed, this is very easy:


   node a { include X }
   node b { include Y }
   node c { include X,Y }
   node d { }


If you **cannot** decide in your node source, you're probably doing 
something wrong[1] and need to explain your problem better.



Best Regards, David

[1] I know, converting legacy systems is a pain, but IMHO you're still 
better off doing a manual survey and nailing it down instead of trying 
to make automatic decisions that'll backfire down the road.


        FB-Nr.: FN 309285 g          FB-Gericht: LG Korneuburg





Package requires....
If I have a package { "foo": ensure => installed; require =>
something
} in a module, AND I also have a Package { require =>
Class['yum::client']} in site.pp, what happens in the module? Does the
package in the module require both 'something' and the yum::client
class, or does the fact I specified a package{} with a require in the
module mean that only the yum::client class is required?

Doug.





apt-rpm package downgrade
Hi,

I am using apt-rpm provider and have following manifest for keeping some
package 
at particular version

  package { "somepackage":
    ensure => "1.0.0"
  }

however if from some reason the package gets upgraded to some higher
version, 
puppet can't downgrade it because of following error:

Jul 13 11:32:25 server puppetd[14095]:
(//module/Package[somepackage]/ensure) 
change from 1.0.1 to 1.0.0 failed: Could not update: Execution of 
'/usr/bin/apt-get -q -y install somepackage=1.0.0' returned 100: Reading
Package 
Lists... Building Dependency Tree... The following packages will be
DOWNGRADED   
somepackage E: There are problems and -y was used without --force-yes 0 
upgraded, 0 newly installed, 1 downgraded, 0 removed and 2 not upgraded.
Need to 
get 0B/8361B of archives. After unpacking 50B disk space will be freed. 
at 
/etc/puppet/modules/module/manifests/somepackage.pp:12

is it possible to use the standard 'Package' resource for downgrading some

package with apt-rpm provider?

cheers, Antony.


      





Centos 5 package
I'm having a hard time getting activemq-cpp built on Centos 5.  Sadly,
there
is not a package available for it in any of the various repositories out
there, though I can find Fedora and Ubuntu builds in the wild.

I don't want to have to build all of these packages from source as I'm
building 32 bit versions on a 64 bit machine and cross-compiler issues
complicate things.


rpm -ivh activemq-cpp-3.1.2-1.fc14.i686.rpm 
error: Failed dependencies:
	libdb-4.8.so is needed by activemq-cpp-3.1.2-1.fc14.i686
	libexpat.so.1 is needed by activemq-cpp-3.1.2-1.fc14.i686
	liblber-2.4.so.2 is needed by activemq-cpp-3.1.2-1.fc14.i686
	libldap-2.4.so.2 is needed by activemq-cpp-3.1.2-1.fc14.i686
	libstdc++.so.6(GLIBCXX_3.4.11) is needed by
activemq-cpp-3.1.2-1.fc14.i686
	libstdc++.so.6(GLIBCXX_3.4.9) is needed by activemq-cpp-3.1.2-1.fc14.i686
	rpmlib(FileDigests) <= 4.6.0-1 is needed by
activemq-cpp-3.1.2-1.fc14.i686
	rpmlib(PayloadIsXz) <= 5.2-1 is needed by
activemq-cpp-3.1.2-1.fc14.i686

Any tips on a where I can find a prebuilt package?  




Re: ZkClient package
Jun Rao:
 Hi,
 
 ZkClient (http://github.com/sgroschupf/zkclient) provides a nice
wrapper
 around the ZooKeeper client and handles things like retry during
 ConnectionLoss events, and auto reconnect. Does anyone (other than
Katta)
 use it? Would people recommend using it? Thanks,
 
 Jun
Hi Jun,

I have some ideas for an alternative Zk Client design, but haven't had the

time yet to hack it together:
http://mail-archives.apache.org/mod_mbox/hadoop-zookeeper-
dev/201005.mbox/%3C20100526150### @koch.ro%3E

I don't like zkClient very much, but it's the best thing available by now 
AFAIK. Also have a look at this bug:
http://oss.101tec.com/jira/browse/KATTA-137

Best regards,

Thomas Koch, http://www.koch.ro


all-in-one package distribution
We're days away from the release (It will happen this week, I promise).

Our all-in-one package is jruby+buildr, using a script put together by
Alex.
It delivers well: we get to have tight integration with jruby which gives
us
a ant-like solution.

However we cannot, I think, make it available from the Apache downloads,
for
licensing reasons.

I think a minima we should make it available from the rubyforge website.
Is
everybody ok with that ?
I also contacted the jruby maintainers to give them a heads up. Maybe
they'd
like to host on jruby.org ?

So I'd like to open an informal vote here. I'm ok with making this
all-in-one package available in both places if possible.

What's your take ?

Antoine


Re: ZkClient package
I use it at my job at kaChing. Generally it is just fine for the job,
doing what you'd expect.

My criticisms are that it is very thin on documentation (javadoc),
which may have been improved, and I don't like how it makes every zk
exception into a RuntimeException.

But I'm thumbs up.

.. Adam

On Mon, Jul 12, 2010 at 4:10 PM, Jun Rao <jun### @gmail.com> wrote:
 Hi,

 ZkClient (http://github.com/sgroschupf/zkclient) provides a nice
wrapper
 around the ZooKeeper client and handles things like retry during
 ConnectionLoss events, and auto reconnect. Does anyone (other than
Katta)
 use it? Would people recommend using it? Thanks,

 Jun



Click Jquery Package
The Click Jquery Project on http://click-jquery.appspot.com
is very interesting ! 
It is based on the Apache Click 2.3.0 M1 isn't it ?
Is it possible to have the war/jar files 
of the last release to test and integrate it ? 

Thanks



where i can find mod_deflate package?
Hi all...

I am looking for mod_deflate package, i mean all contents in mod_deflate.
where 
i can find it?
Thanks.

Best regards,
Isnatia


      


where i can find mod_deflate package?
Hi all,,i'm newbie here...

I am looking for mod_deflate package, i mean all contents in mod_deflate.
where 
i can find it?
Thanks.

Best regards,
Isnatia



      


Package not visible (exported)
I have a minimal maven2 parent project with a single submodule that
only contains one package com.test with a single class. I am trying to
use Felix to build the submodule as a bundle:

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<artifactId>logTest</artifactId>
		<groupId>com.minimal</groupId>
		<version>1.0.0</version>
	</parent>
	<groupId>com.minimal</groupId>
	<artifactId>logTest-sub</artifactId>
	<version>1.0.0</version>
	<name>Log test submodule</name>
	<packaging>bundle</packaging>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<version>1.4.0</version>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<Export-Package>com.test</Export-Package>
						<Bundle-SymbolicName>${pom.groupId}.${pom.artifactId}</Bundle-SymbolicName>
						<Bundle-Name>${pom.name}</Bundle-Name>
						<Bundle-Version>1.0.0</Bundle-Version>
					</instructions>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<dependencies>
		<dependency>
			<groupId>org.apache.felix</groupId>
			<artifactId>org.osgi.core</artifactId>
			<version>1.0.0</version>
		</dependency>
	</dependencies>
</project>


After running mvn clean install I get the following MANIFEST file in
the jar file:

Manifest-Version: 1.0
Export-Package: com.test
Bundle-Version: 1.0.0
Build-Jdk: 1.6.0_21
Built-By: mort
Tool: Bnd-0.0.238
Bnd-LastModified: 1279883880970
Bundle-Name: Log test submodule
Bundle-ManifestVersion: 2
Created-By: Apache Maven Bundle Plugin
Import-Package: com.test
Bundle-SymbolicName: com.minimal.logTest-sub


which looks fine. But when I add it to the target platform in eclipse
and create a PDE project the package com.test is not visible.

Any ideas why this bundle (actually the package com.test) does not
show up in the Plug-in Dependencies?


conditional execution of package
Hi,

I have been installing couchdb from source thorough " make/make
install " using puppet's exec.
The problem I am facing is when ever i run the configuration for the
second time its not recognizing tat its already installed.
couchdb is being installed all over again.
is it the problem becoz , im not using puppet's package resource type
I thought of a plan in which i can check whether a particular file
exists. so if the file doesnt exists, I'll ask puppet to install it
right away.

Please help me in this regard.

Regards,
Bhaskar.