#Jar Issues.

1 messages · Page 1 of 1 (latest)

stark heath
#

Well did you see that for an explanation

glad escarp
#

Unless my english has gotten worse (which i don't doubt) I didn't understand what you said

stark heath
#

You sent the log which got printed in your console

glad escarp
#

yep it used to have a nice log before

stark heath
#

Did you actually read the log?
Because it tells you the issue

glad escarp
#

doesn't make sense tho....?

stark heath
#

I have no idea what your setup previously was

#

But slf4j can't find a logger

glad escarp
#

it had a logged lmao

#
fun DependencyHandler.shadowApi(notation: Any) {
    shadow(notation)
    api(notation)
}

plugins {
    `java-library`
    id("application")
}

group = "net.mysterio"
version = "1.0-SNAPSHOT"
application {
    mainClass.set("$group.CastorKt")
}


java {
    toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}

tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
    archiveFileName.set("${project.name}.jar")
    manifest {
        attributes(
            "Main-Class" to "net.mysterio.CastorKt"
        )
    }
    from(project.configurations.runtimeClasspath.get())
}

tasks.withType<Jar> {
    enabled = true
}

repositories {
    mavenCentral()
    mavenLocal()
    maven("https://jitpack.io/")
    maven("https://m2.dv8tion.net/releases")
    maven("https://m2.duncte123.dev/releases") {
        name = "m2-duncte123"
    }
}

dependencies {
    testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.2")
    testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.2")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.2")
    implementation(kotlin("stdlib-jdk8"))
    implementation("net.dv8tion:JDA:5.0.0-beta.22")
    implementation("com.google.code.gson:gson:2.10.1")
    implementation("org.json:json:20230227")
    implementation("mysql:mysql-connector-java:8.0.28")
    implementation("me.duncte123:botCommons:2.3.14")
    implementation("dev.arbjerg:lavaplayer:2.2.1")
    implementation("ch.qos.logback:logback-classic:1.2.8")
    shadow("com.github.Kaktushose:jda-commands:v4.0.0-beta.2") {
        exclude(group = "net.dv8tion", module = "JDA")
    }
}

tasks.withType<JavaCompile> {
    options.compilerArgs.plus("-parameters")
}
stark heath
#

Unless you show what you had before vs what now I don't think we can help

What you had before being dependence & co

glad escarp
#

all i changed was the old lava player to the new one

stark heath
#

So there is logback classic
But does that version work with slf4j version 2?

#

the old lavaplayer probably used slf4j version 1

glad escarp
#

well it's different now I updated it from 1.2.8 to 1.5.7

SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
[main] INFO ShardManager - Login Successful!
[JDA [0 / 1] MainWS-ReadThread] INFO WebSocketClient - Connected to WebSocket
[JDA [0 / 1] MainWS-ReadThread] INFO JDA - Finished Loading!```
#

It's something with lava player that stops me from using my logback stuff

stark hull
#

SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier.

#

you want slf4j2

#

or i should rephrase, an slf4j2-compatible logger

#

jda v5 moved to slf4j2

glad escarp
#

Where to obtain...?

stark hull
#

google

glad escarp
#

-3-

stark hull
#

personally i use log4j2

glad escarp
stark heath
#

Lavaplayer uses slf4j version 2 as well

#

At least lavaplayer v2

stark hull
#

but there's newer versions

#

up to you what you use

#

just make sure it's 2.x

stark heath
#

But your logback version is outdated for ages too

#

So idk how you expect things to work

glad escarp
#

When I was using log back

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} %boldCyan(%-34.-34thread) %blue(%10.10X{jda.shard}) %white(%-15.-15logger{0}) %highlight(%-6level) %msg%n</pattern>
        </encoder>
    </appender>

    <root level="info">
        <appender-ref ref="STDOUT" />
    </root>
</configuration>

i was using this as well in my resources folder

stark heath
#

Just update logback...

glad escarp
#

I did...

stark heath
#

1.2.8?

glad escarp
#

it's now 1.5.7

#

nvm i'm using that thing devoxin sent and adapting to the xml they have provided in the project

stark heath
#

The issue is probably that some dependency drags in slf4j 1 and now that stuff clashes

#

So you have to exclude that from there

glad escarp
#
fun DependencyHandler.shadowApi(notation: Any) {
    shadow(notation)
    api(notation)
}

plugins {
    `java-library`
    id("application")
}

group = "net.mysterio"
version = "1.0-SNAPSHOT"
application {
    mainClass.set("$group.CastorKt")
}


java {
    toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}

tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
    archiveFileName.set("${project.name}.jar")
    manifest {
        attributes(
            "Main-Class" to "net.mysterio.CastorKt"
        )
    }
    from(project.configurations.runtimeClasspath.get())
}

tasks.withType<Jar> {
    enabled = true
}

repositories {
    mavenCentral()
    mavenLocal()
    maven("https://jitpack.io/")
    maven("https://m2.dv8tion.net/releases")
    maven("https://m2.duncte123.dev/releases") {
        name = "m2-duncte123"
    }
}

dependencies {
    testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.2")
    testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.2")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.2")
    implementation(kotlin("stdlib-jdk8"))
    implementation("net.dv8tion:JDA:5.0.0-beta.22")
    implementation("com.google.code.gson:gson:2.10.1")
    implementation("org.json:json:20230227")
    implementation("me.duncte123:botCommons:2.3.14")
    implementation("dev.arbjerg:lavaplayer:2.2.1")
    implementation("org.apache.logging.log4j:log4j-core:2.19.0")
    implementation("org.apache.logging.log4j:log4j-slf4j2-impl:2.19.0")
    shadow("com.github.Kaktushose:jda-commands:v4.0.0-beta.2") {
        exclude(group = "net.dv8tion", module = "JDA")
    }
}

tasks.withType<JavaCompile> {
    options.compilerArgs.plus("-parameters")
}
stark heath
#

Inspect your dependencies

glad escarp
glad escarp
#

got everything fixed

20:36:54.581 lava-daemon-pool-playback-1-thread YoutubeAccessTo WARN YouTube auth tokens can't be retrieved because email and password is not set in YoutubeAudioSourceManager, age restricted videos will throw exceptions.
20:36:54.810 lava-daemon-pool-playback-1-thread YoutubeSignatur ERROR Problematic YouTube player script /s/player/a87a9450/player_ias.vflset/en_US/base.js detected (issue detected with script: no n function match). Dumped to /tmp/lavaplayer-yt-player-script673970531048256089.js

but now having this issue

stark hull
#

don't use built in youtube source

glad escarp
#

what do I use then...? i'm confused lol

stark hull
glad escarp
#

wtf

#

this confusing ash from the older lava player

stark hull
#

how

glad escarp
stark hull
#

?

stark heath
#

I would recommend to read the so called README.md

glad escarp
#

im looking at this test bot and it makes 0 damn sense lmaooo

stark heath
#

Perhaps you shouldn't look at code used for testing

#

Because

#

Well it's used for testing

glad escarp
#

i mean wha all do to get this working lmao...?

glad escarp
#

i mean I am thank you lol

stark heath
#

There is literally a migration guide

glad escarp
#

im looking at it, and it makes less than 0 sense

stark hull
#

how

#

what bit are you stuck on

#

and don't say all of it, that's not helpful

glad escarp
stark hull
#

then break it into segments

glad escarp
#

i mean my project ran off the old lp stuff

stark hull
#

this source was designed to be used with minimal changes to anyone who didn't run very custom youtube stuff

#

wherever you register your sources

stark heath
#

If you can't even say what you don't understand I am afraid there is nothing we can do to help you

stark hull
#

just change the call to exclude the built-in source

glad escarp
stark hull
glad escarp
#

i'm going brain dead

stark hull
#

where do you call that in your code

stark heath
#

*i'm brain dead

glad escarp
glad escarp
stark hull
#

ctrl+f

#

if in doubt

#

but it's in that snippet you sent...

glad escarp
#

omg i'm such an idiot

#

wait

#

I'm lost again

stark hull
#

on what part

glad escarp
#

Type mismatch.
Required:
MediaContainerRegistry!
Found:
YoutubeAudioSourceManager

stark hull
#

what version of lavaplayer are you using

glad escarp
#

implementation("dev.arbjerg:lavaplayer:2.2.1")

stark hull
#

oh I see what you've done

#

yeah re-read that section of the readme

#

it's not asking for an instance of the source manager

glad escarp
#

which readme?

#

i have 2 loaded

stark hull
#

youtube-source

glad escarp
#
21:21:28.419 lava-daemon-pool-playback-1-thread            YoutubeAccessTo WARN   YouTube auth tokens can't be retrieved because email and password is not set in YoutubeAudioSourceManager, age restricted videos will throw exceptions.
21:21:28.639 lava-daemon-pool-playback-1-thread            YoutubeSignatur ERROR  Problematic YouTube player script /s/player/a87a9450/player_ias.vflset/en_US/base.js detected (issue detected with script: no n function match). Dumped to /tmp/lavaplayer-yt-player-script17928021990097794162.js```
stark hull
#

