Ambiguous method overloading for method java.io.File

Support for Ubuntu and other Desktop Linux distributions
Post Reply
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Ambiguous method overloading for method java.io.File

Post by devster »

I got the following error using FileBot 4.8.2

Code: Select all

Ambiguous method overloading for method java.io.File#<init>.
Cannot resolve which method to invoke for [class java.lang.String, null] due to overlapping prototypes between:
	[class java.lang.String, class java.lang.String]
	[class java.lang.String, class java.io.File]
groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.io.File#<init>.
Cannot resolve which method to invoke for [class java.lang.String, null] due to overlapping prototypes between:
	[class java.lang.String, class java.lang.String]
	[class java.lang.String, class java.io.File]
	at Script1.run(Script1.groovy:163)
	at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:64)
	at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:74)
	at net.filebot.cli.ArgumentProcessor.runScript(ArgumentProcessor.java:154)
	at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:36)
	at net.filebot.Main.main(Main.java:131)

Failure (°_°)
this is the command I used:

Code: Select all

/usr/bin/filebot -script fn:amc --action keeplink --output /cephfs/Media --conflict skip --filter '!readLines("/scripts/exludes.txt").contains(n)' -non-strict --log-file amc.log --def excludeList=.excludes --def ut_dir=/downloads/complete/movies/Apollo.13.1995.1080p.BluRay.DTS.x264-NTb.mkv ut_kind=single ut_title=Apollo.13.1995.1080p.BluRay.DTS.x264-NTb.mkv ut_label=movies --def @/scripts/notify.txt --def movieFormat=@/scripts/movieFormat.groovy --def seriesFormat=@/scripts/seriesFormat.groovy --def animeFormat=@/scripts/animeFormat.groovy
Locking /filebot/logs/amc.log
Run script [fn:amc] at [Fri Mar 29 18:49:32 CET 2019]
Parameter: excludeList = .excludes
Parameter: ut_dir = /downloads/complete/movies/Apollo.13.1995.1080p.BluRay.DTS.x264-NTb.mkv
Parameter: ut_kind = single
Parameter: ut_title = Apollo.13.1995.1080p.BluRay.DTS.x264-NTb.mkv
Parameter: ut_label = movies
Parameter: pushover = *****
Parameter: mail = *****
Parameter: mailto = *****
Parameter: reportError = y
Parameter: movieFormat = { very long }
Parameter: seriesFormat = { longer }
Parameter: animeFormat = { actually pretty short }
Is the error something in my setup? name of the file? format?

Code: Select all

FileBot 4.8.2 (r5789)
JNA Native: 5.2.2
MediaInfo: 18.05
7-Zip-JBinding: 9.20
Chromaprint: 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2019-02-26 (r552)
Groovy: 2.5.1
JRE: Java(TM) SE Runtime Environment 10.0.2
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 32 Core / 15 GB Max Memory / 37 MB Used Memory
OS: Linux (amd64)
HW: Linux 8c5268cf0de4 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
DATA: /filebot
Package: DOCKER
License: FileBot License PX7346945 (Valid-Until: 2069-03-22) # I hope this isn't hackable
Done ヾ(@⌒ー⌒@)ノ
I only work in black and sometimes very, very dark grey. (Batman)
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Ambiguous method overloading for method java.io.File

Post by rednoah »

Which binary package are you using in your custom docker image? Most Linux binaries are built against Java 8. Have you tried using the Java 8 JRE?
:idea: Please read the FAQ and How to Request Help.
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: Ambiguous method overloading for method java.io.File

Post by devster »

I'm using the deb package from official repo, relevant bit of the Dockerfile:

Code: Select all

    echo "**** add FileBot repository ****" && \
    apt-key adv --fetch-keys https://raw.githubusercontent.com/filebot/plugins/master/gpg/maintainer.pub && \
    echo "deb [arch=amd64] https://get.filebot.net/deb/ stable main" > /etc/apt/sources.list.d/filebot.list && \
    apt-get update -q && \
    echo "**** install FileBot package ****" && \
    DEBIAN_FRONTEND=noninteractive \
    apt-get install -y --no-install-recommends \
        filebot
but java version is 10.0.2, the Ubuntu package version:

Code: Select all

Package: openjdk-11-jre-headless
Version: 10.0.2+13-1ubuntu0.18.04.4
I only work in black and sometimes very, very dark grey. (Batman)
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: Ambiguous method overloading for method java.io.File

Post by devster »

I think the issue is ut_kind.
My new script is calculating whether the torrent is single or multi, in the above invocation it was single, using multi seems to fix it.
Root cause seems to be that for some reason qBittorrent doesn't distinguish between the following two (upstream post-process invocation):

Code: Select all

%F: Content path (same as root path for multifile torrent)
%R: Root path (first torrent subdirectory path)
which should refer to file and directory.
I assign Root Path to ut_dir, which in this case refers to a file, yet specify ut_kind as 'single' and no definition for ut_file.

Code: Select all

Parameter: ut_dir = /downloads/complete/movies/Apollo.13.1995.1080p.BluRay.DTS.x264-NTb.mkv
Parameter: ut_title = Apollo.13.1995.1080p.BluRay.DTS.x264-NTb.mkv
I believe this breaks the following:

Code: Select all

if (args.size() == 0) {
	// assume we're called with utorrent parameters (account for older and newer versions of uTorrents)
	if (ut.kind == 'single' || (ut.kind != 'multi' && ut.dir && ut.file)) {
		roots = [new File(ut.dir, ut.file).getCanonicalFile()] // single-file torrent
	} else {
		roots = [new File(ut.dir).getCanonicalFile()] // multi-file torrent
	}
}
I only work in black and sometimes very, very dark grey. (Batman)
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Ambiguous method overloading for method java.io.File

Post by rednoah »

If you're using qBT, then just set --def ut_kind=multi (or not set ut_kind at all) and you're good, regardless of whether --def ut_dir refers to a folder or a file.

:idea: The --def ut_kind=single option instructs the amc script to use both ut_dir and ut_file to create a file path, and that requires both of these options to be set, and AFAIK is only useful for uT integration.
:idea: Please read the FAQ and How to Request Help.
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: Ambiguous method overloading for method java.io.File

Post by devster »

This is exactly the reason why there are two parameters in qBittorrent, it should replicate uT exactly.
It's an issue with qB, not FileBot.
I only work in black and sometimes very, very dark grey. (Batman)
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Ambiguous method overloading for method java.io.File

Post by rednoah »

Not at all. qBT makes sense. uT does not.

In qBT, %F is the path to the downloaded torrent, and that's either a file or a folder.

uT is very unintuitive in that %D refers to the downloaded folder for multi-file torrents (makes sense) but the entire download folder for single-file torrents (doesn't make sense). For uT, %F is not a path, but simply a file name, and a random one at that for multi-file torrents.


i.e. for qBT you can just do filebot "%F" ... and it'll work. For uT you need all those ut_* options and many lines of code to figure out what specific file or folder has just been completed specifically.

e.g. for qBT, you can do this:

Code: Select all

filebot -script fn:amc "%F" --output "/path/to/media" --action duplicate --conflict skip -non-strict --log-file amc.log --def excludeList=amc.excludes unsorted=y music=y artwork=y
I just tend to use the ut_* options to bring all the different integration examples more in line, and pass in as much information as possible (even though it's not necessarily used).
:idea: Please read the FAQ and How to Request Help.
Post Reply