Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grpc bundle #3077

Closed
dingrui37 opened this issue Jun 8, 2017 · 1 comment
Closed

grpc bundle #3077

dingrui37 opened this issue Jun 8, 2017 · 1 comment

Comments

@dingrui37
Copy link

Please answer these questions before submitting your issue.

What version of gRPC are you using?

I use mvn to build my project and protobuf-mavne-plugin to generate code as the grpc-java/READMME.md guide. The config is shown below.

        <grpc-netty.version>1.3.0</grpc-netty.version>
        <grpc-protobuf.version>1.3.0</grpc-protobuf.version>
        <grpc-stub.version>1.3.0</grpc-stub.version>
            <!-- thirdparty -->
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-netty</artifactId>
                <version>${grpc-netty.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-protobuf</artifactId>
                <version>${grpc-protobuf.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-stub</artifactId>
                <version>${grpc-stub.version}</version>
            </dependency>

What JVM are you using (java -version)?

openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-0ubuntu1.16.04.2-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)

What did you do? (Sorry for my poor English.)

I want to creat a new project in Opendaylight which will use gRPC/protobuf. The environment is apache/karaf, but these dependencies(grpc-netty, grpc-protobuf, grpc-stub) are only ordinary jar packages, I write these dependencies in my bundle pom file, when running it will give a note "jar is not a bundle". So I try to wrap these jar packages in a bundle,.

        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-netty</artifactId>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-protobuf</artifactId>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-stub</artifactId>
        </dependency>

I use maven-bundle-plugin according to the guide.

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-Name>${project.artifactId}</Bundle-Name>
                        <Import-Package>*</Import-Package>
                        <Export-Package>io.grpc,com.google.protobuf</Export-Package>
                        <Private-Package />
                        <Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
                    </instructions>
                </configuration>
            </plugin>

Unfortunately, when running, it always give an error as below. After I add dependency which is about this package, it will give the same error but with another package name. For example errorprone,instrumentation,bootstrap, protobuf-java-util, netty and etc. There are so many dependencies, perhaps infinity, I think when I add a new dependency named A in pom file, A's denpendecy will also need to be added.
could not be resolved. Reason: Missing Constraint: Import-Package: io.netty.buffer; version="[4.1.0,5.0.0)"

What did you expect to see?

How to slove this problem?Who can help me? How use grpc/protobuf in apache karaf?

What did you see instead?

@ejona86
Copy link
Member

ejona86 commented Jan 11, 2018

It seems this is a duplicate of #1565, since "bundle" seems likely to be an OSGi bundle. If something different about this bundle than OSGi bundles, please mention it.

@ejona86 ejona86 closed this as completed Jan 11, 2018
@hsaliak hsaliak reopened this Apr 2, 2018
@hsaliak hsaliak closed this as completed Apr 2, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Sep 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants