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

Add a README section on supported runtime environments & workarounds #2039

Closed
saturnism opened this issue May 8, 2017 · 9 comments
Closed
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@saturnism
Copy link

saturnism commented May 8, 2017

gRPC currently don't work well in embedded Tomcat or embedded Netty envs. Document what we know works and don't work and work arounds.

Specifically, if someone uses the client lib in Spring Boot, they need to exclude tomcat starter and use jetty starter instead.

Corollary to this, in each module's README, refer to this section for supported envs.

@shinfan shinfan added docs priority: p2 Moderately-important priority. Fix may not be included in next release. labels May 8, 2017
@shinfan shinfan added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label May 8, 2017
@shinfan
Copy link
Contributor

shinfan commented May 8, 2017

@saturnism Can you be more specific what did not work well in Tomcat or Netty?

@tswast
Copy link
Contributor

tswast commented May 10, 2017

I encountered this issue today with the Cloud Pub/Sub client library.

With Spring Boot, I got the error "Jetty ALPN/NPN has not been properly configured" at runtime. These were my dependencies:

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      <version>1.5.3.RELEASE</version>
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-core</artifactId>
      <version>4.2.2.RELEASE</version>
    </dependency>
    <dependency>
      <groupId>com.google.cloud</groupId>
      <artifactId>google-cloud-pubsub</artifactId>
      <version>0.17.2-alpha</version>
    </dependency>

The code worked without modification after I made Spring Boot use Jetty instead of Tomcat.

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      <version>1.5.3.RELEASE</version>
      <exclusions>
        <exclusion>
          <!-- Use Jetty instead of Tomcat
               https://www.mkyong.com/spring-boot/spring-boot-jetty-as-embedded-server/ -->
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-tomcat</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-jetty</artifactId>
      <version>1.5.3.RELEASE</version>
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-core</artifactId>
      <version>4.2.2.RELEASE</version>
    </dependency>
    <dependency>
      <groupId>com.google.cloud</groupId>
      <artifactId>google-cloud-pubsub</artifactId>
      <version>0.17.2-alpha</version>
    </dependency>

@jabubake
Copy link
Contributor

Note has been added in the main README. We still need to add links to Supported environments on each module.

@joaoandremartins
Copy link

joaoandremartins commented May 11, 2017

Yes, I just started using the PubSub API within a Spring Boot app and I'm getting this too.

After reading a bit on this, I tried importing the netty-tcnative-boringssl-static dependency, as well as org.eclipse.jetty.npn.npn-api (since the code throwing this error is checking for org.eclipse.jetty.npn.NextProtoNego in the classpath) to no avail.

@shinfan
Copy link
Contributor

shinfan commented May 11, 2017

@jabubake Can we close the issue now since the notes has been added?

@joaoandremartins
Copy link

Ideally, we would want gRPC to work with Tomcat seamlessly too.

@joaoandremartins
Copy link

Seems like a fix for this is coming out on a next release of the grpc-java library.
grpc/grpc-java#2996

@Mistic92
Copy link

Mistic92 commented Jun 7, 2017

Yesterday I have encountered the same problem with spring boot and pubsub lib. Even when I'm using Jetty I'm still getting "Jetty ALPN/NPN has not been properly configured."
When can we expect fix?
I see there is new version of grpc (1.3.0) so now we are waiting for pubsub?

@garrettjonesgoogle
Copy link
Member

We have upgraded to grpc 1.4 which removes the conflict with Tomcat. Since the underlying issue should be fixed, I'm going to close this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

7 participants