Skip to content

Calling create token throws class not found #16

Closed

Description

@TomBeckett

Calling the static io.getstream.chat.java.models.User.createToken method outside of the SDK throws a ClassNotFound error. For example:

java.lang.ClassNotFoundException: io.jsonwebtoken.SignatureAlgorithm
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:636) ~[na:na]
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182) ~[na:na]
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519) ~[na:na]
	at io.getstream.chat.java.models.User.createToken(User.java:1332) ~[stream-chat-java-1.2.0.jar:na]
	at app.squaddy.api.service.external.GetStreamService.createTokenForUser(GetStreamService.java:218) ~[classes/:na]

Example usage:

createToken(chatId, null, null);

Adding the dependency to our POM.xml does fix the issue for now:

        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt</artifactId>
            <version>0.9.1</version>
        </dependency>

SDK Version: 1.2.0

Activity

  1. akul1994 commented on Jul 22, 2021

    @akul1994

    Facing the same issue

  2. ferhatelmas commented on Jul 22, 2021

    @ferhatelmas
    Contributor

    Thanks for the report and confirmation! Will address it today!

  3. driver-devel commented on Oct 7, 2021

    @driver-devel
    Contributor

    @TomBeckett @akul1994 I can't reproduce this issue. Could you please give some context how you package and run your application? If you could publish demo project with the issue it would be the best.

  4. added a commit that references this issue on Oct 18, 2021
    181e9ed
  5. TomBeckett commented on Oct 25, 2021

    @TomBeckett
    ContributorAuthor

    @driver-devel Sorry for the late reply.. for some reason I didn't get a notification!

    This occurs are runtime (not running locally via say, IntelliJ or Eclipse).

  6. coderman2022 commented on Jan 6, 2022

    @coderman2022

    This is not resolved, a related issue is here: #38

  7. coderman2022 commented on Jan 7, 2022

    @coderman2022

    Why are you recommending to add the io.jsonwebtoken jjwt dependency when actually stream-java depends on the com.auth0 jwt implementation? In such a case the solution would be to remove io.jsonwebtoken, not to add it. You can see this dependency here https://mvnrepository.com/artifact/io.getstream.client/stream-java/3.2.4

  8. ferhatelmas commented on Jan 7, 2022

    @ferhatelmas
    Contributor

    stream-java isn't this SDK/repo, It's this one, https://github.com/getstream/stream-java for feed client.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions