Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Problem between SWT and Servlet communication

Avatar of shivasr_india
shivasr_india asked on
Java EEEditors IDEs
6 Comments1 Solution418 ViewsLast Modified:
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.getName());

            xstream.alias("InputCommand", InputCommand.class);
            xstream.alias(getSimpleName(inParam), inParam.getClass());
            xstream.alias("CommandError", CommandError.class);

//Execute the method.
                  int statusCode = client.executeMethod(method);

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
ASKER CERTIFIED SOLUTION
Avatar of Tomas Helgi Johannsson
Tomas Helgi JohannssonFlag of Iceland imageDatabase Administrator / Software Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answers