Storm command fails with NoClassDefFoundError after adding jsoup as provided dependency

后端 未结 3 539
一整个雨季
一整个雨季 2021-01-13 19:21

I\'m using JSoup in my project and I\'ve declared the dependency in my POM file. It compiles just fine and runs fine too, but only when I used the jar wit

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-13 20:07

    Maven scope provided means the dependencies are included at compilation, but not on runtime. The container / run script is expected to include it explicitly, so I can see you're on the right track.

    Other things you can check to fix the problem is:

    1. Check the CLASSPATH environment variable on the shell instance that runs the java program. Although you already have correct CLASSPATH value on your user shell, often you have to create a new shell instance (ie: running a script) and the CLASSPATH variable is not propagated. On UNIX this is typically done using export command
    2. Check the classpath path is valid, has correct filesystem permission, jars are not corrupted
    3. Check the java command you used to run the program. If you specify -cp it might (or not) override the CLASSPATH environment variable

提交回复
热议问题