Announcement Announcement Module
Collapse
No announcement yet.
Spring XFire 400 error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring XFire 400 error

    I have a simple Echo Service working in Tomcat and I can pull up the WSDL just fine, but when I go to invoke the service via the XFireProxyFactory, I get the following error:

    Code:
    org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Server returned error code = 400 for URI : http://localhost:8080/services/Echo. Check server logs for details
    org.codehaus.xfire.fault.XFireFault: Server returned error code = 400 for URI : http://localhost:8080/services/Echo. Check server logs for details
        at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)
        at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:83)
        at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114)
        at org.codehaus.xfire.client.Client.invoke(Client.java:336)
        at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
        at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
    Here is my code to envoke the service:
    Code:
            XFireProxyFactory xFireProxyFactory = new XFireProxyFactory(xfire);
    
            Echo echo = null;
            try {
                echo = (Echo) xFireProxyFactory.create(serviceModel, echoUrl);
                System.out.println(echo.getClass().getName());
            } catch (MalformedURLException e) {
                System.out.println("WsClient.callWebService(): EXCEPTION: " + e.toString());
            }
            catch (Exception e) {
                e.printStackTrace();
            }


    Code:
    <bean id="xfire.commonsAnnotations"
            class="org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations"/>
    
        <bean id="xfire.annotationServiceFactory"
              class="org.codehaus.xfire.annotations.AnnotationServiceFactory">
            <constructor-arg index="0">
                <ref bean="xfire.commonsAnnotations"/>
            </constructor-arg>
            <constructor-arg index="1">
                <ref bean="xfire.transportManager"/>
            </constructor-arg>
            <constructor-arg index="2">
                <ref bean="xfire.aegisBindingProvider"/>
            </constructor-arg>
        </bean>
    
        <bean name="/Echo" class="org.codehaus.xfire.spring.remoting.XFireExporter">
            <property name="serviceBean" ref="echo"/>
            <property name="serviceClass">
                <value>com.baselogic.service.Echo</value>
            </property>
            <property name="serviceFactory">
                <ref bean="xfire.annotationServiceFactory"/>
            </property>
        </bean>
    I am running this via the Maven Cargo Tomcat plugin, so I am also not sure where to go to find extra logs.

    Can someone please help me as I have spent all weekend on this 1 issue.

    Your help is appreciated!

  • #2
    Now when I use this to print the Methods of Echo like:

    Code:
    Method[] methods = echo.getClass().getMethods();
                for (Method method : methods) {
                    log.debug("Method Name: " + method.getName());
                }

    I get this:

    [myproject] DEBUG [main] EchoServiceTest.testEchoService(86) | ================================================== ====
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(87) |
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(88) | $Proxy11
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(89) | ================================================== ====
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: hashCode
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: equals
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: toString
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: echo
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: getResponse
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: isProxyClass
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: newProxyInstance
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: getInvocationHandler
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: getProxyClass
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: getClass
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: wait
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: wait
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: wait
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: notify
    [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: notifyAll
    [myproject] ERROR [main] HttpChannel.sendViaClient(129) | Server returned error code = 400 for URI : http://localhost:8080/services/Echo. Check s


    So why then do I get the 400 with this actual call:

    log.debug(echo.echo("This is a test"));

    Comment


    • #3
      I found the Cargo Tomcat5x logs and this is all that is there:

      Code:
      [myproject] INFO [main] UrlRewriteFilter.info(227) | destroy called
      [myproject] INFO [main] 2].log(647) | Closing Spring root WebApplicationContext
      [myproject] INFO [main] XmlWebApplicationContext.doClose(816) | Closing org.springframework.web.context.support.XmlWebApplicationContext@510e39: display name [Root WebApplicationContext]; startup date [Sun Mar 30 12:21:27 PDT 2008]; root of context hierarchy
      [myproject] DEBUG [main] XmlWebApplicationContext.publishEvent(273) | Publishing event in context [[email protected]510e39]: org.springframework.context.event.ContextClosedEvent[source=[email protected]510e39: display name [Root WebApplicationContext]; startup date [Sun Mar 30 12:21:27 PDT 2008]; root of context hierarchy]
      [myproject] INFO [main] DefaultListableBeanFactory.destroySingletons(341) | Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@159780d: defining beans [org.springframework.context.config.internalBeanConfigurerAspect,org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor#0,entityManagerFactory,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.config.internalTransactionAdvisor,org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor#1,xfire.customEditorConfigurer,xfire.serviceRegistry,xfire.transportManager,xfire,xfire.typeMappingRegistry,xfire.aegisBindingProvider,xfire.serviceFactory,xfire.servletController,xfire.messageServiceFactory,xfire.messageBindingProvider,org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor#2,echo,filterChainProxy,httpSessionContextIntegrationFilter,logoutFilter,authenticationProcessingFilter,securityContextHolderAwareRequestFilter,anonymousProcessingFilter,exceptionTranslationFilter,filterInvocationInterceptor,authenticationManager,accessDecisionManager,daoAuthenticationProvider,org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor#3,userDetailsService,userCache,loggerListener,xfire.commonsAnnotations,xfire.annotationServiceFactory,/Echo]; root of factory hierarchy
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'accessDecisionManager': [filterInvocationInterceptor]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'org.acegisecurity.vote.AuthenticatedVoter#1192059': [accessDecisionManager]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'org.acegisecurity.vote.RoleVoter#8b058b': [accessDecisionManager]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'org.acegisecurity.ui.AccessDeniedHandlerImpl#24de7d': [exceptionTranslationFilter]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint#879860': [exceptionTranslationFilter]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'authenticationManager': [authenticationProcessingFilter, filterInvocationInterceptor]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'daoAuthenticationProvider': [authenticationManager]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'userCache': [daoAuthenticationProvider]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'org.springframework.cache.ehcache.EhCacheFactoryBean#12a73d9': [userCache]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'org.springframework.cache.ehcache.EhCacheManagerFactoryBean#6833f2': [org.springframework.cache.ehcache.EhCacheFactoryBean#12a73d9]
      [myproject] DEBUG [main] DisposableBeanAdapter.destroy(148) | Invoking destroy() on bean with name 'org.springframework.cache.ehcache.EhCacheManagerFactoryBean#6833f2'
      [myproject] INFO [main] EhCacheManagerFactoryBean.destroy(139) | Shutting down EHCache CacheManager
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'userDetailsService': [daoAuthenticationProvider]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'org.springframework.beans.factory.config.PropertiesFactoryBean#1672bbb': [userDetailsService]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'org.acegisecurity.ui.logout.SecurityContextLogoutHandler#11daa0e': [logoutFilter]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'xfire.annotationServiceFactory': [/Echo]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'xfire.commonsAnnotations': [xfire.annotationServiceFactory]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'echo': [/Echo]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'xfire.messageBindingProvider': [xfire.messageServiceFactory]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'xfire.aegisBindingProvider': [xfire.serviceFactory, xfire.annotationServiceFactory]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'xfire.typeMappingRegistry': [xfire.aegisBindingProvider]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'xfire': [xfire.servletController]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'xfire.serviceRegistry': [xfire]
      [myproject] DEBUG [main] DisposableBeanAdapter.destroy(148) | Invoking destroy() on bean with name 'org.springframework.context.config.internalBeanConfigurerAspect'
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean '(inner bean)': [(inner bean), org.springframework.transaction.config.internalTransactionAdvisor]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'transactionManager': [(inner bean)]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'entityManagerFactory': [transactionManager]
      [myproject] DEBUG [main] DisposableBeanAdapter.destroy(148) | Invoking destroy() on bean with name 'entityManagerFactory'
      [myproject] INFO [main] LocalEntityManagerFactoryBean.destroy(381) | Closing JPA EntityManagerFactory for persistence unit 'ApplicationEntityManager'
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'xfire.transportManager': [org.codehaus.xfire.spring.editors.ServiceFactoryEditor#10c6cfc, xfire, xfire.serviceFactory, xfire.messageServiceFactory, xfire.annotationServiceFactory]
      [myproject] DEBUG [main] DefaultListableBeanFactory.destroyBean(389) | Retrieved dependent beans for bean 'org.codehaus.xfire.spring.editors.ServiceFactoryEditor#10c6cfc': [xfire.customEditorConfigurer]
      [myproject] DEBUG [main] DisposableBeanAdapter.invokeCustomDestroyMethod(203) | Invoking destroy method 'dispose' on bean with name 'xfire.transportManager'
      30-Mar-2008 12:21:53 org.apache.coyote.http11.Http11BaseProtocol destroy
      INFO: Stopping Coyote HTTP/1.1 on http-8080

      Comment


      • #4
        Been working at this more, and I get something else now:

        Code:
        [myproject] DEBUG [main] EchoServiceTest.testEchoService(88) | $Proxy11
        [myproject] DEBUG [main] EchoServiceTest.testEchoService(89) | ======================================================
        [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: hashCode
        [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: equals
        [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: toString
        [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: echo
        [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: getResponse
        [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: isProxyClass
        [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: newProxyInstance
        [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: getInvocationHandler
        [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: getProxyClass
        [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: getClass
        [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: wait
        [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: wait
        [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: wait
        [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: notify
        [myproject] DEBUG [main] EchoServiceTest.testEchoService(92) | Method Name: notifyAll
        [myproject] DEBUG [main] XFireProxy.invoke(50) | Method [echo] [This is a test]
        [myproject] DEBUG [main] HttpTransport.createNewChannel(34) | Creating new channel for uri: urn:xfire:transport:http:12069059942810-936054201
        [myproject] DEBUG [main] HandlerPipeline.addHandler(64) | adding handler org.codehaus.xfire.handler.OutMessageSender@bcb23e to phase send
        [myproject] DEBUG [main] HandlerPipeline.addHandler(64) | adding handler org.codehaus.xfire.soap.handler.SoapActionOutHandler@5a3923 to phase tra
        nsport
        [myproject] DEBUG [main] HandlerPipeline.addHandler(64) | adding handler org.codehaus.xfire.soap.handler.SoapSerializerHandler@15d616e to phase p
        ost-invoke
        [myproject] DEBUG [main] HandlerPipeline.invoke(115) | Invoking phase post-invoke
        [myproject] DEBUG [main] HandlerPipeline.invoke(129) | Invoking handler org.codehaus.xfire.soap.handler.SoapSerializerHandler in phase post-invok
        e
        [myproject] DEBUG [main] HandlerPipeline.invoke(115) | Invoking phase policy
        [myproject] DEBUG [main] HandlerPipeline.invoke(115) | Invoking phase user
        [myproject] DEBUG [main] HandlerPipeline.invoke(115) | Invoking phase transport
        [myproject] DEBUG [main] HandlerPipeline.invoke(129) | Invoking handler org.codehaus.xfire.soap.handler.SoapActionOutHandler in phase transport
        [myproject] DEBUG [main] HandlerPipeline.invoke(115) | Invoking phase send
        [myproject] DEBUG [main] HandlerPipeline.invoke(129) | Invoking handler org.codehaus.xfire.handler.OutMessageSender in phase send
        [myproject] ERROR [main] HttpChannel.sendViaClient(129) | Server returned error code = 400 for URI : http://localhost:8080/services/Echo. Check s
        erver logs for details
        org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Server returned err
        or code = 400 for URI : http://localhost:8080/services/Echo. Check server logs for details
        org.codehaus.xfire.fault.XFireFault: Server returned error code = 400 for URI : http://localhost:8080/services/Echo. Check server logs for detail
        s
        This is what I am trying to execute to get the error:

        log.debug(echo.echo("This is a test"));

        Comment

        Working...
        X