Announcement Announcement Module
Collapse
No announcement yet.
HttpInvoker choked on list with 1000 strings Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • HttpInvoker choked on list with 1000 strings

    Hi All
    I wrote a smal service class which return a list with 1000 strings.
    I am using Httpinvoker to get the service and read the list. If the number of the elements in the list is 100 all is going well when
    I try 1000 it freeze utill there is a connection reset
    The client side is JUnit 4 class with spring runner on the same machine
    by the way the same is happening with Hessian protocol.
    They are both HTML based but this is the only connection I can see RMI and JMS RMI is working fine with the same service
    The service code
    Code:
    public class DateServiceImpl implements DateService {
    
    	
    	/* (non-Javadoc)
    	 * @see com.successcharging.rmiexample.DateService#getDate()
    	 */
    	@Override
    	public Date getDate() {
    		return new Date();
    	}
    
    	@Override
    	public List<String> getBigList() {
    		List<String> listData = new ArrayList<String>();
    		for (int i = 0 ; i < 100;i++) {
    			listData.add(Math.random()+"");
    		}
    		return listData;
    	}
    
    }
    The mapping server side
    Code:
    <!-- The service to use this is the server side -->
    	<bean id="dateServiceServer" class="com.successcharging.rmiexample.server.DateServiceImpl" />
    <!-- the http invoker protocol -->
    	<bean name="/DateServiceHttpInvoker"
    		class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
    		<property name="service" ref="dateServiceServer" />
    		<property name="serviceInterface"
    			value="com.successcharging.rmiexample.server.DateService" />
    	</bean>
    The client mapping
    Code:
    <bean id="dateServiceHttpInvokerClient"
    		class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
    		<property name="serviceUrl"
    			value="http://localhost:8080/Remoting_example/DateServiceHttpInvoker" />
    		<property name="serviceInterface"
    			value="com.successcharging.rmiexample.server.DateService" />
    </bean>
    The junit code
    Code:
    @RunWith(SpringJUnit4ClassRunner.class)
    @ContextConfiguration
    public class DateServiceTest extends BaseTest {
    
    	@Resource
    	private DateService dateServiceHttpInvokerClient;
    	
    	
    	@Test
    	public void testDateServiceHttpInvoker() {
    		List<String> data = dateServiceHttpInvokerClient.getBigList(); //Here it is get stuck
    		data.add("My test");
    		System.out.println("HttpInvoker:"
    				+ data.size());
    	}
    
    	public DateService getDateServiceHttpInvokerClient() {
    		return dateServiceHttpInvokerClient;
    	}
    
    	public void setDateServiceHttpInvokerClient(
    			DateService dateServiceHttpInvoker) {
    		this.dateServiceHttpInvokerClient = dateServiceHttpInvoker;
    	}
    }
    Any ideas ?
Working...
X