示例JWTOAuthExample 运行抛异常
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- java
- Domain
- authentication
Research direction
Start with the dependency declaration for coze-api 0.4.2 and inspect the resolved JWT dependencies, then read com.coze.openapi.service.auth.DefaultJWTBuilder.java at line 25. Run com.fx.ai.coze.JWTOAuthExample and verify that the OAuth token request completes without the reported NoSuchMethodError.
Written by the indexing model from the issue text.
Description
<dependency>
<groupId>com.coze</groupId>
<artifactId>coze-api</artifactId>
<version>0.4.2</version>
</dependency>
按照github的示例运行,在以下部分抛出异常
try { OAuthToken resp = oauth.getAccessToken(); System.out.println(resp); } catch (Exception e) { e.printStackTrace(); }
Exception in thread "main" java.lang.NoSuchMethodError: 'io.jsonwebtoken.JwtBuilder io.jsonwebtoken.JwtBuilder.signWith(java.security.Key, io.jsonwebtoken.SignatureAlgorithm)'
at com.coze.openapi.service.auth.DefaultJWTBuilder.generateJWT(DefaultJWTBuilder.java:25)
at com.coze.openapi.service.auth.JWTOAuthClient.doGetAccessToken(JWTOAuthClient.java:114)
at com.coze.openapi.service.auth.JWTOAuthClient.getAccessToken(JWTOAuthClient.java:52)
at com.fx.ai.coze.JWTOAuthExample.main(JWTOAuthExample.java:73)
- Dominant language
- Java
- Stars
- 214
- Forks
- 97
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coze-dev/coze-java
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
PCMConfig类中缺少关键属性 Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
-
sdk 和官方文档不一致 Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
All issues in coze-dev/coze-java
Similar issues
-
area-deployment area-integrations triage:bot-seen
Difficulty 2/5 Half a day Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/flink-agents#1156 ·
-
[source-shopify] FAILED bulk operation without partialDataUrl is silently treated as successful Openarea/connectors autoteam community connectors/source/shopify needs-triage team/use type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100