部署时所需的资源与 pom 中的说明不匹配

发布于 2024-11-08 16:28:42 字数 12760 浏览 4 评论 0原文

我正在阅读《OSGi 和 Apache Felix 3.0< /a>”并且遇到了一个问题,我正在部署的捆绑包坚持认为它依赖于另一个捆绑包的错误版本。对于之前学习过这些示例的人来说,我刚刚完成第 10 章——在 Bookshelf Service Bundle 中实现日志记录功能。

基本上问题如下:

我有一个名为“Bookshelf Service”的捆绑包,我刚刚向其中添加了一些可爱的新日志记录功能。这个新功能将其置于版本 1.10.0

我有另一个名为“Bookshelf Service Gogo 命令”的捆绑包,它是“Bookshelf Service”中功能的命令行界面。它的版本是 1.9.0。

令人费解的是,当我部署“Bookshelf Service Gogo 命令”捆绑包时,它安装如下:

deploy -s "Bookshelf Service Gogo commands"

Target resource(s):
-------------------
Bookshelf Service Gogo commands (1.9.0)

Required resource(s):
---------------------
Bookshelf Service (1.7.0)

这当然是“Bookshelf Service”捆绑包的错误版本。我想使用 1.10.0 版本。

如果我更新或强制框架使用版本 1.10.0,则“Bookshelf Service Gogo 命令”提供的功能将不再可用。它拒绝使用最新版本的“书架服务”。

但根据 pom.xml 文件,依赖关系确实适用于 1.10.0 版本的“Bookshelf Service”。 “Bookshelf Service Gogo 命令”的 POM 如下:

<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>
  <groupId>com.packtpub.felix</groupId>
  <artifactId>com.packtpub.felix.bookshelf-service-tui</artifactId>
  <version>1.9.0</version>

  <packaging>bundle</packaging>
  <name>Bookshelf Service Gogo commands</name>
  <description>The text user-interface</description>

    <dependencies>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>4.2.0</version>
        </dependency>

        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.gogo.runtime</artifactId>
            <version>0.8.0</version>
        </dependency>

        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.ipojo.annotations</artifactId>
            <version>1.6.4</version>
        </dependency>

        <dependency>
            <groupId>com.packtpub.felix</groupId>
            <artifactId>com.packtpub.felix.bookshelf-service</artifactId>
            <version>1.10.0</version> 
            <type>bundle</type>
            <scope>compile</scope>
        </dependency>
    </dependencies>


        <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.1.0</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-Category>sample</Bundle-Category>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Export-Package>
                            com.packtpub.felix.bookshelf.service.tui
                        </Export-Package>
            <!--        <Bundle-Activator>
                            com.packtpub.felix.bookshelf.service.tui.activator.BookshelfTuiActivator
                        </Bundle-Activator>
                        <Private-Package>
                            com.packtpub.felix.bookshelf.service.tui.activator
                     </Private-Package>
            -->
                    </instructions>

                    <remoteOBR>repo-rel</remoteOBR>
                    <prefixUrl>file:/home/awalker/sandbox_workspace/releases</prefixUrl>
                    <ignoreLock>true</ignoreLock>
                </configuration>
            </plugin>


            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-ipojo-plugin</artifactId>
                <version>1.6.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>ipojo-bundle</goal>
                        </goals>
                        <configuration>
                            <metadata>src/main/ipojo/meta.xml</metadata>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <inherited>true</inherited>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>

        </plugins>
    </build>

    <distributionManagement>
        <!-- releases repo -->
        <repository>
            <id>repo-rel</id>
            <url>file:/home/awalker/sandbox_workspace/releases</url>
        </repository>
    </distributionManagement>

</project>

所以我不明白为什么它只想与 1.7.0 一起使用。

还值得一提的是,这两个包都利用了 iPOJO,因此它们确实有 meta.xml 文件。然而,我认为问题不存在,因为我一直在将我的代码与书籍示例的可下载示例代码进行比较,并且一切似乎都匹配。

关于出了什么问题的任何想法,或者在哪里寻找这个问题的根源?


编辑:

根据请求,生成的清单。

Bookshelf 服务 1.7.0:

Manifest-Version: 1.0
Export-Package: com.packtpub.felix.bookshelf.service.api;uses:="com.pa
 cktpub.felix.bookshelf.inventory.api",com.packtpub.felix.bookshelf.se
 rvice.impl;uses:="com.packtpub.felix.bookshelf.inventory.api,com.pack
 tpub.felix.bookshelf.service.api,org.osgi.framework"
Built-By: awalker
Tool: Bnd-0.0.357
Bundle-Category: sample
Bundle-Name: Bookshelf Service
Created-By: Apache Maven Bundle Plugin
Build-Jdk: 1.6.0_24
Bundle-Version: 1.7.0
Bnd-LastModified: 1305055936964
Bundle-ManifestVersion: 2
Bundle-Activator: com.packtpub.felix.bookshelf.service.impl.activator.
 BookshelfServiceImplActivator
Bundle-Description: This Bookshelf Service
Bundle-SymbolicName: com.packtpub.felix.bookshelf-service
Import-Package: com.packtpub.felix.bookshelf.inventory.api,com.packtpu
 b.felix.bookshelf.service.api,com.packtpub.felix.bookshelf.service.im
 pl,org.osgi.framework;version="1.5"

Bookshelf 服务版本 1.10.0

Manifest-Version: 1.0
Export-Package: com.packtpub.felix.bookshelf.service.api;uses:="com.pa
 cktpub.felix.bookshelf.inventory.api",com.packtpub.felix.bookshelf.se
 rvice.impl;uses:="com.packtpub.felix.bookshelf.inventory.api,com.pack
 tpub.felix.bookshelf.service.api,com.packtpub.felix.bookshelf.log.api
 "
iPOJO-Components: component { $immediate="true" $name="BookshelfServic
 eImpl" $classname="com.packtpub.felix.bookshelf.service.impl.Bookshel
 fServiceImpl" provides { }manipulation { field { $name="sessionId" $t
 ype="java.lang.String" }field { $name="inventory" $type="com.packtpub
 .felix.bookshelf.inventory.api.BookInventory" }field { $name="logger"
  $type="com.packtpub.felix.bookshelf.log.api.BookshelfLogHelper" }met
 hod { $name="$init" }method { $name="getLogger" $return="com.packtpub
 .felix.bookshelf.log.api.BookshelfLogHelper" }method { $name="lookupB
 ookInventory" $return="com.packtpub.felix.bookshelf.inventory.api.Boo
 kInventory" }method { $arguments="{java.lang.String,char[]}" $name="l
 ogin" $return="java.lang.String" }method { $arguments="{java.lang.Str
 ing}" $name="logout" }method { $arguments="{java.lang.String}" $name=
 "sessionIsValid" $return="boolean" }method { $arguments="{java.lang.S
 tring}" $name="checkSession" }method { $arguments="{java.lang.String,
 java.lang.String}" $name="getBook" $return="com.packtpub.felix.booksh
 elf.inventory.api.Book" }method { $arguments="{java.lang.String,java.
 lang.String}" $name="getBookForEdit" $return="com.packtpub.felix.book
 shelf.inventory.api.MutableBook" }method { $arguments="{java.lang.Str
 ing,java.lang.String,java.lang.String,java.lang.String,java.lang.Stri
 ng,int}" $name="addBook" }method { $arguments="{java.lang.String,java
 .lang.String,java.lang.String}" $name="modifyBookCategory" }method { 
 $arguments="{java.lang.String,java.lang.String,int}" $name="modifyBoo
 kRating" }method { $arguments="{java.lang.String}" $name="getCategori
 es" $return="java.util.Set" }method { $arguments="{java.lang.String,j
 ava.lang.String}" $name="removeBook" }method { $arguments="{java.lang
 .String,java.lang.String}" $name="searchBooksByAuthor" $return="java.
 util.Set" }method { $arguments="{java.lang.String,java.lang.String}" 
 $name="searchBooksByCategory" $return="java.util.Set" }method { $argu
 ments="{java.lang.String,java.lang.String}" $name="searchBooksByTitle
 " $return="java.util.Set" }method { $arguments="{java.lang.String,int
 ,int}" $name="searchBooksByRating" $return="java.util.Set" }interface
  { $name="com.packtpub.felix.bookshelf.service.api.BookshelfService" 
 }}requires { $field="inventory" }requires { $field="logger" }}instanc
 e { $component="BookshelfServiceImpl" $name="bookshelf.service.impl" 
 }