you are still not using youtube-source

glad escarp
#

but I am...? or atleast think i am

stark hull
#

you're not

#

youtube-source doesn't have issues with n functions

#

and does not do account authentication like that

glad escarp
stark hull
#

show code

glad escarp
stark hull
#

wrong youtube source

glad escarp
#

trying to do the one in the readme

stark hull
#

if your IDE can't find it then it's not imported

glad escarp
stark hull
#

you... haven't even imported it?

#

🤨

glad escarp
#

I thought I only needed lavaplayer...?

stark hull
#

have you followed any of the readme

glad escarp
#

what do I need then..?

stark hull
#

bruh

glad escarp
#

i see that but I don't know what to import...?

stark hull
glad escarp
stark hull
#

that's common

#

if you use v2 it will import common automatically

#

but v2 offers additional clients that expose thumbnails

glad escarp
#

I don't understand this v2 stuff

stark hull
#

v2 is for users of lavaplayer 2.x

#

common is for lavaplayer 1.x

#

you use 2.x

#

so you want v2.

glad escarp
#

i can't find the version i need for this

stark hull
#

¯_(ツ)_/¯

glad escarp
#

is it the same?

stark hull
#

same as what

glad escarp
#

the lavaplayer version 2.2.1?

stark hull
#

no

glad escarp
#

then where do i find...?

stark hull
#

c'mon dude at least try

glad escarp
#

I am!

#

1.7.1?

stark hull
#

try it n see

#

there is also #updates

glad escarp
#

my ide isn't giving me the elephant with the () reload thing ugh

#

uhm

21:40:23.207 JDA [0 / 1] MainWS-ReadThread [0 / 1] CommandDispatch INFO Executing command onJoin for user Member:Dad(id=329452869897945088, user=User:devanmysterio(id=329452869897945088), guild=Guild:Flash-Networks âš¡(id=860683236920131584))
21:40:30.444 JDA [0 / 1] MainWS-ReadThread [0 / 1] CommandDispatch INFO Executing command onPlay for user Member:Dad(id=329452869897945088, user=User:devanmysterio(id=329452869897945088), guild=Guild:Flash-Networks âš¡(id=860683236920131584))
21:40:37.345 lava-daemon-pool-playback-1-thread YoutubeAccessTo INFO Updating YouTube visitor id succeeded, new one is CgttN3djWTR2Yk9BRSjV4J62BjIKCgJVUxIEGgAgHToMCAEg5tv45tKK7ONm, next update will be after 600 seconds.

#

no errors but it's not playing...?

#

@stark hull got any ideas?

stark hull
#

debug logs

#

ideally from lavaplayer and the youtube-source module

#

log track exception events also

glad escarp
stark hull
#

36mMatroskaAudioTr DEBUG Starting to play track with codec A_OPUS

#

looks ok

#

AudioPlayer  DEBUG Triggering cleanup on an audio player playing track dev.lavalink.youtube.track.YoutubeAudioTrack@f80031e

#

does not look OK

#

you are not polling the player for frames

glad escarp
stark hull
#

which indicates your voice connection has not been completely established, or you're not setting the send handler

glad escarp
#

i mean if I send my music stuff you care to look at it and possibly point in the right direction?

stark hull
#

mmm

#

not really

glad escarp
stark hull
#

if i make an exception for you then i have to for everyone else

glad escarp
#

I'm generally lost then lol

#

yep nope lost

#

i tried

#

I don't know exactly why it's not playing the song, it has it in the queue

#

do you mind helping a person out this one time lol i'm so unsure lol

glad escarp
#

figured it out cryLaugh

#

Wait @stark hull can I play spotify stuff with this new lavaplayer stuff?