TWAIN ActiveX Control, Plug-in, Scanner SDK, Component, HTTP Control/SDK

Dynamsoft TWAIN Products

Support Community for TWAIN Control/Component/SDK for Scanning Solutions
* Login   * Register
* FAQ    * Search

It is currently Sun May 20, 2012 3:19 pm




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: IndexOutOfBoundsException on Ubuntu 9.10
PostPosted: Tue Jun 21, 2011 3:20 am 
Offline

Joined: Tue Jun 21, 2011 3:10 am
Posts: 3
I tried Dynamic Web Twain Plugin and ScanToFile sources. They work well on Windows, but I got IndexOutOfBoundsException on Ubuntu. Any suggestion?


Top
 Profile  
 
 Post subject: Re: IndexOutOfBoundsException on Ubuntu 9.10
PostPosted: Tue Jun 21, 2011 9:05 pm 
Offline
User avatar

Joined: Tue Mar 08, 2005 12:23 am
Posts: 1075
Currently, Dynamic Web TWAIN doesn't support Ubuntu as a client. I've added your request to our feature list for future consideration.

Meanwhile, if you are interested in, you can follow us on facebook to get the latest news.
http://www.facebook.com/Dynamsoft

_________________
Catherine Sea
TWAIN Support Team
TWAIN ActiveX/Plug-in for Web Applications, Scanner COM Control
TWAIN .NET Component/SDK for Desktop Applications

Follow me @Twitter, Facebook
Image


Top
 Profile  
 
 Post subject: Re: IndexOutOfBoundsException on Ubuntu 9.10
PostPosted: Wed Jun 22, 2011 1:43 am 
Offline

Joined: Tue Jun 21, 2011 3:10 am
Posts: 3
I was not clear. I tried with Windows as server and Windows as client. It works. But if I try with Ubuntu as server and Windows as client, I get this exception


Top
 Profile  
 
 Post subject: Re: IndexOutOfBoundsException on Ubuntu 9.10
PostPosted: Wed Jun 22, 2011 3:29 am 
Offline

Joined: Tue Jun 21, 2011 3:10 am
Posts: 3
It seems that in SaveToFile.jsp there are some problems with these lines:

int startPos = ((file.substring(0, pos)).getBytes()).length;
int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;

probably because of different charset.

I replaced all code of jsp with new code, based con Apache Commons FileUpload:

---- BEGIN
String contentType = request.getContentType();
if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0)) {

try {
List items = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request);

for (int i=0;i<items.size();i++) {
FileItem item = (FileItem)items.get(i);
String fieldname = item.getFieldName();
String filename = FilenameUtils.getName(item.getName());

InputStream filecontent = item.getInputStream();

File f=new File("/home/andrea/jboss-4.0.3SP1/temp/" +filename);
OutputStream outS=new FileOutputStream(f);
byte buf[]=new byte[1024];
int len;
while((len=filecontent.read(buf))>0)
outS.write(buf,0,len);
outS.close();
filecontent.close();
}
} catch (FileUploadException e) {
throw new ServletException("Cannot parse multipart request.", e);
} catch (IOException e){
throw new ServletException("Cannot write file", e);
}
}

---- END

Now, it works and the file is saved correctly, but action page returns "Http process error" and property "HTTPPostResponseString" is empty. Uploading is by method "HTTPUploadAllThroughPostAsPDF".
Any idea?


Top
 Profile  
 
 Post subject: Re: IndexOutOfBoundsException on Ubuntu 9.10
PostPosted: Wed Jun 22, 2011 6:19 pm 
Offline
User avatar

Joined: Tue Mar 08, 2005 12:23 am
Posts: 1075
Quote:
but action page returns "Http process error" and property "HTTPPostResponseString" is empty.

You may get such a problem when the server returns " ". To better pinpoint the cause of the problem, shall we have an online meeting? If it is convenient for you, you can contact our support team via Live Help first:
http://www.dynamsoft.com/Support/livehelp.aspx

_________________
Catherine Sea
TWAIN Support Team
TWAIN ActiveX/Plug-in for Web Applications, Scanner COM Control
TWAIN .NET Component/SDK for Desktop Applications

Follow me @Twitter, Facebook
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

It is currently Sun May 20, 2012 3:19 pm


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Copyright © 2010 Dynamsoft Corporation. All Rights Reserved. | Knowledge Base | Source Control Blog