shivasr_india
asked on
Problem between SWT and Servlet communication
Hi All,
I Am the first time visitor to this group, I am having a small issue.
In our applicaiton we have SWT application talking with Spring web tier through XStream, serialised communication, calling a servlet in Web tier application like below
//Create an instance of HttpClient.
HttpClient client = getHttpClient();
XStream xstream = new XStream(new DomDriver(ENCODING));
OutputCommand cmdOut = null;
Object inParam = commandsInParams.get(cmd.g etName());
xstream.alias("InputComman d", InputCommand.class);
xstream.alias(getSimpleNam e(inParam) , inParam.getClass());
xstream.alias("CommandErro r", CommandError.class);
//Execute the method.
int statusCode = client.executeMethod(metho d);
This InputCommand has arraylist of objects contained in it.
Now, the Servlet has a private method which passes the arraylist of objects extracted from request - serialized bean like ..
private void methodName(List params)
{
ArrayList shortlisted = new Arraylist();
for (Iterator iterator = params.iterator(); iterator.hasNext();) {
Object xyz = iterator.next();
if(valid(xyz))
{
shortlisted.add(xyz);
}
}
}
The issue is the XStream is throwing the exception that (premature end of input) may be request contents get truncated.. If I change the access modifier to protected it works fine, but Iam not able explain why? to my boss, can you please help
I Am the first time visitor to this group, I am having a small issue.
In our applicaiton we have SWT application talking with Spring web tier through XStream, serialised communication, calling a servlet in Web tier application like below
//Create an instance of HttpClient.
HttpClient client = getHttpClient();
XStream xstream = new XStream(new DomDriver(ENCODING));
OutputCommand cmdOut = null;
Object inParam = commandsInParams.get(cmd.g
xstream.alias("InputComman
xstream.alias(getSimpleNam
xstream.alias("CommandErro
//Execute the method.
int statusCode = client.executeMethod(metho
This InputCommand has arraylist of objects contained in it.
Now, the Servlet has a private method which passes the arraylist of objects extracted from request - serialized bean like ..
private void methodName(List params)
{
ArrayList shortlisted = new Arraylist();
for (Iterator iterator = params.iterator(); iterator.hasNext();) {
Object xyz = iterator.next();
if(valid(xyz))
{
shortlisted.add(xyz);
}
}
}
The issue is the XStream is throwing the exception that (premature end of input) may be request contents get truncated.. If I change the access modifier to protected it works fine, but Iam not able explain why? to my boss, can you please help
Hello, can you post the full stack trace?
> If I change the access modifier to protected it works fine
Which access modifier, of the "xstream" object?
Which access modifier, of the "xstream" object?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
We are unable to trace the issue, however we redployed the class file, it solved temporarily, thanks for your suggestion.
ASKER
Please close this issue,.. as per your suggestion