I-Al-Istannen / TogetherJavaBot

A bot for the Togetherjava discord server
MIT License
4 stars 1 forks source link

Application not starting in windows #2

Open fwustrack opened 4 years ago

fwustrack commented 4 years ago

I tried to run the application on windows but it fails during startup with the followinf stacktrace. It seems like there is a problem with a path / url

21:13:09.732 [main] INFO org.togetherjava.ApplicationEntry - Looking for a config path in the 'TJ_CONFIG_PATH' environment variable... 21:13:09.736 [main] INFO org.togetherjava.ApplicationEntry - Using config 'F:\TogetherJavaBot-master\src\main\resources\config.toml'. 21:13:09.783 [main] INFO org.togetherjava.ApplicationEntry - Looking for bot token in the supplied config... 21:13:09.784 [main] INFO org.togetherjava.ApplicationEntry - Token acquired 21:13:09.963 [main] INFO o.f.c.i.license.VersionPrinter - Flyway Community Edition 5.2.4 by Boxfuse 21:13:10.253 [main] INFO o.f.c.i.database.DatabaseFactory - Database: jdbc:sqlite:db.sqlite (SQLite 3.28) 21:13:10.281 [main] INFO o.f.core.internal.command.DbValidate - Successfully validated 1 migration (execution time 00:00.010s) 21:13:10.283 [main] INFO o.f.core.internal.command.DbMigrate - Current version of schema "main": 1 21:13:10.284 [main] INFO o.f.core.internal.command.DbMigrate - Schema "main" is up to date. No migration necessary. Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at de.ialistannen.commandprocrastination.autodiscovery.CommandDiscovery.findAllCommands(CommandDiscovery.java:72) at de.ialistannen.commandprocrastination.autodiscovery.CommandDiscovery.findCommands(CommandDiscovery.java:33) at org.togetherjava.command.CommandListener.<init>(CommandListener.java:40) at org.togetherjava.TogetherJavaBot.start(TogetherJavaBot.java:64) at org.togetherjava.ApplicationEntry.main(ApplicationEntry.java:51) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481) at de.ialistannen.commandprocrastination.autodiscovery.CommandDiscovery.instantiate(CommandDiscovery.java:94) at de.ialistannen.commandprocrastination.autodiscovery.CommandDiscovery.findAllCommands(CommandDiscovery.java:70) ... 4 more Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 5: https://docs.oracle.com/en/java/javase/12/docs/api at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182) at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153) at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77) at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92) at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229) at java.base/java.nio.file.Path.of(Path.java:147) at de.ialistannen.htmljavadocparser.resolving.UrlDocumentResolver.relativizeAbsoluteUrl(UrlDocumentResolver.java:59) at org.togetherjava.docs.JfxDocumentResolver.relativizeAbsoluteUrl(JfxDocumentResolver.java:29) at de.ialistannen.htmljavadocparser.resolving.DocumentResolver.relativizeAbsoluteUrl(DocumentResolver.java:38) at de.ialistannen.htmljavadocparser.resolving.CachingDocumentResolver.relativizeAbsoluteUrl(CachingDocumentResolver.java:35) at de.ialistannen.htmljavadocparser.resolving.HtmlSummaryParser.extractFqn(HtmlSummaryParser.java:108) at de.ialistannen.htmljavadocparser.resolving.HtmlSummaryParser.index(HtmlSummaryParser.java:71) at de.ialistannen.htmljavadocparser.resolving.HtmlSummaryParser.getTypes(HtmlSummaryParser.java:137) at de.ialistannen.htmljavadocparser.JavadocApi$ApiEntry.<init>(JavadocApi.java:120) at de.ialistannen.htmljavadocparser.JavadocApi.addApi(JavadocApi.java:39) at org.togetherjava.docs.DocsApi.<init>(DocsApi.java:52) at org.togetherjava.command.commands.javadoc.JavadocBaseCommand.<init>(JavadocBaseCommand.java:26) ... 11 more

I-Al-Istannen commented 4 years ago

Thanks :) I sadly don't have a Windows readily available, but I know what is causing this: Laziness on my part, based on the incorrect assumption that Windows is as lenient AS linux with file paths. I will fix that tomorrow after Christmas Eve has passed here.

Thank you for reporting that and have a lovely Christmas! :)

fwustrack commented 4 years ago

Yeah seems like Windows does not like the ":" in paths.

I forked your project and made some small changes before i decided to write a bot with spring boot. Your project gave me some good pointers for how I can to that. Thanks for that. Another thing i saw is that the Method "private boolean hasSameParameters(Invocable invocable)" in JavadocSelector always returns false. Is that intended?

I hope you also have a great Christmas!