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 — Core: ServiceOptions.setCredentials fails with ClassCastException when using UserCredentials · Issue #123 · googleapis/java-core

This repository was archived by the owner on Dec 3, 2023. It is now read-only.
This repository was archived by the owner on Dec 3, 2023. It is now read-only.

Core: ServiceOptions.setCredentials fails with ClassCastException when using UserCredentials #123

Copy link
Copy link
Closed
#124
Closed
Core: ServiceOptions.setCredentials fails with ClassCastException when using UserCredentials#123
#124
Copy link
Assignees
chingor13
Labels
🚨This issue needs some love.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@vladimir-lu
vladimir-lu
opened on Jan 9, 2020
Issue body actions

On line

java-core/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java

Line 221 in 6aa4476

this.quotaProjectId = ((ServiceAccountCredentials) credentials).getQuotaProjectId();
the check is instanceof QuotaProjectIdProvider but the cast is to ServiceAccountCredentials therefore you get

class com.google.auth.oauth2.UserCredentials cannot be cast to class com.google.auth.oauth2.ServiceAccountCredentials (com.google.auth.oauth2.UserCredentials and com.google.auth.oauth2.ServiceAccountCredentials are in unnamed module of loader 'app')

The cast needs to be changed. google-cloud-core version 1.92.0

Activity

  1. chingor13
    added
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Jan 9, 2020
  2. chingor13 commented on Jan 9, 2020

    @chingor13
    chingor13
    on Jan 9, 2020
    Contributor
    More actions

    Thanks for finding this and reporting it! It's definitely a bug and we'll fix and push a release.

  3. chingor13
    closed this as completedin #124on Jan 9, 2020
  4. chingor13
    added a commit that references this issue on Jan 9, 2020

    fix: cast to proper interface (#124)

    This issue will close once commit cd6eabf is merged into the 'main' branch.
    cd6eabf
  5. yoshi-automation
    added
    🚨This issue needs some love.
    on Apr 6, 2020
  6. JustinBeckwith
    assigned
    chingor13
    on Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @chingor13
    chingor13

Labels

🚨This issue needs some love.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

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.