Solved Jetty Websocket not working / noclassdeffound error

Discussion in 'Plugin Development' started by G_4s, Nov 25, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    G_4s

    hey guys,

    i have a question can anybody help me to make a jetty websocket?

    i tried to create it in a normal application and it works fine but when i paste the code in an bukkit async task it gives me an noclassdeffound error i have added the jetty websocket dependency in the plugin file also, anybody can help me ?
     
  2. Offline

    teej107

    @G_4s Make sure you have Jetty packaged in the jar. You can view the contents of the jar and make sure the classes are there.
     
  3. Offline

    G_4s

    @teej107 how do i add it as dependency or how do i add and use this ?
     
  4. Offline

    Scimiguy

    He's referring to notifying your IDE that Jetty is a resource for your plugin
     
  5. Offline

    G_4s

    and how do i do that i'm new in the area of dependencies and that kind of things
     
  6. Offline

    Scimiguy

    What IDE are you using?
     
  7. Offline

    G_4s

    eehm netbeans but if you want i can use eclipse as well
     
  8. Offline

    teej107

    No. I'm referring to actually opening the jar and viewing its contents to see if the library is in there. If it's not then you need to package it in the jar.
     
  9. Offline

    G_4s

    if i builded it with dependencies and if i checked the jar there was an org/jetty/ and then it was empty :D @teej107 @Scimiguy
     
    Last edited: Nov 25, 2015
  10. Offline

    teej107

    @G_4s Is there a "Extract required libraries into jar " option or something like that?
     
  11. Offline

    Scimiguy

    @teej107
    If youre building with an in-program dependency, it should compile into your jar just like any other code you have, shouldn't it?
    If you're using a jar as a dependency, put the jar in the server folder when you run it

    Unless you're using maven or something
     
  12. Offline

    teej107

    Depends on your IDE. In IntelliJ, you can easily have full control on what goes in the jar.
     
  13. Offline

    G_4s

    ok i did it in IntelliJ and i added all lib files into the build and indeed all jar files of libs are in it but still NoClassDefFoundError
     
  14. Offline

    rbrick

    @G_4s
    You need to extract the jars, not just put the jar files in the jar.
    Like so:
    [​IMG]
     
    G_4s likes this.
  15. Offline

    G_4s

    wow learned a lot today :D thanks @rbrick I thought the only ide's were netbeans and eclipse but IntelliJ is much better i love it and the apperance is better thx all for your help :D
     
Thread Status:
Not open for further replies.

Share This Page