This is my first experience with saned daemon and also with jfreesane.
When I try to close a SaneSession I get an exception in my java application and my daemon closes.
Consider this code:
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import au.com.southsky.jfreesane.SaneSession;
public class Test {
public static void main(String[] args) throws UnknownHostException, IOException {
SaneSession session = SaneSession.withRemoteSane(InetAddress.getByName("::1"));
session.close();
}
}
This is the command line execution:
$ java -cp lib/jfreesane-0.91.jar:lib/guava-18.0.jar:bin Test
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.io.Closeables.closeQuietly(Ljava/io/Closeable;)V
at au.com.southsky.jfreesane.SaneSession.close(SaneSession.java:133)
at Test.main(Test.java:11)
ABRT problem creation: 'success'
This is the saned daemon output:
$ saned -d255
[saned] main: starting debug mode (level 255)
[saned] read_config: searching for config file
[saned] read_config: done reading config
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.24 starting up
[saned] do_bindings: trying to get port for service "sane-port" (getaddrinfo)
[saned] do_bindings: [1] socket () using IPv6
[saned] do_bindings: [1] setsockopt ()
[saned] do_bindings: [1] bind () to port 6566
[saned] do_bindings: [1] listen ()
[saned] do_bindings: [0] socket () using IPv4
[saned] do_bindings: [0] setsockopt ()
[saned] do_bindings: [0] bind () to port 6566
[saned] do_bindings: [0] bind failed: Address already in use
[saned] run_standalone: waiting for control connection
[saned] handle_connection: processing client connection
[saned] check_host: access by remote host: ::1
[saned] check_host: remote host is IN6_LOOPBACK: access granted
[saned] init: access granted
[saned] init: access granted to danilo@::1
[saned] process_request: waiting for request
[saned] process_request: got request 10
[saned] bailing out, waiting for children...
[saned] bail_out: all children exited
I've tried to compile au.com.southsky.jfreesane.SaneSessionTest but I got many compilation errors of:
The method closeQuietly(InputStream) in the type Closeables is not applicable for the arguments (SaneDevice)
and one of:
The method closeQuietly(InputStream) in the type Closeables is not applicable for the arguments (FileOutputStream)
My system is Fedora 20, java-1.7.0-openjdk-1.7.0.65-2.5.1.3.fc20.x86_64, sane-backends-1.0.24-7.fc20.x86_64
Thanks