I already know that there are other topics about this but i can't find the answer to my problems. I've downloaded morena's package to use Twain and WIA api, because i need to make a java application which use local scanner to do document's scan. I have one single jar with all the classes i need and I've put this in my project folder correctly (I use net beans to program), and I've done a test application that allow to use my epson scanner and do the scan. When i run this error appears: Exception in thread "main" java.lang.SecurityException: class "SynchronousHelper"'s signer information does not match signer information of other classes in the same package.
In the other topics, some users suggest to open the manifest and delete all the signature but when i do this, net beans mark an error because there aren't signatures. Someone has an idea? Sorry if there are some grammars mistakes but i'm italian. thanks to everyone.
import eu.gnome.morena.*;
import java.awt.image.BufferedImage;
import java.util.List;
public class main {
public static void main(String[] args) throws Exception {
Manager manager = Manager.getInstance();
//Vector that contains the references to all my local scanners
List<? extends Device> devices = manager.listDevices();
//the position [0] contains my epson scanner
Device device = (Device) devices.get(0);
if (device instanceof Scanner) {
Scanner scanner = (Scanner) device;
scanner.setMode(Scanner.RGB_8);
scanner.setResolution(75);
scanner.setFrame(100, 100, 500, 500);
} else if (device instanceof Camera) {
}
//SynchronousHelper--> the class that make problems
BufferedImage bimage = SynchronousHelper.scanImage(device);
System.out.println("Informazioni del file scannerizzato: dimensioni=(" + bimage.getWidth() + ", " + bimage.getHeight() + ") bit mode=" + bimage.getColorModel().getPixelSize());
Thread.sleep(30000);
}
}