nielsbasjes / yauaa

Yet Another UserAgent Analyzer
https://yauaa.basjes.nl
Apache License 2.0
772 stars 131 forks source link

Errors When Loading Files. #1461

Closed kuoche1712003 closed 4 months ago

kuoche1712003 commented 4 months ago

I have the same issue. I use the quarkus framework. This is my demo. When I use the uber jar. It's OK.

./mvnw package -Dquarkus.package.jar.type=uber-jar
java -jar target/*-runner.jar

But, when I use the package, it can not find the file.

./mvnw package
java -jar target/quarkus-app/quarkus-run.jar
2024-06-17 23:08:44,666 INFO  [nl.bas.par.use.uti.YauaaVersion] (vert.x-eventloop-thread-0) 
2024-06-17 23:08:44,676 ERROR [nl.bas.par.use.con.ConfigLoader] (vert.x-eventloop-thread-0) Cannot load the resources (usually classloading problem).
2024-06-17 23:08:44,676 ERROR [nl.bas.par.use.con.ConfigLoader] (vert.x-eventloop-thread-0) - Resource   : URL [jar:file:/Users/kuochehuang/Downloads/demo/target/quarkus-app/lib/main/nl.basjes.parse.useragent.yauaa-7.26.1.jar!/Additional-Tests.yaml]
2024-06-17 23:08:44,676 ERROR [nl.bas.par.use.con.ConfigLoader] (vert.x-eventloop-thread-0) - Filename   : Additional-Tests.yaml
2024-06-17 23:08:44,676 ERROR [nl.bas.par.use.con.ConfigLoader] (vert.x-eventloop-thread-0) - Description: URL [jar:file:/Users/kuochehuang/Downloads/demo/target/quarkus-app/lib/main/nl.basjes.parse.useragent.yauaa-7.26.1.jar!/Additional-Tests.yaml]
2024-06-17 23:08:44,676 WARN  [nl.bas.par.use.con.ConfigLoader] (vert.x-eventloop-thread-0) Falling back to the built in list of resources
2024-06-17 23:08:44,677 ERROR [nl.bas.par.use.con.ConfigLoader] (vert.x-eventloop-thread-0) NO config files were found matching this expression: classpath*:UserAgents/**/*.yaml
2024-06-17 23:08:44,677 WARN  [nl.bas.par.use.con.ConfigLoader] (vert.x-eventloop-thread-0) Unable to load the default resources, usually caused by classloader problems.
2024-06-17 23:08:44,677 WARN  [nl.bas.par.use.con.ConfigLoader] (vert.x-eventloop-thread-0) Retrying with built in list.

Originally posted by @kuoche1712003 in https://github.com/nielsbasjes/yauaa/issues/1336#issuecomment-2173703152

nielsbasjes commented 4 months ago

It gives warnings and errors because the classloader in your application is behaving abnormal. The real question: Do the fall back constructs work? Does Yauaa work in your app?

kuoche1712003 commented 4 months ago

Thank you for reporting this issue. I have investigated the matter and can confirm that the fall back constructs is work. Through testing, I have verified that there is no discernible difference in initialization times between the two approaches mentioned. I will close this issue.