GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Can't instantiate PubSub because of this error ClassNotFoundException: io.netty.handler.codec.Headers · Issue #1462 · googleapis/google-cloud-java

Can't instantiate PubSub because of this error ClassNotFoundException: io.netty.handler.codec.Headers #1462

New issue
Copy link
New issue
Copy link
Closed
Closed
Can't instantiate PubSub because of this error ClassNotFoundException: io.netty.handler.codec.Headers#1462
Copy link
Assignees
garrettjonesgoogle
Labels
api: loggingIssues related to the Cloud Logging API.api: pubsubIssues related to the Pub/Sub API.priority: p2Moderately-important priority. Fix may not be included in next release.running on app enginetriaged for GA

Description

@mvipat
mvipat
opened on Dec 8, 2016
Issue body actions

I've added following dependency

	<dependency>
		<groupId>com.google.cloud</groupId>
		<artifactId>google-cloud-pubsub</artifactId>
		<version>0.6.0</version>
	</dependency>
	<dependency>
		<groupId>com.google.auth</groupId>
		<artifactId>google-auth-library-oauth2-http</artifactId>
		<version>0.6.0</version>
	</dependency>
	<dependency>
		<groupId>com.google.appengine</groupId>
		<artifactId>appengine-api-1.0-sdk</artifactId>
		<version>1.9.48</version>
	</dependency>
	<dependency>
		<groupId>com.google.cloud</groupId>
		<artifactId>google-cloud-nio</artifactId>
		<version>0.6.0</version>
    </dependency>

Below is the code snippet

PubSub buildPubSub(String appName){
    PubSubOptions.Builder optionsBuilder = PubSubOptions.newBuilder();
    return optionsBuilder.setProjectId(appName).build().getService();
}

I keep on getting below error

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.google.cloud.pubsub.PubSub]: Factory method 'pubSub' threw exception; nested exception is java.lang.NoClassDefFoundError: io/netty/handler/codec/Headers
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
... 104 common frames omitted
Caused by: java.lang.NoClassDefFoundError: io/netty/handler/codec/Headers
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_45]
at java.lang.ClassLoader.defineClass(ClassLoader.java:760) ~[na:1.8.0_45]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_45]
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[na:1.8.0_45]
at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[na:1.8.0_45]
at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[na:1.8.0_45]
at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[na:1.8.0_45]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_45]
at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[na:1.8.0_45]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_45]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_45]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_45]
at io.grpc.netty.NettyChannelBuilder$NettyTransportFactory.(NettyChannelBuilder.java:311) ~[grpc-netty-1.0.1.jar:1.0.1]
at io.grpc.netty.NettyChannelBuilder$NettyTransportFactory.(NettyChannelBuilder.java:280) ~[grpc-netty-1.0.1.jar:1.0.1]
at io.grpc.netty.NettyChannelBuilder.buildTransportFactory(NettyChannelBuilder.java:230) ~[grpc-netty-1.0.1.jar:1.0.1]
at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:239) ~[grpc-core-1.0.1.jar:1.0.1]
at com.google.api.gax.grpc.InstantiatingChannelProvider.createChannel(InstantiatingChannelProvider.java:120) ~[gax-0.0.22.jar:na]
at com.google.api.gax.grpc.InstantiatingChannelProvider.getChannel(InstantiatingChannelProvider.java:107) ~[gax-0.0.22.jar:na]
at com.google.api.gax.grpc.ProviderManager.getChannel(ProviderManager.java:107) ~[gax-0.0.22.jar:na]
at com.google.api.gax.grpc.ChannelAndExecutor.create(ChannelAndExecutor.java:68) ~[gax-0.0.22.jar:na]
at com.google.api.gax.grpc.ServiceApiSettings.getChannelAndExecutor(ServiceApiSettings.java:82) ~[gax-0.0.22.jar:na]
at com.google.cloud.pubsub.spi.v1.PublisherApi.(PublisherApi.java:203) ~[google-cloud-pubsub-0.6.0.jar:0.6.0]
at com.google.cloud.pubsub.spi.v1.PublisherApi.create(PublisherApi.java:194) ~[google-cloud-pubsub-0.6.0.jar:0.6.0]
at com.google.cloud.pubsub.spi.DefaultPubSubRpc.(DefaultPubSubRpc.java:168) ~[google-cloud-pubsub-0.6.0.jar:0.6.0]
at com.google.cloud.pubsub.PubSubOptions$DefaultPubSubRpcFactory.create(PubSubOptions.java:69) ~[google-cloud-pubsub-0.6.0.jar:0.6.0]
at com.google.cloud.pubsub.PubSubOptions$DefaultPubSubRpcFactory.create(PubSubOptions.java:63) ~[google-cloud-pubsub-0.6.0.jar:0.6.0]
at com.google.cloud.ServiceOptions.getRpc(ServiceOptions.java:478) ~[google-cloud-core-0.6.0.jar:0.6.0]
at com.google.cloud.pubsub.PubSubImpl.(PubSubImpl.java:115) ~[google-cloud-pubsub-0.6.0.jar:0.6.0]
at com.google.cloud.pubsub.PubSubOptions$DefaultPubSubFactory.create(PubSubOptions.java:44) ~[google-cloud-pubsub-0.6.0.jar:0.6.0]
at com.google.cloud.pubsub.PubSubOptions$DefaultPubSubFactory.create(PubSubOptions.java:39) ~[google-cloud-pubsub-0.6.0.jar:0.6.0]
at com.google.cloud.ServiceOptions.getService(ServiceOptions.java:465) ~[google-cloud-core-0.6.0.jar:0.6.0]
at com.homedepot.checkout.pubsub.PubSubAdapter.buildPubSub(PubSubAdapter.java:83) ~[classes/:na]
at com.homedepot.checkout.pubsub.PubSubConfiguration.pubSub(PubSubConfiguration.java:69) ~[classes/:na]
at com.homedepot.checkout.pubsub.PubSubConfiguration$$EnhancerBySpringCGLIB$$2a49f60b.CGLIB$pubSub$1() ~[classes/:na]
at com.homedepot.checkout.pubsub.PubSubConfiguration$$EnhancerBySpringCGLIB$$2a49f60b$$FastClassBySpringCGLIB$$b610cce5.invoke() ~[classes/:na]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:355) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at com.homedepot.checkout.pubsub.PubSubConfiguration$$EnhancerBySpringCGLIB$$2a49f60b.pubSub() ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
... 105 common frames omitted
Caused by: java.lang.ClassNotFoundException: io.netty.handler.codec.Headers
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_45]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_45]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_45]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_45]
... 148 common frames omitted