Built-By: awalker
Tool: Bnd-0.0.357
Bundle-Category: sample
Bundle-Name: Bookshelf Service
Created-By: Apache Maven Bundle Plugin & iPOJO  1.6.0
Build-Jdk: 1.6.0_24
Bundle-Version: 1.10.0
Bnd-LastModified: 1305656960793
Bundle-ManifestVersion: 2
Bundle-Description: This Bookshelf Service
Import-Package: com.packtpub.felix.bookshelf.inventory.api, org.osgi.s
 ervice.log;version=1.3, com.packtpub.felix.bookshelf.service.impl, co
 m.packtpub.felix.bookshelf.service.api, org.apache.felix.ipojo.archit
 ecture;version= 1.6.0, com.packtpub.felix.bookshelf.log.api, org.apac
 he.felix.ipojo;version= 1.6.0, org.osgi.service.cm;version=1.2
Bundle-SymbolicName: com.packtpub.felix.bookshelf-service

Bookshelf 服务 Gogo 命令 1.9.0

Manifest-Version: 1.0
Export-Package: com.packtpub.felix.bookshelf.service.tui;uses:="com.pa
 cktpub.felix.bookshelf.inventory.api,com.packtpub.felix.bookshelf.ser
 vice.api,org.apache.felix.service.command"
