Announcement Announcement Module
Collapse
No announcement yet.
HTTP invoker with httpclient 2.0.2 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • HTTP invoker with httpclient 2.0.2

    I have commons-httpclient-2.0.2.jar in my classpath, but when trying to instantiate an HttpInvokerProxyFactoryBean from my BeanFactory, I get a NoClassDefFoundError complaining about org/apache/commons/httpclient/methods/RequestEntity (Introduced in httpclient v3).

    Can anyone confirm that the CommonsHttpInvokerRequestExecutor is in fact compatible with httpclient 2.x, as stated in the Spring API Javadoc?

    My Spring configuration is below:

    Code:
    <bean id="httpInvokerProxy" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
            <property name="serviceInterface">
                <value>com.mycompany.TestService</value>
            </property>
    
            <property name="serviceUrl">
                <value>http://localhost:8084/TestApp/remoting/TestService-httpinvoker</value>
            </property>
    
            <property name="httpInvokerRequestExecutor">
                <bean class="org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor"/>
            </property>
        </bean>
    The error stack trace is below:

    Code:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'httpInvokerProxy' defined in resource loaded through SAX InputSource: Cannot create inner bean 'org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor#1f01a29' of type [org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor] while setting bean property 'httpInvokerRequestExecutor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor#1f01a29' defined in resource loaded through SAX InputSource: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/httpclient/methods/RequestEntity
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor#1f01a29' defined in resource loaded through SAX InputSource: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/httpclient/methods/RequestEntity
    Caused by: java.lang.NoClassDefFoundError: org/apache/commons/httpclient/methods/RequestEntity
    Thanks for any tips.

  • #2
    Unfortunately, it's the javadoc that is wrong there: As of Spring 2.0, CommonsHttpInvokerRequestExecutor requires Commons HttpClient 3.0. I'm afraid you'll have to upgrade your commons-httpclient.jar accordingly.

    Juergen

    Comment

    Working...
    X