You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Singh <si...@port.ac.uk> on 2016/12/06 17:40:15 UTC

Error Unresolved requirements osgi.wiring.package=bsh

I am embedding (using Karaf 4.0.7) all the dependencies in uber jar but I am
getting the following error in starting bundle. I have excluded bsh package
from importing but still it is giving the error for package bsh. Bundle is
installed but not starting.


karaf@root()> ERROR: Bundle org.nhs.osgi.haven.adt [154] Error starting
mvn:org.nhs.osgi.haven/haven-adt/1.0.0-SNAPSHOT
(org.osgi.framework.BundleExce
ption: Unable to resolve org.nhs.osgi.haven.adt [154](R 154.0): missing
requirement [org.nhs.osgi.haven.adt [154](R 154.0)] osgi.wiring.package;
(osgi
.wiring.package=bsh) Unresolved requirements: [[org.nhs.osgi.haven.adt
[154](R 154.0)] osgi.wiring.package; (osgi.wiring.package=bsh)])
org.osgi.framework.BundleException: Unable to resolve org.nhs.osgi.haven.adt
[154](R 154.0): missing requirement [org.nhs.osgi.haven.adt [154](R 154.0
)] osgi.wiring.package; (osgi.wiring.package=bsh) Unresolved requirements:
[[org.nhs.osgi.haven.adt [154](R 154.0)] osgi.wiring.package; (osgi.wiring.
package=bsh)]
        at
org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4111)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2117)
        at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1371)
        at
org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.lang.Thread.run(Thread.java:745)

Here is build section of pom.xml

   <build>
        <plugins>
            
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                       
<Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
                       
<Import-Package>!bsh,resolution:=optional,*</Import-Package>
                    </instructions>
                </configuration>
            </plugin>
            
            <plugin>
                <groupId>org.apache.aries.blueprint</groupId>
                <artifactId>blueprint-maven-plugin</artifactId>
                <version>1.4.0</version>
                <configuration>
                    <scanPaths>
                        <scanPath>org.opendaylight</scanPath>
                    </scanPaths>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.xbean</groupId>
                        <artifactId>xbean-finder-shaded</artifactId>
                        <version>4.5</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <goals>
                            <goal>blueprint-generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>


Import-Package in Manifest file looks like this:

Import-Package: antlr,antlr.collections,antlr.collections.impl,bsh,com
 .caucho.burlap.client,com.caucho.burlap.io,com.caucho.burlap.server,c
 om.caucho.hessian,com.caucho.hessian.client,com.caucho.hessian.io,com
 .caucho.hessian.server,com.fasterxml.classmate,com.fasterxml.classmat
 e.members,com.fasterxml.jackson.core,com.fasterxml.jackson.databind,c
 om.fasterxml.jackson.databind.module,com.fasterxml.jackson.databind.t
 ype,com.ibatis.common.xml,com.ibatis.sqlmap.client,com.ibatis.sqlmap.
 client.event,com.ibatis.sqlmap.engine.builder.xml,com.ibatis.sqlmap.e
 ngine.impl,com.ibatis.sqlmap.engine.transaction,com.ibatis.sqlmap.eng
......
......

If I try to remove the package bsh manully from manifest file. It starts
giving error for some other package. Could someone please suggest?



--
View this message in context: http://karaf.922171.n3.nabble.com/Error-Unresolved-requirements-osgi-wiring-package-bsh-tp4048895.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Error Unresolved requirements osgi.wiring.package=bsh

Posted by Singh <si...@port.ac.uk>.
Thanks for your reply.

I have tried

<Import-Package>!bsh</Import-Package>
and 
<Import-Package>!bsh;resolution:=optional, *</Import-Package>

but still it is including bsh in import-package and giving error. It seems
that whatever I change in Import-Package tag, it does not make any
difference. 



--
View this message in context: http://karaf.922171.n3.nabble.com/Error-Unresolved-requirements-osgi-wiring-package-bsh-tp4048895p4048898.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Error Unresolved requirements osgi.wiring.package=bsh

Posted by Johan Edstrom <se...@gmail.com>.
This part is wrong:

!bsh,resolution:=optional

! == Don’t import at all.

resolution:=optional is used with a semi-colon, 

bsh;resolution:=optional, *



> On Dec 6, 2016, at 10:40 AM, Singh <si...@port.ac.uk> wrote:
> 
> !bsh,resolution:=optional