iPOJO-Components: instance { $component="BookshelfServiceProxy" $name=
 "bookshelf.service.tui" }component { $name="BookshelfServiceProxy" $c
 lassname="com.packtpub.felix.bookshelf.service.tui.BookshelfServicePr
 oxyImpl" $public="true" provides { property { $field="gogoScope" $nam
 e="osgi.command.scope" $value="book" }property { $field="gogoFunction
 s" $name="osgi.command.function" $value="[add,search]" }}manipulation
  { field { $name="bookshelf" $type="com.packtpub.felix.bookshelf.serv
 ice.api.BookshelfService" }field { $name="gogoScope" $type="java.lang
 .String" }field { $name="gogoFunctions" $type="java.lang.String[]" }m
 ethod { $name="$init" }method { $name="lookupService" $return="com.pa
 cktpub.felix.bookshelf.service.api.BookshelfService" }method { $argum
 ents="{java.lang.String,java.lang.String,java.lang.String,java.lang.S
 tring,java.lang.String,java.lang.String,int}" $name="add" $return="ja
 va.lang.String" }method { $arguments="{java.lang.String,java.lang.Str
 ing,java.lang.String,java.lang.String}" $name="search" $return="java.
 util.Set" }method { $arguments="{java.lang.String,java.lang.String,ja
 va.lang.String,int,int}" $name="search" $return="java.util.Set" }meth
 od { $arguments="{java.lang.String,com.packtpub.felix.bookshelf.servi
 ce.api.BookshelfService,java.util.Set}" $name="getBooks" $return="jav
 a.util.Set" }interface { $name="com.packtpub.felix.bookshelf.service.
 tui.BookshelfServiceProxy" }}requires { $field="bookshelf" }}
Built-By: awalker
Tool: Bnd-0.0.357
Bundle-Category: sample
Bundle-Name: Bookshelf Service Gogo commands
Created-By: Apache Maven Bundle Plugin & iPOJO  1.6.0
Build-Jdk: 1.6.0_24
Bundle-Version: 1.9.0
Bnd-LastModified: 1305650360964
Bundle-ManifestVersion: 2
Bundle-Description: The text user-interface
Import-Package: com.packtpub.felix.bookshelf.inventory.api, org.osgi.s
 ervice.log;version=1.3, org.apache.felix.service.command;status=provi
 sional;version=0.8, com.packtpub.felix.bookshelf.service.api, org.apa
 che.felix.ipojo.architecture;version= 1.6.0, org.apache.felix.ipojo;v
 ersion= 1.6.0, org.osgi.service.cm;version=1.2, com.packtpub.felix.bo
 okshelf.service.tui
Bundle-SymbolicName: com.packtpub.felix.bookshelf-service-tui

I am running through the book "OSGi and Apache Felix 3.0" and have hit a problem where a bundle I am deploying insists that it has a dependency on the wrong version of another bundle. For anyone who has worked through these examples before, I am just at the end of chapter 10 - implementing logging functionality in the Bookshelf Service Bundle.

Basically the problem is as follows:

I have a bundle called "Bookshelf Service" to which I have just added some sweet new logging functionality. This new functionality puts it at version 1.10.0

I have another bundle called "Bookshelf Service Gogo commands" which is a command-line interface to functionality in "Bookshelf Service". It is at version 1.9.0.

What is puzzling is that when I deploy the "Bookshelf Service Gogo commands" bundle, it installs as follows:

deploy -s "Bookshelf Service Gogo commands"

Target resource(s):
-------------------
Bookshelf Service Gogo commands (1.9.0)

Required resource(s):
---------------------
Bookshelf Service (1.7.0)

Which of course is the wrong version of the 'Bookshelf Service' Bundle. I want to be using version 1.10.0.

If I update, or force the framework to use version 1.10.0, then the functionality that "Bookshelf Service Gogo commands" offers ceases to be available. It is refusing to work with the newest version of 'Bookshelf Service'.

According to the pom.xml file though, the dependency is indeed for the 1.10.0 version of 'Bookshelf Service'. The POM for "Bookshelf Service Gogo commands" is as follows:

<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>
  <groupId>com.packtpub.felix</groupId>
  <artifactId>com.packtpub.felix.bookshelf-service-tui</artifactId>
  <version>1.9.0</version>

  <packaging>bundle</packaging>
  <name>Bookshelf Service Gogo commands</name>
  <description>The text user-interface</description>

    <dependencies>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>4.2.0</version>
        </dependency>

        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.gogo.runtime</artifactId>
            <version>0.8.0</version>
        </dependency>

        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.ipojo.annotations</artifactId>
            <version>1.6.4</version>
        </dependency>

        <dependency>
            <groupId>com.packtpub.felix</groupId>
            <artifactId>com.packtpub.felix.bookshelf-service</artifactId>
            <version>1.10.0</version> 
            <type>bundle</type>
            <scope>compile</scope>
        </dependency>
    </dependencies>


        <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.1.0</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-Category>sample</Bundle-Category>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Export-Package>
                            com.packtpub.felix.bookshelf.service.tui
                        </Export-Package>
            <!--        <Bundle-Activator>
                            com.packtpub.felix.bookshelf.service.tui.activator.BookshelfTuiActivator
                        </Bundle-Activator>
                        <Private-Package>
                            com.packtpub.felix.bookshelf.service.tui.activator
                     </Private-Package>
            -->
                    </instructions>

                    <remoteOBR>repo-rel</remoteOBR>
                    <prefixUrl>file:/home/awalker/sandbox_workspace/releases</prefixUrl>
                    <ignoreLock>true</ignoreLock>
                </configuration>
            </plugin>


            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-ipojo-plugin</artifactId>
                <version>1.6.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>ipojo-bundle</goal>
                        </goals>
                        <configuration>
                            <metadata>src/main/ipojo/meta.xml</metadata>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <inherited>true</inherited>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>

        </plugins>
    </build>

    <distributionManagement>
        <!-- releases repo -->
        <repository>
            <id>repo-rel</id>
            <url>file:/home/awalker/sandbox_workspace/releases</url>
        </repository>
    </distributionManagement>

</project>

So I don't understand why it only wants to work with 1.7.0.

It is also worth mentioning that both of these bundles are taking advantage of iPOJO, so they do have meta.xml files. I don't think the problem is there however, because I have been comparing my code to the downloadable sample code for the book examples, and everything seems to match.

Any ideas about what is going wrong, or where to look for the source of this problem?


EDIT:

As per request, the generated manifests.

Bookshelf Service 1.7.0:

Manifest-Version: 1.0
Export-Package: com.packtpub.felix.bookshelf.service.api;uses:="com.pa
 cktpub.felix.bookshelf.inventory.api",com.packtpub.felix.bookshelf.se
 rvice.impl;uses:="com.packtpub.felix.bookshelf.inventory.api,com.pack
 tpub.felix.bookshelf.service.api,org.osgi.framework"
Built-By: awalker
Tool: Bnd-0.0.357
Bundle-Category: sample
Bundle-Name: Bookshelf Service
Created-By: Apache Maven Bundle Plugin
Build-Jdk: 1.6.0_24
Bundle-Version: 1.7.0
Bnd-LastModified: 1305055936964
Bundle-ManifestVersion: 2
Bundle-Activator: com.packtpub.felix.bookshelf.service.impl.activator.
 BookshelfServiceImplActivator
Bundle-Description: This Bookshelf Service
Bundle-SymbolicName: com.packtpub.felix.bookshelf-service
Import-Package: com.packtpub.felix.bookshelf.inventory.api,com.packtpu
 b.felix.bookshelf.service.api,com.packtpub.felix.bookshelf.service.im
 pl,org.osgi.framework;version="1.5"

Bookshelf Service version 1.10.0

Manifest-Version: 1.0
Export-Package: com.packtpub.felix.bookshelf.service.api;uses:="com.pa
 cktpub.felix.bookshelf.inventory.api",com.packtpub.felix.bookshelf.se
 rvice.impl;uses:="com.packtpub.felix.bookshelf.inventory.api,com.pack
 tpub.felix.bookshelf.service.api,com.packtpub.felix.bookshelf.log.api
 "
iPOJO-Components: component { $immediate="true" $name="BookshelfServic
 eImpl" $classname="com.packtpub.felix.bookshelf.service.impl.Bookshel
 fServiceImpl" provides { }manipulation { field { $name="sessionId" $t
 ype="java.lang.String" }field { $name="inventory" $type="com.packtpub
 .felix.bookshelf.inventory.api.BookInventory" }field { $name="logger"
  $type="com.packtpub.felix.bookshelf.log.api.BookshelfLogHelper" }met
 hod { $name="$init" }method { $name="getLogger" $return="com.packtpub
 .felix.bookshelf.log.api.BookshelfLogHelper" }method { $name="lookupB
 ookInventory" $return="com.packtpub.felix.bookshelf.inventory.api.Boo
 kInventory" }method { $arguments="{java.lang.String,char[]}" $name="l
 ogin" $return="java.lang.String" }method { $arguments="{java.lang.Str
 ing}" $name="logout" }method { $arguments="{java.lang.String}" $name=
 "sessionIsValid" $return="boolean" }method { $arguments="{java.lang.S
 tring}" $name="checkSession" }method { $arguments="{java.lang.String,
 java.lang.String}" $name="getBook" $return="com.packtpub.felix.booksh
 elf.inventory.api.Book" }method { $arguments="{java.lang.String,java.
 lang.String}" $name="getBookForEdit" $return="com.packtpub.felix.book
 shelf.inventory.api.MutableBook" }method { $arguments="{java.lang.Str
 ing,java.lang.String,java.lang.String,java.lang.String,java.lang.Stri
 ng,int}" $name="addBook" }method { $arguments="{java.lang.String,java
 .lang.String,java.lang.String}" $name="modifyBookCategory" }method { 
 $arguments="{java.lang.String,java.lang.String,int}" $name="modifyBoo
 kRating" }method { $arguments="{java.lang.String}" $name="getCategori
 es" $return="java.util.Set" }method { $arguments="{java.lang.String,j
 ava.lang.String}" $name="removeBook" }method { $arguments="{java.lang
 .String,java.lang.String}" $name="searchBooksByAuthor" $return="java.
 util.Set" }method { $arguments="{java.lang.String,java.lang.String}" 
 $name="searchBooksByCategory" $return="java.util.Set" }method { $argu
 ments="{java.lang.String,java.lang.String}" $name="searchBooksByTitle
 " $return="java.util.Set" }method { $arguments="{java.lang.String,int
 ,int}" $name="searchBooksByRating" $return="java.util.Set" }interface
  { $name="com.packtpub.felix.bookshelf.service.api.BookshelfService" 
 }}requires { $field="inventory" }requires { $field="logger" }}instanc
 e { $component="BookshelfServiceImpl" $name="bookshelf.service.impl" 
 }
Built-By: awalker
Tool: Bnd-0.0.357
Bundle-Category: sample
Bundle-Name: Bookshelf Service
Created-By: Apache Maven Bundle Plugin & iPOJO  1.6.0
Build-Jdk: 1.6.0_24
Bundle-Version: 1.10.0
Bnd-LastModified: 1305656960793
Bundle-ManifestVersion: 2
Bundle-Description: This Bookshelf Service
Import-Package: com.packtpub.felix.bookshelf.inventory.api, org.osgi.s
 ervice.log;version=1.3, com.packtpub.felix.bookshelf.service.impl, co
 m.packtpub.felix.bookshelf.service.api, org.apache.felix.ipojo.archit
 ecture;version= 1.6.0, com.packtpub.felix.bookshelf.log.api, org.apac
 he.felix.ipojo;version= 1.6.0, org.osgi.service.cm;version=1.2
Bundle-SymbolicName: com.packtpub.felix.bookshelf-service

Bookshelf Service Gogo commands 1.9.0

Manifest-Version: 1.0
Export-Package: com.packtpub.felix.bookshelf.service.tui;uses:="com.pa
 cktpub.felix.bookshelf.inventory.api,com.packtpub.felix.bookshelf.ser
 vice.api,org.apache.felix.service.command"
iPOJO-Components: instance { $component="BookshelfServiceProxy" $name=
 "bookshelf.service.tui" }component { $name="BookshelfServiceProxy" $c
 lassname="com.packtpub.felix.bookshelf.service.tui.BookshelfServicePr
 oxyImpl" $public="true" provides { property { $field="gogoScope" $nam
 e="osgi.command.scope" $value="book" }property { $field="gogoFunction
 s" $name="osgi.command.function" $value="[add,search]" }}manipulation
  { field { $name="bookshelf" $type="com.packtpub.felix.bookshelf.serv
 ice.api.BookshelfService" }field { $name="gogoScope" $type="java.lang
 .String" }field { $name="gogoFunctions" $type="java.lang.String[]" }m
 ethod { $name="$init" }method { $name="lookupService" $return="com.pa
 cktpub.felix.bookshelf.service.api.BookshelfService" }method { $argum
 ents="{java.lang.String,java.lang.String,java.lang.String,java.lang.S
 tring,java.lang.String,java.lang.String,int}" $name="add" $return="ja
 va.lang.String" }method { $arguments="{java.lang.String,java.lang.Str
 ing,java.lang.String,java.lang.String}" $name="search" $return="java.
 util.Set" }method { $arguments="{java.lang.String,java.lang.String,ja
 va.lang.String,int,int}" $name="search" $return="java.util.Set" }meth
 od { $arguments="{java.lang.String,com.packtpub.felix.bookshelf.servi
 ce.api.BookshelfService,java.util.Set}" $name="getBooks" $return="jav
 a.util.Set" }interface { $name="com.packtpub.felix.bookshelf.service.
 tui.BookshelfServiceProxy" }}requires { $field="bookshelf" }}
Built-By: awalker
Tool: Bnd-0.0.357
Bundle-Category: sample
Bundle-Name: Bookshelf Service Gogo commands
Created-By: Apache Maven Bundle Plugin & iPOJO  1.6.0
Build-Jdk: 1.6.0_24
Bundle-Version: 1.9.0
Bnd-LastModified: 1305650360964
Bundle-ManifestVersion: 2
Bundle-Description: The text user-interface
Import-Package: com.packtpub.felix.bookshelf.inventory.api, org.osgi.s
 ervice.log;version=1.3, org.apache.felix.service.command;status=provi
 sional;version=0.8, com.packtpub.felix.bookshelf.service.api, org.apa
 che.felix.ipojo.architecture;version= 1.6.0, org.apache.felix.ipojo;v
 ersion= 1.6.0, org.osgi.service.cm;version=1.2, com.packtpub.felix.bo
 okshelf.service.tui
Bundle-SymbolicName: com.packtpub.felix.bookshelf-service-tui

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

毁我热情 2024-11-15 16:28:42

好吧,这已经晚了好几年了,但我刚刚遇到了几乎同样的问题,遵循同一本书。事实证明,问题是我在从 1.7.0 版本到 1.10.0 版本的过程中破坏了原始 Bookshelf Service 捆绑包的 pom.xml 中的 Export-Package 命令。仔细检查 - “instance”命令说明了已安装但未运行的捆绑包的问题、清单文件的说明、pom.xml 中的内容等。

Ok, this is years late, but I just ran into almost the same problem, following along the same book. It turned out the issue was that I'd broken the Export-Package commands in the pom.xml for the original Bookshelf Service bundle in going from the 1.7.0 to 1.10.0 versions. Check things carefully - what the 'instance' command says about the problems with the installed bundles that aren't running, what the manifest files say, what's in pom.xml, etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文