slackapi / java-slack-sdk

Slack Developer Kit (including Bolt for Java) for any JVM language
https://slack.dev/java-slack-sdk/
MIT License
568 stars 210 forks source link

bolt-servlet implementation with dropwizard giving AppConfig ClassNotFound issue #1318

Closed Siddhanttimeline closed 1 month ago

Siddhanttimeline commented 1 month ago

I am trying to implement bolt-servlet in my Dropwizard application using version 1.39.3. However, while running it, I am facing a ClassNotFoundException. Specifically, imports like com.slack.api.bolt.App and others are causing this issue. Could you provide any guidance on what might be going wrong?

The Slack SDK version

(Paste the output of mvn dependency:tree | grep com.slack.api or gradle dependencies | grep com.slack.api)

siddhanttripathi@Siddhants-MacBook-Air openmetadata-service % mvn dependency:tree | grep com.slack.api [INFO] +- com.slack.api:bolt:jar:1.39.3:compile [INFO] | +- com.slack.api:slack-api-model:jar:1.39.3:compile [INFO] | +- com.slack.api:slack-api-client:jar:1.39.3:compile [INFO] | - com.slack.api:slack-app-backend:jar:1.39.3:compile [INFO] - com.slack.api:bolt-servlet:jar:1.39.3:compile siddhanttripathi@Siddhants-MacBook-Air openmetadata-service %

Java Runtime version

siddhanttripathi@Siddhants-MacBook-Air ~ % java --version java 17.0.11 2024-04-16 LTS Java(TM) SE Runtime Environment (build 17.0.11+7-LTS-207) Java HotSpot(TM) 64-Bit Server VM (build 17.0.11+7-LTS-207, mixed mode, sharing) siddhanttripathi@Siddhants-MacBook-Air ~ %

OS info

siddhanttripathi@Siddhants-MacBook-Air openmetadata-service % sw_vers && uname -v ProductName: macOS ProductVersion: 13.4 BuildVersion: 22F2063 Darwin Kernel Version 22.5.0: Mon Apr 24 20:40:17 PDT 2023; root:xnu-8796.121.2~3/RELEASE_ARM64_T8112 siddhanttripathi@Siddhants-MacBook-Air openmetadata-service %

Please make sure if this topic is specific to this SDK. For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. :bow:

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.

WilliamBergamin commented 1 month ago

Hi @Siddhanttimeline thanks for writing in 💯

I am not familiar with Dropwizard, but are you importing only bolt-servlet? You may need to import bolt along with bolt-servlet

<dependency>
  <groupId>com.slack.api</groupId>
  <artifactId>bolt</artifactId>
  <version>{The latest version}</version>
</dependency>
<dependency>
  <groupId>com.slack.api</groupId>
  <artifactId>bolt-servlet</artifactId>
  <version>{The latest version}</version>
</dependency>
Siddhanttimeline commented 1 month ago

Thank you for the reply @WilliamBergamin The issue is resolved. I am importing only bolt-servlet. The problem was in my IntelliJ caches. I am working on implementing relational database support. Can you guide me to some references to get started?

seratch commented 1 month ago

@Siddhanttimeline You can check these built-in implementations:

Also, our Python SDK provides RDB backed implementations. Checking the code might be helpful too: https://github.com/slackapi/python-slack-sdk/tree/main/slack_sdk/oauth/installation_store

Is everything clear no? (if yes, closing this issue would be appreciated)

Siddhanttimeline commented 1 month ago

@Siddhanttimeline You can check these built-in implementations: https://github.com/slackapi/java-slack-sdk/blob/main/bolt/src/main/java/com/slack/api/bolt/service/builtin/FileInstallationService.java https://github.com/slackapi/java-slack-sdk/blob/main/bolt/src/main/java/com/slack/api/bolt/service/builtin/AmazonS3InstallationService.java Also, our Python SDK provides RDB backed implementations. Checking the code might be helpful too: https://github.com/slackapi/python-slack-sdk/tree/main/slack_sdk/oauth/installation_store Is everything clear no? (if yes, closing this issue would be appreciated)

Yes, thank you. @seratch