Any help would be appreciated.

Thanks
MV

Activity

Next
  1. garrettjonesgoogle commented on Dec 8, 2016

    @garrettjonesgoogle
    garrettjonesgoogle
    on Dec 8, 2016
    Contributor
    More actions

    Could you tell me more about your environment? Are you running it in a VM somewhere? What OS are you running this on?

  2. garrettjonesgoogle
    added
    api: pubsubIssues related to the Pub/Sub API.
    on Dec 8, 2016
  3. mvipat commented on Dec 8, 2016

    @mvipat
    mvipat
    on Dec 8, 2016
    Author
    More actions

    I am running it on my local laptop with Windows 7. I have not installed Google SDK.

  4. garrettjonesgoogle commented on Jan 11, 2017

    @garrettjonesgoogle
    garrettjonesgoogle
    on Jan 11, 2017
    Contributor
    More actions

    I just noticed that you have a dependency on App Engine. PubSub won't work on App Engine Standard currently (because gRPC doesn't work on App Engine Standard).

  5. garrettjonesgoogle
    added
    running on app engine
    on Jan 11, 2017
  6. garrettjonesgoogle
    added
    triaged for beta
    on Feb 23, 2017
  7. garrettjonesgoogle commented on Mar 10, 2017

    @garrettjonesgoogle
    garrettjonesgoogle
    on Mar 10, 2017
    Contributor
    More actions

    @mvipat : Does the same thing happen for Logging?

  8. garrettjonesgoogle
    added
    api: loggingIssues related to the Cloud Logging API.
    Status: Release Blocking
    and removed
    triaged for beta
    on Mar 10, 2017
  9. lesv commented on Mar 13, 2017

    @lesv
    lesv
    on Mar 13, 2017
    Contributor
    More actions

    gRPC still doesn't work for J7 gVisor, but should for J8

  10. lesv
    added
    triaged for GA
    and removed
    Status: Release Blocking
    on Mar 27, 2017
  11. tcoffee-google
    added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Jun 12, 2017
  12. garrettjonesgoogle commented on Jul 18, 2017

    @garrettjonesgoogle
    garrettjonesgoogle
    on Jul 18, 2017
    Contributor
    More actions

    @mvipat could you try with a more recent version of google-cloud-pubsub? A lot has changed since your last message in December.

  13. 5 remaining items

  14. meltsufin
    added a commit that references this issue on Dec 22, 2025

    chore(main): release 3.15.13-SNAPSHOT (#1462)

    036bb03
  15. chingor13
    added a commit that references this issue on Jan 6, 2026

    deps: update dependency com.google.cloud:google-cloud-logging to v3.2…

    1b8419b
  16. chingor13
    added 2 commits that reference this issue on Jan 22, 2026

    feat: enable hermetic library generation (#1462)

    d142d9c

    chore(main): release 2.21.0 (#1517)

    21d8cad
  17. chingor13
    added a commit that references this issue on Feb 24, 2026

    chore(deps): update dependency org.apache.maven.plugins:maven-gpg-plu…

    cb96ca8
  18. suztomo
    added a commit that references this issue on Mar 11, 2026

    chore(main): release 3.15.13-SNAPSHOT (googleapis#1462)

    9101125
  19. chingor13
    added a commit that references this issue on Mar 12, 2026

    chore(deps): update dependency org.apache.maven.plugins:maven-gpg-plu…

    ca46b31
  20. lqiu96
    added a commit that references this issue on Mar 20, 2026

    deps: update dependency com.google.cloud:google-cloud-logging to v3.2…

    579b6da
  21. suztomo
    added a commit that references this issue on Mar 23, 2026

    chore: add an unmanaged dependency check (googleapis#1462)

    e5deb4c
  22. suztomo
    added a commit that references this issue on Mar 30, 2026

    chore(deps): update dependency com.google.cloud:libraries-bom to v26.…

    e9991eb
  23. lqiu96
    added a commit that references this issue on Apr 1, 2026

    chore(deps): update dependency com.google.cloud:libraries-bom to v26.…

    cdaf8a4
  24. meltsufin
    added 2 commits that reference this issue on Apr 29, 2026

    chore(deps): Update gapic-generator-java to 2.21.0 (#1462)

    b3f2dff

    chore(deps): Update gapic-generator-java to 2.21.0 (#1462)

    330b8e6
  25. benjaminp
    added 2 commits that reference this issue on Jul 13, 2026

    deps: update dependency org.graalvm.buildtools:junit-platform-native …

    2b2151f

    chore(main): release 2.15.0 (googleapis#1457)

    ce15f00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @garrettjonesgoogle
    garrettjonesgoogle

Labels

api: loggingIssues related to the Cloud Logging API.api: pubsubIssues related to the Pub/Sub API.priority: p2Moderately-important priority. Fix may not be included in next release.running on app enginetriaged for GA

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.