0
봄 mvc의 웹 응용 프로그램에서 스캐너를 실행할 때이 오류가 나타납니다. 나는 byte 메소드를 사용하여 그것을 byte 배열로 반환했다. 여기 생각twain 스캐너 mmscomputing 상태 3에 있지만 상태 5에 있지 않은 소스
uk.co.mmscomputing.device.twain.TwainIOException: uk.co.mmscomputing.device.twain.TwainScanner.setException:
uk.co.mmscomputing.device.twain.TwainSource.checkState:
Source not in state 3 but in state 5.
at uk.co.mmscomputing.device.twain.TwainScanner.signalException(TwainScanner.java:131)
at uk.co.mmscomputing.device.twain.jtwain.signalException(jtwain.java:287)
at uk.co.mmscomputing.device.twain.jtwain.cbexecute(jtwain.java:243)
at uk.co.mmscomputing.device.twain.jtwain.nstart(Native Method)
at uk.co.mmscomputing.device.twain.jtwain.access$200(jtwain.java:12)
at uk.co.mmscomputing.device.twain.jtwain$1.run(jtwain.java:338)
uk.co.mmscomputing.device.twain.TwainIOException: uk.co.mmscomputing.device.twain.TwainSource.checkState:
Source not in state 3 but in state 5.
at uk.co.mmscomputing.device.twain.TwainSource.checkState(TwainSource.java:48)
at uk.co.mmscomputing.device.twain.TwainSourceManager.openSource(TwainSourceManager.java:90)
at uk.co.mmscomputing.device.twain.jtwain.cbexecute(jtwain.java:234)
at uk.co.mmscomputing.device.twain.jtwain.nstart(Native Method)
at uk.co.mmscomputing.device.twain.jtwain.access$200(jtwain.java:12)
at uk.co.mmscomputing.device.twain.jtwain$1.run(jtwain.java:338)
내 코드는 오류입니다 :
@RequestMapping(value = "/scanImage", method = RequestMethod.GET)
@ResponseBody
public byte[] scanImage()
{
ByteArrayOutputStream byteArrayOutputStream = null;
Scanner scanner = null;
try
{
SCANIMAGE scanImage = new SCANIMAGE();
scanImage.scanStarter();
byte[] buffer = new byte[4096];
byteArrayOutputStream = new ByteArrayOutputStream();
FileInputStream inputStream = new FileInputStream("D:/IMAGE.jpg");
System.out.println("IMAGE Number : D:/IMAGE.jpg");
int read = 0;
while ((read = inputStream.read(buffer)) != -1)
{
byteArrayOutputStream.write(buffer, 0, read);
}
}
catch (ScannerIOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (FileNotFoundException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
return byteArrayOutputStream.toByteArray();
}
오류 메시지가 누락되었습니다. – Waldheinz
오류 메시지는 TwainIOException입니다. – user2853287