Announcement Announcement Module
Collapse
No announcement yet.
How using Commons httpClient Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How using Commons httpClient

    I have simple example of spring remote using http invokers.
    I want change it to use jakarta tomcat httpClient.
    This is my client.xml code
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xsi:schemaLocation="
           http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
    
    	<bean id="personServiceHttpInvokerProxy"
    		class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
    		<property name="serviceUrl"
    			value="http://localhost:8080/personservice/personservice/personService" />
    		<property name="serviceInterface"
    			value="com.personservice.service.PersonService" />
    		<property name="httpInvokerRequestExecutor">
    			<bean
    				class="org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor" />
    		</property>
    	</bean>
    And now, it is error:

    PHP Code:
    Caused byorg.springframework.beans.factory.BeanCreationExceptionError creating bean with name 'org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor#147ee05' defined in class path resource [client.xml]: Instantiation of bean failednested exception is java.lang.NoClassDefFoundErrororg/apache/commons/httpclient/HttpConnectionManager
    Caused by
    java.lang.NoClassDefFoundErrororg/apache/commons/httpclient/HttpConnectionManager 
    .

    Where is mistake? And should i change somthing in my server part?

    sorry for my english

  • #2
    Hello,

    do you have the commons-httpclient.jar file inside your classpath ?
    You need add least the version 3.0

    Have a look at the Javadoc for a greater explanation.
    http://www.springframework.org/docs/...tExecutor.html

    rgds
    agim

    Comment

    Working...
    X